diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index cf58e3ca156d26..aa85ea11d42d0a 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -74,9 +74,7 @@ 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/ -RUN chown -R $USERNAME:$USERNAME /opt/fsl-imx-xwayland/5.10-hardknott/ RUN chown -R $USERNAME:$USERNAME /opt/fsl-imx-xwayland/5.15-kirkstone/ -RUN chown -R $USERNAME:$USERNAME /opt/fsl-imx-wayland/5.15-kirkstone/ # Add access to openocd for VSCode debugging RUN chown -R $USERNAME:$USERNAME /opt/openocd diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5f9e3b8e8da158..d53628fb6274e0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -316,7 +316,9 @@ jobs: - name: Run Python library specific unit tests timeout-minutes: 5 run: | - scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip-0.0-cp37-abi3-linux_x86_64.whl' + scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl' + scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip_clusters-0.0-py3-none-any.whl' + scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip_repl-0.0-py3-none-any.whl' scripts/run_in_build_env.sh '(cd src/controller/python/test/unit_tests/ && python3 -m unittest -v)' build_darwin: diff --git a/.github/workflows/examples-bl602.yaml b/.github/workflows/examples-bl602.yaml new file mode 100644 index 00000000000000..56166d9e667756 --- /dev/null +++ b/.github/workflows/examples-bl602.yaml @@ -0,0 +1,79 @@ +# 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. + +name: Build example - BL602 + +on: + push: + pull_request: + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} + cancel-in-progress: true + +jobs: + bl602: + name: BL602 + timeout-minutes: 90 + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: connectedhomeip/chip-build:latest + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - uses: Wandalen/wretry.action@v1.0.15 + name: Checkout + with: + action: actions/checkout@v3 + with: | + token: ${{ github.token }} + attempt_limit: 3 + attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform bl602 + + - name: Set up environment for size reports + if: ${{ !env.ACT }} + env: + GH_CONTEXT: ${{ toJson(github) }} + run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + + - name: Build example BL602 Lighting App + timeout-minutes: 30 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target bl602-light build" + + - name: Get Lighting size stats + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py bl602 bl602 lighting-app \ + out/bl602-light/chip-bl602-lighting-example.out /tmp/bloat_reports/ + + - name: Build example BL602 Lighting App with RPCs + timeout-minutes: 30 + run: | + scripts/examples/gn_bl602_example.sh lighting-app ./out/bl602-light-rpc 'import("//with_pw_rpc.gni")' + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py bl602 bl602+rpc lighting-app \ + out/bl602-light-rpc/chip-bl602-lighting-example.out /tmp/bloat_reports/ + + - name: Uploading Size Reports + uses: actions/upload-artifact@v2 + if: ${{ !env.ACT }} + with: + name: Size,BL602-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }} + path: | + /tmp/bloat_reports/ diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index d8509480619562..59df7eabc678b0 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -70,7 +70,7 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ --target linux-arm64-all-clusters \ - --target linux-arm64-chip-tool-no-interactive-ipv6only \ + --target linux-arm64-chip-tool-ipv6only \ --target linux-arm64-lock \ --target linux-arm64-minmdns \ --target linux-arm64-thermostat-no-ble \ @@ -80,8 +80,8 @@ jobs: timeout-minutes: 5 run: | .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux arm64 chip-tool-no-interactive-ipv6only \ - out/linux-arm64-chip-tool-no-interactive-ipv6only/chip-tool \ + linux arm64 chip-tool-ipv6only \ + out/linux-arm64-chip-tool-ipv6only/chip-tool \ /tmp/bloat_reports/ - name: Bloat report - thermostat timeout-minutes: 5 diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml index e1fb25379daf7a..47c2657fb8f9e5 100644 --- a/.github/workflows/examples-linux-imx.yaml +++ b/.github/workflows/examples-linux-imx.yaml @@ -31,12 +31,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - # TODO: this image SHOULD use a newer version. - # - # NOTE: After https://github.com/project-chip/connectedhomeip/pull/19941 - # the image became large enough that github CI runs out of space. - # The image has increased from aroud 2.5GB to 10+GB - image: connectedhomeip/chip-build-imx:0.5.79 + image: connectedhomeip/chip-build-imx:0.5.85 steps: - uses: Wandalen/wretry.action@v1.0.15 diff --git a/.github/workflows/examples-mw320.yaml b/.github/workflows/examples-mw320.yaml new file mode 100755 index 00000000000000..c22e74b8c86c8a --- /dev/null +++ b/.github/workflows/examples-mw320.yaml @@ -0,0 +1,84 @@ +# Copyright (c) 2020-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: Build example - MW320 + +on: + push: + pull_request: + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} + cancel-in-progress: true + +jobs: + mw320: + name: MW320 + timeout-minutes: 60 + + env: + BUILD_TYPE: gn_mw320 + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: connectedhomeip/chip-build:0.5.84 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - uses: Wandalen/wretry.action@v1.0.15 + name: Checkout + with: + action: actions/checkout@v3 + with: | + token: ${{ github.token }} + attempt_limit: 3 + attempt_delay: 2000 + - name: Checkout submodules + run: scripts/checkout_submodules.py --shallow --platform mw320 + + - name: Set up environment for size reports + if: ${{ !env.ACT }} + env: + GH_CONTEXT: ${{ toJson(github) }} + run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + + - name: Bootstrap + timeout-minutes: 25 + run: scripts/build/gn_bootstrap.sh + - name: Uploading bootstrap logs + uses: actions/upload-artifact@v2 + if: ${{ always() && !env.ACT }} + with: + name: bootstrap-logs + path: | + .environment/gn_out/.ninja_log + .environment/pigweed-venv/*.log + - name: Build MW320 all clusters example app + timeout-minutes: 20 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target 'mw320-all-clusters-app' \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Uploading Size Reports + uses: actions/upload-artifact@v2 + if: ${{ !env.ACT }} + with: + name: Size,MW320-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }} + path: | + /tmp/bloat_reports/ diff --git a/.gitignore b/.gitignore index a53e0ca21a4fd8..5baec0fd0ed020 100644 --- a/.gitignore +++ b/.gitignore @@ -63,4 +63,5 @@ compile_commands.json *~ # log files -*.log \ No newline at end of file +*.log +examples/thermostat/ameba/build diff --git a/BUILD.gn b/BUILD.gn index b54672a8124a27..d47a70de083298 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -140,7 +140,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { if (enable_pylib) { deps += [ "${chip_root}/src/pybindings/pycontroller" ] } - deps += [ "${chip_root}/src/controller/python" ] + deps += [ "${chip_root}/src/controller/python:chip-repl" ] } } @@ -166,7 +166,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { if (enable_pylib) { data_deps += [ "${chip_root}/src/pybindings/pycontroller" ] } - data_deps += [ "${chip_root}/src/controller/python" ] + data_deps += [ "${chip_root}/src/controller/python:chip-repl" ] } write_runtime_deps = "${root_out_dir}/certification.runtime_deps" diff --git a/build/chip/linux/gdbus_library.gni b/build/chip/linux/gdbus_library.gni index 11424b14d341d2..0c27b77d6918cb 100644 --- a/build/chip/linux/gdbus_library.gni +++ b/build/chip/linux/gdbus_library.gni @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -glib_config = rebase_path(":glib") -gen_dbus_wrapper = rebase_path("gen_gdbus_wrapper.py") +glib_config = get_label_info(":glib", "label_no_toolchain") +gen_dbus_wrapper = get_path_info("gen_gdbus_wrapper.py", "abspath") # Runs gdbus-codegen and defines the resulting library. # diff --git a/build_overrides/p6.gni b/build_overrides/p6.gni index c3e9fd7939b8a1..0ae9c543ee8456 100644 --- a/build_overrides/p6.gni +++ b/build_overrides/p6.gni @@ -16,3 +16,8 @@ declare_args() { # Root directory for p6 SDK build files. p6_sdk_build_root = "//third_party/p6" } + +declare_args() { + # Root directory for p6 SDK sources. + p6_sdk_root = "${p6_sdk_build_root}/p6_sdk" +} diff --git a/config/nrfconnect/chip-module/Kconfig b/config/nrfconnect/chip-module/Kconfig index 2fe7f24571eaff..b377c65c2e222f 100644 --- a/config/nrfconnect/chip-module/Kconfig +++ b/config/nrfconnect/chip-module/Kconfig @@ -123,7 +123,7 @@ config CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE factory data. # Use default certificates without generating or providing them -config CHIP_FACTORY_DATA_USE_DEFAULTS_CERTS +config CHIP_FACTORY_DATA_USE_DEFAULT_CERTS bool "Use default certificates located in Matter repository" default y help @@ -254,4 +254,35 @@ config CHIP_DEVICE_ROTATING_DEVICE_UID A device rotating id unique id which will be generated if this config is not set in prj.conf file. +config CHIP_DEVICE_ENABLE_KEY + string "Enable Key for triggering test actions on device" + default "00112233445566778899AABBCCDDEEFF" + help + The Enable Key is a 128-bit value that triggers test action + while invoking the TestEventTrigger Command. + Pattern: "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + This value is used during Certification Tests, + and should not be present on production devices. + +config CHIP_CERTIFICATION_DECLARATION_STORAGE + bool "Enable storing Certification Declaration" + depends on CHIP_FACTORY_DATA + help + Enables storing Certification Declaration in Zephyr settings + instead of using hardcoded value from firmware. It also adds + support for including new Certification Declaration into a firmware + update image package sent via OTA Software Update. + +if CHIP_CERTIFICATION_DECLARATION_STORAGE + +config CHIP_CERTIFiCATION_DECLARATION_OTA_IMAGE_ID + int "Certification declaration OTA image id" + default 205 #0xcd + help + The image id of Certification Declaration image + for sending it via OTA Software Update purposes. + +endif + + endif diff --git a/config/nrfconnect/chip-module/generate_factory_data.cmake b/config/nrfconnect/chip-module/generate_factory_data.cmake index 02b6e6ce4c0ac0..fb0d0cd354eb35 100644 --- a/config/nrfconnect/chip-module/generate_factory_data.cmake +++ b/config/nrfconnect/chip-module/generate_factory_data.cmake @@ -55,10 +55,12 @@ if(NOT CONFIG_CHIP_DEVICE_GENERATE_ROTATING_DEVICE_UID) else() string(APPEND script_args "--rd_uid \"${CONFIG_CHIP_DEVICE_ROTATING_DEVICE_UID}\"\n") endif() +else() + string(APPEND script_args "--generate_rd_uid\n") endif() # for development purpose user can use default certs instead of generating or providing them -if(CONFIG_CHIP_FACTORY_DATA_USE_DEFAULTS_CERTS) +if(CONFIG_CHIP_FACTORY_DATA_USE_DEFAULT_CERTS) # convert decimal PID to its hexadecimal representation to find out certification files in repository math(EXPR LOCAL_PID "${CONFIG_CHIP_DEVICE_PRODUCT_ID}" OUTPUT_FORMAT HEXADECIMAL) string(SUBSTRING ${LOCAL_PID} 2 -1 raw_pid) @@ -68,14 +70,9 @@ if(CONFIG_CHIP_FACTORY_DATA_USE_DEFAULTS_CERTS) string(APPEND script_args "--dac_key \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-DAC-${raw_pid}-Key.der\"\n") string(APPEND script_args "--pai_cert \"${CHIP_ROOT}/credentials/development/attestation/Matter-Development-PAI-noPID-Cert.der\"\n") else() - # try to generate a new DAC and PAI certs and DAC key - # request script to generate a new certificates - # by adding an argument to script_args - find_program(chip-cert NAMES chip-cert) - if(NOT chip-cert) - message(FATAL_ERROR "Could not find chip_cert_path executable in PATH") - endif() - string(APPEND script_args "--chip_cert_path ${chip-cert}\n") + find_program(chip_cert_exe NAMES chip-cert REQUIRED) + string(APPEND script_args "--gen_cd\n") + string(APPEND script_args "--chip_cert_path ${chip_cert_exe}\n") endif() # add Password-Authenticated Key Exchange parameters @@ -88,16 +85,18 @@ string(APPEND script_args "--passcode ${CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE}\n") if(CONFIG_CHIP_FACTORY_DATA_GENERATE_SPAKE2_VERIFIER) # request script to generate a new spake2_verifier # by adding an argument to script_args - find_program(spake_exe NAMES spake2p) - if(NOT spake_exe) - message(FATAL_ERROR "Could not find spake2p executable in PATH") - endif() + find_program(spake_exe NAMES spake2p REQUIRED) string(APPEND script_args "--spake2p_path ${spake_exe}\n") else() # Spake2 verifier should be provided using kConfig string(APPEND script_args "--spake2_verifier \"${CONFIG_CHIP_DEVICE_SPAKE2_TEST_VERIFIER}\"\n") endif() +if(CONFIG_CHIP_DEVICE_ENABLE_KEY) +# Add optional EnableKey that triggers user-specific action. +string(APPEND script_args "--enable_key \"${CONFIG_CHIP_DEVICE_ENABLE_KEY}\"\n") +endif() + # Set output JSON file and path to SCHEMA file to validate generated factory data string(APPEND script_args "-o \"${output_path}/${factory_data_target}.json\"\n") string(APPEND script_args "-s \"${schema_path}\"\n") diff --git a/docs/guides/nrfconnect_factory_data_configuration.md b/docs/guides/nrfconnect_factory_data_configuration.md index 9e587c85030fdb..3dc71cd58ddd92 100644 --- a/docs/guides/nrfconnect_factory_data_configuration.md +++ b/docs/guides/nrfconnect_factory_data_configuration.md @@ -228,6 +228,9 @@ $ python scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py -h --passcode --spake2p_path ``` + > Note: To generate new SPAKE2+ verifier you need `spake2p` executable. See + > the note at the end of this section to learn how to get it. + - Manual: ``` @@ -235,7 +238,19 @@ $ python scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py -h ``` d. Add paths to `.der` files that contain PAI and DAC certificates and the - DAC private key (replace the respective variables with the file names): + DAC private key (replace the respective variables with the file names) using + one of the following methods: + + - Automatic: + + ``` + --chip_cert_path + ``` + + > Note: To generate new certificates, you need the `chip-cert` executable. + > See the note at the end of this section to learn how to get it. + + - Manual: ``` --dac_cert .der --dac_key .der --pai_cert .der @@ -328,6 +343,17 @@ If the script finishes successfully, go to the location you provided with the > 3. Add the `connectedhomeip/src/tools/spake2p/out/spake2p` path as an > argument of `--spake2p_path` for the Python script. +> Note: Generating new certificates is optional if default vendor and product +> IDs are used and requires providing a path to the `chip-cert` executable. To +> get it, complete the following steps: +> +> 1. Navigate to the `connectedhomeip` root directory. +> 2. In a terminal, run the command: +> `cd src/tools/chip-cert && gn gen out && ninja -C out chip-cert` to build +> the executable. +> 3. Add the `connectedhomeip/src/tools/chip-cert/out/chip-cert` path as an +> argument of `--chip_cert_path` for the Python script. + > Note: By default, overwriting the existing JSON file is disabled. This means > that you cannot create a new JSON file with the same name in the exact > location as an existing file. To allow overwriting, add the `--overwrite` @@ -625,6 +651,27 @@ $ west build -b nrf52840dk_nrf52840 -- \ -DCONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=y ``` +You can also build an example with auto-generation of new CD, DAC and PAI +certificates. The newly generated certificates will be added to factory data set +automatically. To generate new certificates disable using default certificates +by building an example with the additional option +`-DCHIP_FACTORY_DATA_USE_DEFAULT_CERTS=n`: + +``` +$ west build -b nrf52840dk_nrf52840 -- \ +-DCONFIG_CHIP_FACTORY_DATA=y \ +-DCONFIG_CHIP_FACTORY_DATA_BUILD=y \ +-DCONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=y \ +-DCONFIG_CHIP_FACTORY_DATA_USE_DEFAULT_CERTS=n +``` + +> Note: To generate new certificates using the nRF Connect platform build +> system, you need the `chip-cert` executable in your system variable PATH. To +> learn how to get `chip-cert`, go to the note at the end of +> [creating the factory data partition with the second script](#creating-the-factory-data-partition-with-the-second-script) +> section, and then add the newly built executable to the system variable PATH. +> The Cmake build system will find this executable automatically. + After that, use the following command from the example's directory to write firmware and newly generated factory data at the same time: diff --git a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp index 43b6043b73d256..be4a44dc8a2985 100644 --- a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp +++ b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp @@ -59,10 +59,10 @@ K_MSGQ_DEFINE(sAppEventQueue, sizeof(AppEvent), APP_EVENT_QUEUE_SIZE, alignof(Ap namespace { -// NOTE! This key is for test/certification only and should not be available in production devices. -// Ideally, it should be a part of the factory data set. -constexpr uint8_t kTestEventTriggerEnableKey[16] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, - 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; +// NOTE! This key is for test/certification only and should not be available in production devices! +// If CONFIG_CHIP_FACTORY_DATA is enabled, this value is read from the factory data. +uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, + 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; LEDWidget sStatusLED; UnusedLedsWrapper<3> sUnusedLeds{ { DK_LED2, DK_LED3, DK_LED4 } }; @@ -191,12 +191,20 @@ CHIP_ERROR AppTask::Init() SetDeviceInstanceInfoProvider(&mFactoryDataProvider); SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); SetCommissionableDataProvider(&mFactoryDataProvider); + // Read EnableKey from the factory data. + MutableByteSpan enableKey(sTestEventTriggerEnableKey); + err = mFactoryDataProvider.GetEnableKey(enableKey); + if (err != CHIP_NO_ERROR) + { + LOG_ERR("mFactoryDataProvider.GetEnableKey() failed. Could not delegate a test event trigger"); + memset(sTestEventTriggerEnableKey, 0, sizeof(sTestEventTriggerEnableKey)); + } #else SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); #endif static CommonCaseDeviceServerInitParams initParams; - static OTATestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(kTestEventTriggerEnableKey) }; + static OTATestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(sTestEventTriggerEnableKey) }; (void) initParams.InitializeStaticResourcesBeforeServerInit(); initParams.testEventTriggerDelegate = &testEventTriggerDelegate; ReturnErrorOnFailure(chip::Server::GetInstance().Init(initParams)); diff --git a/examples/all-clusters-app/nxp/mw320/BUILD.gn b/examples/all-clusters-app/nxp/mw320/BUILD.gn index f267fe5875bebf..e93e919d6cf253 100644 --- a/examples/all-clusters-app/nxp/mw320/BUILD.gn +++ b/examples/all-clusters-app/nxp/mw320/BUILD.gn @@ -49,7 +49,7 @@ mw320_sdk("sdk") { mw320_executable("shell_mw320") { include_dirs = [] defines = [] - output_name = "all-cluster-mw320.out" + output_name = "chip-mw320-all-clusters-app.out" public_deps = [ ":sdk", diff --git a/examples/all-clusters-app/nxp/mw320/README.md b/examples/all-clusters-app/nxp/mw320/README.md index af1c09621398d8..95905446be40e3 100755 --- a/examples/all-clusters-app/nxp/mw320/README.md +++ b/examples/all-clusters-app/nxp/mw320/README.md @@ -39,8 +39,8 @@ $ gn gen out/debug $ ninja -v -C out/debug ``` -Example application binary file "all-cluster-mw320.bin" will be generated under -directory "out/debug". +Example application binary file "chip-mw320-all-clusters-app.bin" will be +generated under directory "out/debug". Note: @@ -74,7 +74,7 @@ Prepare MW320 download firmware image: ``` $ ln -sf third_party/connectedhomeip/third_party/nxp/mw320_sdk/repo mw320_sdk -$ mw320_sdk/tools/mw_img_conv/bin/mw_img_conv mcufw out/debug/all-cluster-mw320.bin out/debug/all-cluster-mw320.mcufw.bin 0x1F010000 +$ mw320_sdk/tools/mw_img_conv/bin/mw_img_conv mcufw out/debug/chip-mw320-all-clusters-app.bin out/debug/all-cluster-mw320.mcufw.bin 0x1F010000 $ cp out/debug/all-cluster-mw320.mcufw.bin mw320_sdk/mw320_matter_flash/Matter/. ``` diff --git a/examples/all-clusters-app/p6/BUILD.gn b/examples/all-clusters-app/p6/BUILD.gn index 59ae7f12293bac..07dae88a3cf33d 100644 --- a/examples/all-clusters-app/p6/BUILD.gn +++ b/examples/all-clusters-app/p6/BUILD.gn @@ -41,10 +41,9 @@ declare_args() { } config("p6_ota_config") { - ldflags = [ "-T/" + rebase_path( - "${chip_root}/third_party/p6/p6_sdk/ota/cy8c6xxa_cm4_dual_ota_int.ld", - "/", - "${p6_project_dir}") ] + linker_script = "${p6_sdk_root}/ota/cy8c6xxa_cm4_dual_ota_int.ld" + + ldflags = [ "-T" + rebase_path(linker_script, root_build_dir) ] ldflags += [ "-Wl,--defsym,MCUBOOT_HEADER_SIZE=0x400,--defsym,MCUBOOT_BOOTLOADER_SIZE=0x18000,--defsym,CY_BOOT_PRIMARY_1_SIZE=0x1C0000" ] @@ -100,21 +99,21 @@ p6_sdk_sources("all_clusters_app_sdk_sources") { if (chip_enable_ota_requestor) { sources += [ - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/bootutil/src/bootutil_misc.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_map.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_psoc6.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_smif_psoc6.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/mem_config_sfdp.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/bootutil/src/bootutil_misc.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_map.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_psoc6.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_smif_psoc6.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/mem_config_sfdp.c", ] include_dirs += [ - "${chip_root}/third_party/p6/p6_sdk/ota/config", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/flash_map_backend/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/sysflash/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/bootutil/include", + "${p6_sdk_root}/ota/config", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/flash_map_backend/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/sysflash/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/bootutil/include", ] public_configs += [ ":p6_ota_config" ] } diff --git a/examples/all-clusters-app/tizen/BUILD.gn b/examples/all-clusters-app/tizen/BUILD.gn index d860d723befcfe..42756173d54506 100644 --- a/examples/all-clusters-app/tizen/BUILD.gn +++ b/examples/all-clusters-app/tizen/BUILD.gn @@ -60,7 +60,7 @@ executable("chip-all-clusters-app") { tizen_sdk_package("chip-all-clusters-app:tpk") { deps = [ ":chip-all-clusters-app" ] - manifest = rebase_path("tizen-manifest.xml") + manifest = "tizen-manifest.xml" sign_security_profile = "CHIP" } diff --git a/examples/all-clusters-minimal-app/p6/BUILD.gn b/examples/all-clusters-minimal-app/p6/BUILD.gn index a9b88c2125b219..b7e60c58938cec 100644 --- a/examples/all-clusters-minimal-app/p6/BUILD.gn +++ b/examples/all-clusters-minimal-app/p6/BUILD.gn @@ -41,10 +41,9 @@ declare_args() { } config("p6_ota_config") { - ldflags = [ "-T/" + rebase_path( - "${chip_root}/third_party/p6/p6_sdk/ota/cy8c6xxa_cm4_dual_ota_int.ld", - "/", - "${p6_project_dir}") ] + linker_script = "${p6_sdk_root}/ota/cy8c6xxa_cm4_dual_ota_int.ld" + + ldflags = [ "-T" + rebase_path(linker_script, root_build_dir) ] ldflags += [ "-Wl,--defsym,MCUBOOT_HEADER_SIZE=0x400,--defsym,MCUBOOT_BOOTLOADER_SIZE=0x18000,--defsym,CY_BOOT_PRIMARY_1_SIZE=0x1C0000" ] @@ -100,21 +99,21 @@ p6_sdk_sources("all_clusters_app_sdk_sources") { if (chip_enable_ota_requestor) { sources += [ - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/bootutil/src/bootutil_misc.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_map.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_psoc6.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_smif_psoc6.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/mem_config_sfdp.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/bootutil/src/bootutil_misc.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_map.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_psoc6.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_smif_psoc6.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/mem_config_sfdp.c", ] include_dirs += [ - "${chip_root}/third_party/p6/p6_sdk/ota/config", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/flash_map_backend/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/sysflash/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/bootutil/include", + "${p6_sdk_root}/ota/config", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/flash_map_backend/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/sysflash/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/bootutil/include", ] public_configs += [ ":p6_ota_config" ] } diff --git a/examples/all-clusters-minimal-app/tizen/BUILD.gn b/examples/all-clusters-minimal-app/tizen/BUILD.gn index 07b6bf6260943e..5ad384009938c3 100644 --- a/examples/all-clusters-minimal-app/tizen/BUILD.gn +++ b/examples/all-clusters-minimal-app/tizen/BUILD.gn @@ -60,7 +60,7 @@ executable("chip-all-clusters-minimal-app") { tizen_sdk_package("chip-all-clusters-minimal-app:tpk") { deps = [ ":chip-all-clusters-minimal-app" ] - manifest = rebase_path("tizen-manifest.xml") + manifest = "tizen-manifest.xml" sign_security_profile = "CHIP" } diff --git a/examples/build_overrides/p6.gni b/examples/build_overrides/p6.gni index 843e3bad7f4aed..91890631da64bf 100644 --- a/examples/build_overrides/p6.gni +++ b/examples/build_overrides/p6.gni @@ -16,3 +16,8 @@ declare_args() { # Root directory for P6 SDK. p6_sdk_build_root = "//third_party/connectedhomeip/third_party/p6" } + +declare_args() { + # Root directory for p6 SDK sources. + p6_sdk_root = "${p6_sdk_build_root}/p6_sdk" +} diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index ecc3ef52766d55..2a04a980a419a7 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -4,13 +4,18 @@ #include #include #include +#include -bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, chip::Optional pinCode) +bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const chip::Optional & pinCode, + chip::app::Clusters::DoorLock::DlOperationError & err) { + err = DlOperationError::kUnspecified; return true; } -bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, chip::Optional pinCode) +bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const chip::Optional & pinCode, + chip::app::Clusters::DoorLock::DlOperationError & err) { + err = DlOperationError::kUnspecified; return true; } diff --git a/examples/chip-tool/commands/interactive/InteractiveCommands.cpp b/examples/chip-tool/commands/interactive/InteractiveCommands.cpp index 28263ba287027d..33b030acb335c7 100644 --- a/examples/chip-tool/commands/interactive/InteractiveCommands.cpp +++ b/examples/chip-tool/commands/interactive/InteractiveCommands.cpp @@ -99,7 +99,7 @@ bool InteractiveStartCommand::ParseCommand(char * command) std::string arg; std::stringstream ss(command); - while (ss >> std::quoted(arg)) + while (ss >> std::quoted(arg, '\'')) { if (argsCount == kInteractiveModeArgumentsMaxLength) { diff --git a/examples/darwin-framework-tool/BUILD.gn b/examples/darwin-framework-tool/BUILD.gn index 0cdc445fd9ffa5..de6a3e35157baa 100644 --- a/examples/darwin-framework-tool/BUILD.gn +++ b/examples/darwin-framework-tool/BUILD.gn @@ -24,7 +24,7 @@ if (config_use_interactive_mode) { assert(chip_build_tools) -action("build-darwin-framwork") { +action("build-darwin-framework") { script = "${chip_root}/scripts/build/build_darwin_framework.py" inputs = [ "${chip_root}/src/darwin/Framework/Matter.xcodeproj" ] @@ -51,7 +51,8 @@ config("config") { "${chip_root}/examples/darwin-framework-tool/commands/common", "${chip_root}/zzz_generated/darwin-framework-tool", "${chip_root}/zzz_generated/controller-clusters", - "${chip_root}/examples/chip-tool/commands/clusters/ComplexArgument.h", + "${chip_root}/examples/chip-tool", + "${chip_root}/zzz_generated/chip-tool", "${root_out_dir}/macos_framework_output", ] @@ -70,13 +71,11 @@ config("config") { executable("darwin-framework-tool") { sources = [ - # We have to include privilege-storage.cpp here, not in the "Darwin - # framework" library, because otherwise the weak symbols from - # RequiredPrivilege.cpp mean we never actually pull in the function from - # privilege-storage.cpp. - "${chip_root}/src/app/util/privilege-storage.cpp", + "${chip_root}/examples/chip-tool/commands/common/Command.cpp", + "${chip_root}/examples/chip-tool/commands/common/Command.h", + "${chip_root}/examples/chip-tool/commands/common/Commands.cpp", + "${chip_root}/examples/chip-tool/commands/common/Commands.h", "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp", - "${chip_root}/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h", "commands/clusters/ClusterCommandBridge.h", "commands/clusters/ModelCommandBridge.mm", "commands/clusters/ReportCommandBridge.h", @@ -99,11 +98,20 @@ executable("darwin-framework-tool") { ] deps = [ - ":build-darwin-framwork", - "${chip_root}/examples/chip-tool:chip-tool-utils", - "${chip_root}/src/app/server", - "${chip_root}/src/lib", - "${chip_root}/src/platform", + ":build-darwin-framework", + "${chip_root}/src/app/tests/suites/commands/delay", + + # IM is needed for MTRError + "${chip_root}/src/app/tests/suites/commands/interaction_model", + + # Log is needed by tests UserPrompt and Log + "${chip_root}/src/app/tests/suites/commands/log", + + # System is needed by tests FactoryReset etc.. + "${chip_root}/src/app/tests/suites/commands/system", + + # pics is needed by tests + "${chip_root}/src/app/tests/suites/pics", "${chip_root}/third_party/inipp", "${chip_root}/third_party/jsoncpp", ] diff --git a/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h index fc20000bc72040..8aa6456f1ef73b 100644 --- a/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h +++ b/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h @@ -21,8 +21,6 @@ #import "MTRError_Utils.h" #import -#include - #include "ModelCommandBridge.h" class ClusterCommand : public ModelCommand { @@ -97,7 +95,7 @@ class ClusterCommand : public ModelCommand { }]; if (mRepeatDelayInMs.HasValue()) { - chip::test_utils::SleepMillis(mRepeatDelayInMs.Value()); + [NSThread sleepForTimeInterval:((double) mRepeatDelayInMs.Value()) / 1000]; } } return CHIP_NO_ERROR; diff --git a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm index 24121ff7660f02..0a4089abf749c8 100644 --- a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm +++ b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm @@ -32,8 +32,6 @@ namespace { -bool gIsCommandRunning = NO; - void ClearLine() { printf("\r\x1B[0J"); // Move cursor to the beginning of the line and clear from cursor to end of the screen @@ -44,10 +42,6 @@ void ENFORCE_FORMAT(3, 0) LoggingCallback(const char * module, uint8_t category, ClearLine(); chip::Logging::Platform::LogV(module, category, msg, args); ClearLine(); - - if (gIsCommandRunning == NO) { - rl_forced_update_display(); - } } } // namespace @@ -102,11 +96,9 @@ void ENFORCE_FORMAT(3, 0) LoggingCallback(const char * module, uint8_t category, std::string arg; std::stringstream ss(command); - while (ss >> std::quoted(arg)) { + while (ss >> std::quoted(arg, '\'')) { if (argsCount == kInteractiveModeArgumentsMaxLength) { - gIsCommandRunning = YES; ChipLogError(chipTool, "Too many arguments. Ignoring."); - gIsCommandRunning = NO; return YES; } @@ -116,9 +108,7 @@ void ENFORCE_FORMAT(3, 0) LoggingCallback(const char * module, uint8_t category, } ClearLine(); - gIsCommandRunning = YES; mHandler->RunInteractive(argsCount, args); - gIsCommandRunning = NO; // Do not delete arg[0] while (--argsCount) diff --git a/examples/darwin-framework-tool/commands/pairing/OpenCommissioningWindowCommand.mm b/examples/darwin-framework-tool/commands/pairing/OpenCommissioningWindowCommand.mm index 63078d94fed4e0..2f3eb9e8d2fc41 100644 --- a/examples/darwin-framework-tool/commands/pairing/OpenCommissioningWindowCommand.mm +++ b/examples/darwin-framework-tool/commands/pairing/OpenCommissioningWindowCommand.mm @@ -30,7 +30,7 @@ pairingCode = [controller openPairingWindowWithPIN:mNodeId duration:mCommissioningWindowTimeoutMs discriminator:mDiscriminator - setupPIN:arc4random() + setupPIN:[MTRSetupPayload generateRandomPIN] error:&error]; } diff --git a/examples/darwin-framework-tool/commands/pairing/PairingDelegateBridge.mm b/examples/darwin-framework-tool/commands/pairing/PairingDelegateBridge.mm index 0bd24146b76aba..5aee425f2e3739 100644 --- a/examples/darwin-framework-tool/commands/pairing/PairingDelegateBridge.mm +++ b/examples/darwin-framework-tool/commands/pairing/PairingDelegateBridge.mm @@ -33,6 +33,7 @@ - (void)onStatusUpdate:(MTRPairingStatus)status break; case MTRPairingStatusFailed: ChipLogError(chipTool, "Secure Pairing Failed"); + _commandBridge->SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE); break; case MTRPairingStatusUnknown: ChipLogError(chipTool, "Uknown Pairing Status"); diff --git a/examples/darwin-framework-tool/templates/partials/decodable_value.zapt b/examples/darwin-framework-tool/templates/partials/decodable_value.zapt index 0a9fa851f89dde..76a8e54369f509 100644 --- a/examples/darwin-framework-tool/templates/partials/decodable_value.zapt +++ b/examples/darwin-framework-tool/templates/partials/decodable_value.zapt @@ -27,7 +27,7 @@ {{>decodable_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) }} {{/zcl_struct_items_by_struct_name}} {{else}} - {{#if_chip_enum type}} + {{#if_is_strongly_typed_chip_enum type}} {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})]; {{else}} {{#if_is_strongly_typed_bitmap type}} @@ -39,6 +39,6 @@ {{else}} {{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}]; {{/if_is_strongly_typed_bitmap}} - {{/if_chip_enum}} + {{/if_is_strongly_typed_chip_enum}} {{/if_is_struct}} {{/if}} diff --git a/examples/darwin-framework-tool/templates/tests/tests.js b/examples/darwin-framework-tool/templates/tests/tests.js index 1355977f36cdf7..7da417d0de313b 100644 --- a/examples/darwin-framework-tool/templates/tests/tests.js +++ b/examples/darwin-framework-tool/templates/tests/tests.js @@ -78,6 +78,9 @@ function getTests() { // TODO: Test_TC_MC_3_9 does not work on Darwin for now. tests.disable('Test_TC_APPLAUNCHER_3_9'); + // TODO: Test_TC_BINFO_2_1 does not work on Darwin for now. + tests.disable('Test_TC_BINFO_2_1'); + return tests; } diff --git a/examples/light-switch-app/nrfconnect/main/AppTask.cpp b/examples/light-switch-app/nrfconnect/main/AppTask.cpp index b9c85caf6ff2b8..8ca5fac1429403 100644 --- a/examples/light-switch-app/nrfconnect/main/AppTask.cpp +++ b/examples/light-switch-app/nrfconnect/main/AppTask.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -65,6 +66,11 @@ K_MSGQ_DEFINE(sAppEventQueue, sizeof(AppEvent), kAppEventQueueSize, alignof(AppE Identify sIdentify = { kLightEndpointId, AppTask::IdentifyStartHandler, AppTask::IdentifyStopHandler, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED }; +// NOTE! This key is for test/certification only and should not be available in production devices! +// If CONFIG_CHIP_FACTORY_DATA is enabled, this value is read from the factory data. +uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, + 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; + LEDWidget sStatusLED; LEDWidget sBleLED; LEDWidget sIdentifyLED; @@ -165,12 +171,23 @@ CHIP_ERROR AppTask::Init() SetDeviceInstanceInfoProvider(&mFactoryDataProvider); SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); SetCommissionableDataProvider(&mFactoryDataProvider); + // Read EnableKey from the factory data. + MutableByteSpan enableKey(sTestEventTriggerEnableKey); + err = mFactoryDataProvider.GetEnableKey(enableKey); + if (err != CHIP_NO_ERROR) + { + LOG_ERR("mFactoryDataProvider.GetEnableKey() failed. Could not delegate a test event trigger"); + memset(sTestEventTriggerEnableKey, 0, sizeof(sTestEventTriggerEnableKey)); + } #else SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); #endif - static chip::CommonCaseDeviceServerInitParams initParams; - ReturnErrorOnFailure(initParams.InitializeStaticResourcesBeforeServerInit()); - ReturnErrorOnFailure(Server::GetInstance().Init(initParams)); + + static CommonCaseDeviceServerInitParams initParams; + static OTATestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(sTestEventTriggerEnableKey) }; + (void) initParams.InitializeStaticResourcesBeforeServerInit(); + initParams.testEventTriggerDelegate = &testEventTriggerDelegate; + ReturnErrorOnFailure(chip::Server::GetInstance().Init(initParams)); gExampleDeviceInfoProvider.SetStorageDelegate(&Server::GetInstance().GetPersistentStorage()); chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); diff --git a/examples/lighting-app/nrfconnect/main/AppTask.cpp b/examples/lighting-app/nrfconnect/main/AppTask.cpp index 0b7436a70bdb2c..a2cb35de24fadb 100644 --- a/examples/lighting-app/nrfconnect/main/AppTask.cpp +++ b/examples/lighting-app/nrfconnect/main/AppTask.cpp @@ -58,17 +58,20 @@ using namespace ::chip::DeviceLayer; namespace { -constexpr int kFactoryResetTriggerTimeout = 3000; -constexpr int kFactoryResetCancelWindowTimeout = 3000; -constexpr int kAppEventQueueSize = 10; -constexpr uint8_t kButtonPushEvent = 1; -constexpr uint8_t kButtonReleaseEvent = 0; -constexpr EndpointId kLightEndpointId = 1; -constexpr uint32_t kIdentifyBlinkRateMs = 500; -constexpr uint8_t kDefaultMinLevel = 0; -constexpr uint8_t kDefaultMaxLevel = 254; -constexpr uint8_t kTestEventTriggerEnableKey[16] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, - 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; +constexpr int kFactoryResetTriggerTimeout = 3000; +constexpr int kFactoryResetCancelWindowTimeout = 3000; +constexpr int kAppEventQueueSize = 10; +constexpr uint8_t kButtonPushEvent = 1; +constexpr uint8_t kButtonReleaseEvent = 0; +constexpr EndpointId kLightEndpointId = 1; +constexpr uint32_t kIdentifyBlinkRateMs = 500; +constexpr uint8_t kDefaultMinLevel = 0; +constexpr uint8_t kDefaultMaxLevel = 254; + +// NOTE! This key is for test/certification only and should not be available in production devices! +// If CONFIG_CHIP_FACTORY_DATA is enabled, this value is read from the factory data. +uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, + 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; K_MSGQ_DEFINE(sAppEventQueue, sizeof(AppEvent), kAppEventQueueSize, alignof(AppEvent)); k_timer sFunctionTimer; @@ -173,12 +176,20 @@ CHIP_ERROR AppTask::Init() SetDeviceInstanceInfoProvider(&mFactoryDataProvider); SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); SetCommissionableDataProvider(&mFactoryDataProvider); + // Read EnableKey from the factory data. + MutableByteSpan enableKey(sTestEventTriggerEnableKey); + err = mFactoryDataProvider.GetEnableKey(enableKey); + if (err != CHIP_NO_ERROR) + { + LOG_ERR("mFactoryDataProvider.GetEnableKey() failed. Could not delegate a test event trigger"); + memset(sTestEventTriggerEnableKey, 0, sizeof(sTestEventTriggerEnableKey)); + } #else SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); #endif static CommonCaseDeviceServerInitParams initParams; - static OTATestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(kTestEventTriggerEnableKey) }; + static OTATestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(sTestEventTriggerEnableKey) }; (void) initParams.InitializeStaticResourcesBeforeServerInit(); initParams.testEventTriggerDelegate = &testEventTriggerDelegate; ReturnErrorOnFailure(chip::Server::GetInstance().Init(initParams)); diff --git a/examples/lighting-app/p6/BUILD.gn b/examples/lighting-app/p6/BUILD.gn index fddb3e14405e60..d109d59e10cf24 100644 --- a/examples/lighting-app/p6/BUILD.gn +++ b/examples/lighting-app/p6/BUILD.gn @@ -41,10 +41,9 @@ declare_args() { } config("p6_ota_config") { - ldflags = [ "-T/" + rebase_path( - "${chip_root}/third_party/p6/p6_sdk/ota/cy8c6xxa_cm4_dual_ota_int.ld", - "/", - "${p6_project_dir}") ] + linker_script = "${p6_sdk_root}/ota/cy8c6xxa_cm4_dual_ota_int.ld" + + ldflags = [ "-T" + rebase_path(linker_script, root_build_dir) ] ldflags += [ "-Wl,--defsym,MCUBOOT_HEADER_SIZE=0x400,--defsym,MCUBOOT_BOOTLOADER_SIZE=0x18000,--defsym,CY_BOOT_PRIMARY_1_SIZE=0x1C0000" ] @@ -99,21 +98,21 @@ p6_sdk_sources("lighting_app_sdk_sources") { if (chip_enable_ota_requestor) { sources += [ - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/bootutil/src/bootutil_misc.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_map.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_psoc6.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_smif_psoc6.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/mem_config_sfdp.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/bootutil/src/bootutil_misc.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_map.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_psoc6.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_smif_psoc6.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/mem_config_sfdp.c", ] include_dirs += [ - "${chip_root}/third_party/p6/p6_sdk/ota/config", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/flash_map_backend/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/sysflash/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/bootutil/include", + "${p6_sdk_root}/ota/config", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/flash_map_backend/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/sysflash/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/bootutil/include", ] public_configs += [ ":p6_ota_config" ] } diff --git a/examples/lighting-app/tizen/BUILD.gn b/examples/lighting-app/tizen/BUILD.gn index dac62cb04f346a..b104d8bc474428 100644 --- a/examples/lighting-app/tizen/BUILD.gn +++ b/examples/lighting-app/tizen/BUILD.gn @@ -41,7 +41,7 @@ executable("chip-lighting-app") { tizen_sdk_package("chip-lighting-app:tpk") { deps = [ ":chip-lighting-app" ] - manifest = rebase_path("tizen-manifest.xml") + manifest = "tizen-manifest.xml" sign_security_profile = "CHIP" } diff --git a/examples/lock-app/nrfconnect/main/AppTask.cpp b/examples/lock-app/nrfconnect/main/AppTask.cpp index 19e8c3c7873ce5..ff6cb1f6a7850d 100644 --- a/examples/lock-app/nrfconnect/main/AppTask.cpp +++ b/examples/lock-app/nrfconnect/main/AppTask.cpp @@ -61,10 +61,10 @@ using namespace ::chip::DeviceLayer; namespace { constexpr EndpointId kLockEndpointId = 1; -// NOTE! This key is for test/certification only and should not be available in production devices. -// Ideally, it should be a part of the factory data set. -constexpr uint8_t kTestEventTriggerEnableKey[16] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, - 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; +// NOTE! This key is for test/certification only and should not be available in production devices! +// If CONFIG_CHIP_FACTORY_DATA is enabled, this value is read from the factory data. +uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, + 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; LOG_MODULE_DECLARE(app, CONFIG_MATTER_LOG_LEVEL); K_MSGQ_DEFINE(sAppEventQueue, sizeof(AppEvent), APP_EVENT_QUEUE_SIZE, alignof(AppEvent)); @@ -161,12 +161,20 @@ CHIP_ERROR AppTask::Init() SetDeviceInstanceInfoProvider(&mFactoryDataProvider); SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); SetCommissionableDataProvider(&mFactoryDataProvider); + // Read EnableKey from the factory data. + MutableByteSpan enableKey(sTestEventTriggerEnableKey); + err = mFactoryDataProvider.GetEnableKey(enableKey); + if (err != CHIP_NO_ERROR) + { + LOG_ERR("mFactoryDataProvider.GetEnableKey() failed. Could not delegate a test event trigger"); + memset(sTestEventTriggerEnableKey, 0, sizeof(sTestEventTriggerEnableKey)); + } #else SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); #endif static CommonCaseDeviceServerInitParams initParams; - static OTATestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(kTestEventTriggerEnableKey) }; + static OTATestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(sTestEventTriggerEnableKey) }; (void) initParams.InitializeStaticResourcesBeforeServerInit(); initParams.testEventTriggerDelegate = &testEventTriggerDelegate; ReturnErrorOnFailure(chip::Server::GetInstance().Init(initParams)); diff --git a/examples/lock-app/p6/BUILD.gn b/examples/lock-app/p6/BUILD.gn index f7eb7fb05fe233..c37e453c3d8644 100644 --- a/examples/lock-app/p6/BUILD.gn +++ b/examples/lock-app/p6/BUILD.gn @@ -38,10 +38,9 @@ declare_args() { } config("p6_ota_config") { - ldflags = [ "-T/" + rebase_path( - "${chip_root}/third_party/p6/p6_sdk/ota/cy8c6xxa_cm4_dual_ota_int.ld", - "/", - "${p6_project_dir}") ] + linker_script = "${p6_sdk_root}/ota/cy8c6xxa_cm4_dual_ota_int.ld" + + ldflags = [ "-T" + rebase_path(linker_script, root_build_dir) ] ldflags += [ "-Wl,--defsym,MCUBOOT_HEADER_SIZE=0x400,--defsym,MCUBOOT_BOOTLOADER_SIZE=0x18000,--defsym,CY_BOOT_PRIMARY_1_SIZE=0x1C0000" ] @@ -96,21 +95,21 @@ p6_sdk_sources("lock_app_sdk_sources") { if (chip_enable_ota_requestor) { sources += [ - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/bootutil/src/bootutil_misc.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_map.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_psoc6.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_smif_psoc6.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/mem_config_sfdp.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/bootutil/src/bootutil_misc.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_map.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_psoc6.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_smif_psoc6.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/mem_config_sfdp.c", ] include_dirs += [ - "${chip_root}/third_party/p6/p6_sdk/ota/config", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/flash_map_backend/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/sysflash/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/bootutil/include", + "${p6_sdk_root}/ota/config", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/flash_map_backend/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/sysflash/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/bootutil/include", ] public_configs += [ ":p6_ota_config" ] } diff --git a/examples/ota-provider-app/linux/include/CHIPProjectAppConfig.h b/examples/ota-provider-app/linux/include/CHIPProjectAppConfig.h index b6c15f4c98230e..d5a80499d4c94b 100644 --- a/examples/ota-provider-app/linux/include/CHIPProjectAppConfig.h +++ b/examples/ota-provider-app/linux/include/CHIPProjectAppConfig.h @@ -32,3 +32,16 @@ // Allows app options (ports) to be configured on launch of app #define CHIP_DEVICE_ENABLE_PORT_PARAMS 1 + +/** + * @def CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL + * + * @brief + * Active retransmit interval, or time to wait before retransmission after + * subsequent failures in milliseconds. + * + * This is the default value, that might be adjusted by end device depending on its + * needs (e.g. sleeping period) using Service Discovery TXT record CRA key. + * + */ +#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) diff --git a/examples/ota-requestor-app/p6/BUILD.gn b/examples/ota-requestor-app/p6/BUILD.gn index 7701ca1c5e8a41..d370d7256db3ff 100644 --- a/examples/ota-requestor-app/p6/BUILD.gn +++ b/examples/ota-requestor-app/p6/BUILD.gn @@ -40,10 +40,9 @@ declare_args() { } config("p6_ota_config") { - ldflags = [ "-T/" + rebase_path( - "${chip_root}/third_party/p6/p6_sdk/ota/cy8c6xxa_cm4_dual_ota_int.ld", - "/", - "${p6_project_dir}") ] + linker_script = "${p6_sdk_root}/ota/cy8c6xxa_cm4_dual_ota_int.ld" + + ldflags = [ "-T" + rebase_path(linker_script, root_build_dir) ] ldflags += [ "-Wl,--defsym,MCUBOOT_HEADER_SIZE=0x400,--defsym,MCUBOOT_BOOTLOADER_SIZE=0x18000,--defsym,CY_BOOT_PRIMARY_1_SIZE=0x1C0000" ] @@ -88,14 +87,14 @@ p6_sdk_sources("ota_requestor_app_sdk_sources") { "${chip_root}/src/platform/P6", "${p6_project_dir}/include", "${examples_plat_dir}", - "${chip_root}/third_party/p6/p6_sdk/ota/config", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/flash_map_backend/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/sysflash/", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/bootutil/include", + "${p6_sdk_root}/ota/config", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/include/flash_map_backend/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/sysflash/", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/bootutil/include", ] defines = [ @@ -105,12 +104,12 @@ p6_sdk_sources("ota_requestor_app_sdk_sources") { ] sources = [ - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/bootutil/src/bootutil_misc.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_map.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_psoc6.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_smif_psoc6.c", - "${chip_root}/third_party/p6/p6_sdk/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/mem_config_sfdp.c", "${p6_project_dir}/include/CHIPProjectConfig.h", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/bootutil/src/bootutil_misc.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_map.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_flash_psoc6.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/cy_smif_psoc6.c", + "${p6_sdk_root}/libs/anycloud-ota/source/mcuboot/cy_flash_pal/mem_config/mem_config_sfdp.c", ] public_configs = [ diff --git a/examples/pump-app/nrfconnect/main/AppTask.cpp b/examples/pump-app/nrfconnect/main/AppTask.cpp index 35de7711981720..887c0a16931188 100644 --- a/examples/pump-app/nrfconnect/main/AppTask.cpp +++ b/examples/pump-app/nrfconnect/main/AppTask.cpp @@ -62,10 +62,10 @@ using namespace ::chip::DeviceLayer; namespace { -// NOTE! This key is for test/certification only and should not be available in production devices. -// Ideally, it should be a part of the factory data set. -constexpr uint8_t kTestEventTriggerEnableKey[16] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, - 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; +// NOTE! This key is for test/certification only and should not be available in production devices! +// If CONFIG_CHIP_FACTORY_DATA is enabled, this value is read from the factory data. +uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, + 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; LOG_MODULE_DECLARE(app, CONFIG_MATTER_LOG_LEVEL); K_MSGQ_DEFINE(sAppEventQueue, sizeof(AppEvent), APP_EVENT_QUEUE_SIZE, alignof(AppEvent)); @@ -159,12 +159,20 @@ CHIP_ERROR AppTask::Init() SetDeviceInstanceInfoProvider(&mFactoryDataProvider); SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); SetCommissionableDataProvider(&mFactoryDataProvider); + // Read EnableKey from the factory data. + MutableByteSpan enableKey(sTestEventTriggerEnableKey); + err = mFactoryDataProvider.GetEnableKey(enableKey); + if (err != CHIP_NO_ERROR) + { + LOG_ERR("mFactoryDataProvider.GetEnableKey() failed. Could not delegate a test event trigger"); + memset(sTestEventTriggerEnableKey, 0, sizeof(sTestEventTriggerEnableKey)); + } #else SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); #endif static CommonCaseDeviceServerInitParams initParams; - static OTATestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(kTestEventTriggerEnableKey) }; + static OTATestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(sTestEventTriggerEnableKey) }; (void) initParams.InitializeStaticResourcesBeforeServerInit(); initParams.testEventTriggerDelegate = &testEventTriggerDelegate; ReturnErrorOnFailure(chip::Server::GetInstance().Init(initParams)); diff --git a/examples/pump-controller-app/nrfconnect/main/AppTask.cpp b/examples/pump-controller-app/nrfconnect/main/AppTask.cpp index 79b0a43adf42df..898ffcc0892a1b 100644 --- a/examples/pump-controller-app/nrfconnect/main/AppTask.cpp +++ b/examples/pump-controller-app/nrfconnect/main/AppTask.cpp @@ -59,10 +59,10 @@ using namespace ::chip::DeviceLayer; namespace { -// NOTE! This key is for test/certification only and should not be available in production devices. -// Ideally, it should be a part of the factory data set. -constexpr uint8_t kTestEventTriggerEnableKey[16] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, - 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; +// NOTE! This key is for test/certification only and should not be available in production devices! +// If CONFIG_CHIP_FACTORY_DATA is enabled, this value is read from the factory data. +uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, + 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; LOG_MODULE_DECLARE(app, CONFIG_MATTER_LOG_LEVEL); K_MSGQ_DEFINE(sAppEventQueue, sizeof(AppEvent), APP_EVENT_QUEUE_SIZE, alignof(AppEvent)); @@ -156,12 +156,20 @@ CHIP_ERROR AppTask::Init() SetDeviceInstanceInfoProvider(&mFactoryDataProvider); SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); SetCommissionableDataProvider(&mFactoryDataProvider); + // Read EnableKey from the factory data. + MutableByteSpan enableKey(sTestEventTriggerEnableKey); + err = mFactoryDataProvider.GetEnableKey(enableKey); + if (err != CHIP_NO_ERROR) + { + LOG_ERR("mFactoryDataProvider.GetEnableKey() failed. Could not delegate a test event trigger"); + memset(sTestEventTriggerEnableKey, 0, sizeof(sTestEventTriggerEnableKey)); + } #else SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); #endif static CommonCaseDeviceServerInitParams initParams; - static OTATestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(kTestEventTriggerEnableKey) }; + static OTATestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(sTestEventTriggerEnableKey) }; (void) initParams.InitializeStaticResourcesBeforeServerInit(); initParams.testEventTriggerDelegate = &testEventTriggerDelegate; ReturnErrorOnFailure(chip::Server::GetInstance().Init(initParams)); diff --git a/examples/window-app/nrfconnect/main/AppTask.cpp b/examples/window-app/nrfconnect/main/AppTask.cpp index 0c80759cb4f25f..330fb4862e6529 100644 --- a/examples/window-app/nrfconnect/main/AppTask.cpp +++ b/examples/window-app/nrfconnect/main/AppTask.cpp @@ -55,10 +55,10 @@ K_MSGQ_DEFINE(sAppEventQueue, sizeof(AppEvent), APP_EVENT_QUEUE_SIZE, alignof(Ap namespace { -// NOTE! This key is for test/certification only and should not be available in production devices. -// Ideally, it should be a part of the factory data set. -constexpr uint8_t kTestEventTriggerEnableKey[16] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, - 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; +// NOTE! This key is for test/certification only and should not be available in production devices! +// If CONFIG_CHIP_FACTORY_DATA is enabled, this value is read from the factory data. +uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, + 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; LEDWidget sStatusLED; UnusedLedsWrapper<1> sUnusedLeds{ { DK_LED4 } }; @@ -159,12 +159,21 @@ CHIP_ERROR AppTask::Init() SetDeviceInstanceInfoProvider(&mFactoryDataProvider); SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); SetCommissionableDataProvider(&mFactoryDataProvider); + // Read EnableKey from the factory data. + MutableByteSpan enableKey(sTestEventTriggerEnableKey); + err = mFactoryDataProvider.GetEnableKey(enableKey); + if (err != CHIP_NO_ERROR) + { + LOG_ERR("mFactoryDataProvider.GetEnableKey() failed. Could not delegate a test event trigger"); + memset(sTestEventTriggerEnableKey, 0, sizeof(sTestEventTriggerEnableKey)); + } #else SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); + #endif static CommonCaseDeviceServerInitParams initParams; - static OTATestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(kTestEventTriggerEnableKey) }; + static OTATestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(sTestEventTriggerEnableKey) }; (void) initParams.InitializeStaticResourcesBeforeServerInit(); initParams.testEventTriggerDelegate = &testEventTriggerDelegate; ReturnErrorOnFailure(chip::Server::GetInstance().Init(initParams)); diff --git a/integrations/cloudbuild/build-all.yaml b/integrations/cloudbuild/build-all.yaml index 044253e57eb63b..19babd0be0f083 100644 --- a/integrations/cloudbuild/build-all.yaml +++ b/integrations/cloudbuild/build-all.yaml @@ -19,7 +19,7 @@ steps: - >- ./scripts/build/build_examples.py --enable-flashbundle --target-glob '*' --skip-target-glob - '{tizen-*,*-tests*,*-chip-test}' build --create-archives + '{mbed-*,tizen-*,*-tests*,*-chip-test}' build --create-archives /workspace/artifacts/ id: CompileAll waitFor: @@ -32,7 +32,7 @@ steps: logsBucket: matter-build-automation-build-logs # Global timeout for all steps -timeout: 14400s +timeout: 21600s artifacts: objects: diff --git a/integrations/docker/images/chip-build-imx/Dockerfile b/integrations/docker/images/chip-build-imx/Dockerfile index f674576a134bf2..8acc03833f9fec 100644 --- a/integrations/docker/images/chip-build-imx/Dockerfile +++ b/integrations/docker/images/chip-build-imx/Dockerfile @@ -9,13 +9,6 @@ RUN set -x \ && : # last line WORKDIR /opt RUN set -x \ - && wget --quiet -O fsl-l5.10.52-2.1.0-sdk.tar.gz https://www.nxp.com/lgfiles/IMM/fsl-l5.10.52-2.1.0-sdk.tar.gz \ - && tar zxvf fsl-l5.10.52-2.1.0-sdk.tar.gz \ - && ./fsl-imx-xwayland-glibc-x86_64-imx-image-core-cortexa53-crypto-imx8mmevk-toolchain-5.10-hardknott.sh -y \ - && wget --quiet https://www.nxp.com/lgfiles/IMM/fsl-imx-wayland-glibc-x86_64-imx-image-multimedia-cortexa7t2hf-neon-imx6ullevk-toolchain-5.15-kirkstone.sh \ - && chmod a+x fsl-imx-wayland-glibc-x86_64-imx-image-multimedia-cortexa7t2hf-neon-imx6ullevk-toolchain-5.15-kirkstone.sh \ - && ./fsl-imx-wayland-glibc-x86_64-imx-image-multimedia-cortexa7t2hf-neon-imx6ullevk-toolchain-5.15-kirkstone.sh -y \ - && rm -rf fsl-imx-wayland-glibc-x86_64-imx-image-multimedia-cortexa7t2hf-neon-imx6ullevk-toolchain-5.15-kirkstone.sh \ && wget --quiet https://www.nxp.com/lgfiles/IMM/fsl-imx-xwayland-glibc-x86_64-imx-image-multimedia-armv8a-imx8mmevk-toolchain-5.15-kirkstone.sh \ && chmod a+x fsl-imx-xwayland-glibc-x86_64-imx-image-multimedia-armv8a-imx8mmevk-toolchain-5.15-kirkstone.sh \ && ./fsl-imx-xwayland-glibc-x86_64-imx-image-multimedia-armv8a-imx8mmevk-toolchain-5.15-kirkstone.sh -y \ @@ -25,6 +18,5 @@ RUN set -x \ FROM connectedhomeip/chip-build:${VERSION} COPY --from=build /opt/fsl-imx-xwayland /opt/fsl-imx-xwayland -COPY --from=build /opt/fsl-imx-wayland /opt/fsl-imx-wayland -ENV IMX_SDK_ROOT=/opt/fsl-imx-xwayland/5.10-hardknott/ +ENV IMX_SDK_ROOT=/opt/fsl-imx-xwayland/5.15-kirkstone/ diff --git a/integrations/docker/images/chip-build-vscode/Dockerfile b/integrations/docker/images/chip-build-vscode/Dockerfile index 5668b82c984f3e..5bbad09fa8a521 100644 --- a/integrations/docker/images/chip-build-vscode/Dockerfile +++ b/integrations/docker/images/chip-build-vscode/Dockerfile @@ -44,7 +44,6 @@ COPY --from=ameba /opt/ameba /opt/ameba COPY --from=k32w /opt/sdk/sdks /opt/sdk/sdks COPY --from=imx /opt/fsl-imx-xwayland /opt/fsl-imx-xwayland -COPY --from=imx /opt/fsl-imx-wayland /opt/fsl-imx-wayland COPY --from=ti /opt/ti/sysconfig_1.11.0 /opt/ti/sysconfig_1.11.0 diff --git a/integrations/docker/images/chip-build/version b/integrations/docker/images/chip-build/version index 9e139abc6adc1f..7ead4c9a8430da 100644 --- a/integrations/docker/images/chip-build/version +++ b/integrations/docker/images/chip-build/version @@ -1 +1 @@ -0.5.84 Version bump reason: two more Yocto SDKs are to be integrated into the imx docker image +0.5.85 Version bump reason: remove two Yocto SDKs to decrease the imx docker image size diff --git a/scripts/build/BUILD.gn b/scripts/build/BUILD.gn index af69aa55f9b5bf..e2b0119566f126 100644 --- a/scripts/build/BUILD.gn +++ b/scripts/build/BUILD.gn @@ -44,6 +44,7 @@ pw_python_package("build_examples") { "builders/infineon.py", "builders/k32w.py", "builders/mbed.py", + "builders/mw320.py", "builders/nrf.py", "builders/qpg.py", "builders/telink.py", diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py old mode 100644 new mode 100755 index 476453ea7fd55c..64565fb2e9cd78 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -26,6 +26,7 @@ from builders.infineon import InfineonApp, InfineonBoard, InfineonBuilder from builders.k32w import K32WApp, K32WBuilder from builders.mbed import MbedApp, MbedBoard, MbedBuilder, MbedProfile +from builders.mw320 import MW320App, MW320Builder from builders.nrf import NrfApp, NrfBoard, NrfConnectBuilder from builders.qpg import QpgApp, QpgBoard, QpgBuilder from builders.telink import TelinkApp, TelinkBoard, TelinkBuilder @@ -294,6 +295,10 @@ def HostTargets(): for target in builder.AllVariants(): yield target + # limited subset for coverage + yield target_native.Extend('all-clusters-coverage', app=HostApp.ALL_CLUSTERS, use_coverage=True) + yield target_native.Extend('chip-tool-coverage', app=HostApp.CHIP_TOOL, use_coverage=True) + # Without extra build variants yield target_native.Extend('chip-cert', app=HostApp.CERT_TOOL) yield target_native.Extend('address-resolve-tool', app=HostApp.ADDRESS_RESOLVE) @@ -304,9 +309,11 @@ def HostTargets(): yield target_native.Extend('address-resolve-tool-platform-mdns-ipv6only', app=HostApp.ADDRESS_RESOLVE, use_platform_mdns=True, enable_ipv4=False).GlobBlacklist("Reduce default build variants") + yield target_native.Extend('tests', app=HostApp.TESTS) + yield target_native.Extend('tests-coverage', app=HostApp.TESTS, use_coverage=True) + yield target_native.Extend('tests-clang', app=HostApp.TESTS, use_clang=True) + test_target = Target(HostBoard.NATIVE.PlatformName(), HostBuilder) - yield test_target.Extend(HostBoard.NATIVE.BoardName() + '-tests', board=HostBoard.NATIVE, app=HostApp.TESTS) - yield test_target.Extend(HostBoard.NATIVE.BoardName() + '-tests-clang', board=HostBoard.NATIVE, app=HostApp.TESTS, use_clang=True) yield test_target.Extend(HostBoard.FAKE.BoardName() + '-tests', board=HostBoard.FAKE, app=HostApp.TESTS) @@ -589,6 +596,12 @@ def IMXTargets(): yield target.Extend('ota-provider-app-release', app=IMXApp.OTA_PROVIDER, release=True) +def MW320Targets(): + target = Target('mw320', MW320Builder) + + yield target.Extend('all-clusters-app', app=MW320App.ALL_CLUSTERS) + + ALL = [] target_generators = [ @@ -607,6 +620,7 @@ def IMXTargets(): TizenTargets(), Bl602Targets(), IMXTargets(), + MW320Targets(), ] for generator in target_generators: diff --git a/scripts/build/builders/gn.py b/scripts/build/builders/gn.py index ef4b67e9a4af28..1c00bf1c1e9d89 100644 --- a/scripts/build/builders/gn.py +++ b/scripts/build/builders/gn.py @@ -45,6 +45,14 @@ def GnBuildEnv(self): """ return None + def PreBuildCommand(self): + """Extra steps to run before 'build'""" + pass + + def PostBuildCommand(self): + """Extra steps to run after 'build'""" + pass + def generate(self): if not os.path.exists(self.output_dir): cmd = [ @@ -75,8 +83,12 @@ def generate(self): self._Execute(cmd, title=title) def _build(self): + self.PreBuildCommand() + cmd = ['ninja', '-C', self.output_dir] if self.build_command: cmd.append(self.build_command) self._Execute(cmd, title='Building ' + self.identifier) + + self.PostBuildCommand() diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index 1f487259ca2972..1569b0564c4530 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -197,7 +197,8 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, enable_thread=True, use_tsan=False, use_asan=False, separate_event_loop=True, use_libfuzzer=False, use_clang=False, interactive_mode=True, extra_tests=False, - use_platform_mdns=False, enable_rpcs=False): + use_platform_mdns=False, enable_rpcs=False, + use_coverage=False): super(HostBuilder, self).__init__( root=os.path.join(root, 'examples', app.ExamplePath()), runner=runner) @@ -236,6 +237,10 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, if use_libfuzzer: self.extra_gn_options.append('is_libfuzzer=true') + self.use_coverage = use_coverage + if use_coverage: + self.extra_gn_options.append('use_coverage=true') + if use_clang: self.extra_gn_options.append('is_clang=true') @@ -273,7 +278,7 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, elif app == HostApp.PYTHON_BINDINGS: self.extra_gn_options.append('enable_rtti=false') self.extra_gn_options.append('chip_project_config_include_dirs=["//config/python"]') - self.build_command = 'python' + self.build_command = 'chip-repl' def GnBuildArgs(self): if self.board == HostBoard.NATIVE: @@ -321,6 +326,32 @@ def SysRootPath(self, name): raise Exception('Missing environment variable "%s"' % name) return os.environ[name] + def generate(self): + super(HostBuilder, self).generate() + + if self.app == HostApp.TESTS and self.use_coverage: + self.coverage_dir = os.path.join(self.output_dir, 'coverage') + self._Execute(['mkdir', '-p', self.coverage_dir], title="Create coverage output location") + self._Execute(['lcov', '--initial', '--capture', '--directory', os.path.join(self.output_dir, 'obj'), + '--output-file', os.path.join(self.coverage_dir, 'lcov_base.info')], title="Initial coverage baseline") + + def PreBuildCommand(self): + if self.app == HostApp.TESTS and self.use_coverage: + self._Execute(['ninja', '-C', self.output_dir, 'default'], title="Build-only") + self._Execute(['lcov', '--initial', '--capture', '--directory', os.path.join(self.output_dir, 'obj'), + '--output-file', os.path.join(self.coverage_dir, 'lcov_base.info')], title="Initial coverage baseline") + + def PostBuildCommand(self): + if self.app == HostApp.TESTS and self.use_coverage: + self._Execute(['lcov', '--capture', '--directory', os.path.join(self.output_dir, 'obj'), '--output-file', + os.path.join(self.coverage_dir, 'lcov_test.info')], title="Update coverage") + self._Execute(['lcov', '--add-tracefile', os.path.join(self.coverage_dir, 'lcov_base.info'), + '--add-tracefile', os.path.join(self.coverage_dir, 'lcov_test.info'), + '--output-file', os.path.join(self.coverage_dir, 'lcov_final.info') + ], title="Final coverage info") + self._Execute(['genhtml', os.path.join(self.coverage_dir, 'lcov_final.info'), '--output-directory', + os.path.join(self.coverage_dir, 'html')], title="HTML coverage") + def build_outputs(self): outputs = {} diff --git a/scripts/build/builders/mw320.py b/scripts/build/builders/mw320.py new file mode 100755 index 00000000000000..66b739321d8759 --- /dev/null +++ b/scripts/build/builders/mw320.py @@ -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. + +import os +from enum import Enum, auto + +from .gn import GnBuilder + + +class MW320App(Enum): + ALL_CLUSTERS = auto() + + def ExampleName(self): + if self == MW320App.ALL_CLUSTERS: + return 'all-clusters-app' + else: + raise Exception('Unknown app type: %r' % self) + + def AppNamePrefix(self): + if self == MW320App.ALL_CLUSTERS: + return 'chip-mw320-all-clusters-app' + else: + raise Exception('Unknown app type: %r' % self) + + def BuildRoot(self, root): + return os.path.join(root, 'examples', self.ExampleName(), 'nxp', 'mw320') + + +class MW320Builder(GnBuilder): + + def __init__(self, + root, + runner, + app: MW320App = MW320App.ALL_CLUSTERS): + super(MW320Builder, self).__init__( + root=app.BuildRoot(root), + runner=runner) + self.app = app + + def build_outputs(self): + items = {} + for extension in [".bin", ".out", ".out.map"]: + name = '%s%s' % (self.app.AppNamePrefix(), extension) + items[name] = os.path.join(self.output_dir, name) + + return items diff --git a/scripts/build/builders/nrf.py b/scripts/build/builders/nrf.py index d6e92114cd2540..106c163991de1a 100644 --- a/scripts/build/builders/nrf.py +++ b/scripts/build/builders/nrf.py @@ -72,9 +72,9 @@ def AppNamePrefix(self): def _FlashBundlePrefix(self): if self == NrfApp.ALL_CLUSTERS: - return 'chip-nrfconnect-all-clusters-example' + return 'chip-nrfconnect-all-clusters-app-example' elif self == NrfApp.ALL_CLUSTERS_MINIMAL: - return 'chip-nrfconnect-all-clusters-minimal-example' + return 'chip-nrfconnect-all-clusters-minimal-app-example' elif self == NrfApp.LIGHT: return 'chip-nrfconnect-lighting-example' elif self == NrfApp.LOCK: diff --git a/scripts/build/testdata/all_targets_except_host.txt b/scripts/build/testdata/all_targets_except_host.txt index 78dd8d3144b57a..74eb20b4af658e 100644 --- a/scripts/build/testdata/all_targets_except_host.txt +++ b/scripts/build/testdata/all_targets_except_host.txt @@ -205,6 +205,7 @@ mbed-CY8CPROTO_062_4343W-pigweed-release mbed-CY8CPROTO_062_4343W-shell-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-shell-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-shell-release +mw320-all-clusters-app nrf-native-posix-64-tests nrf-nrf52840dk-all-clusters nrf-nrf52840dk-all-clusters-minimal diff --git a/scripts/build/testdata/build_all_except_host.txt b/scripts/build/testdata/build_all_except_host.txt index 3ee3d9ab4b0d70..032696d366a38b 100644 --- a/scripts/build/testdata/build_all_except_host.txt +++ b/scripts/build/testdata/build_all_except_host.txt @@ -988,6 +988,9 @@ mbed-tools configure -t GCC_ARM -m CY8CPROTO_062_4343W -p {root}/examples/shell/ # Generating mbed-CY8CPROTO_062_4343W-shell-release cmake -S {root}/examples/shell/mbed -B {out}/mbed-CY8CPROTO_062_4343W-shell-release -GNinja -DCMAKE_BUILD_TYPE=release -DMBED_OS_PATH={root}/third_party/mbed-os/repo -DMBED_OS_POSIX_SOCKET_PATH={root}/third_party/mbed-os-posix-socket/repo +# Generating mw320-all-clusters-app +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/nxp/mw320 {out}/mw320-all-clusters-app + # Generating nrf-native-posix-64-tests bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh"; export GNUARMEMB_TOOLCHAIN_PATH="$PW_ARM_CIPD_INSTALL_DIR"; @@ -2213,6 +2216,9 @@ bash -c 'rm -rf {out}/mbed-CY8CPROTO_062_4343W-shell-release/chip-*' # Building mbed-CY8CPROTO_062_4343W-shell-release cmake --build {out}/mbed-CY8CPROTO_062_4343W-shell-release +# Building mw320-all-clusters-app +ninja -C {out}/mw320-all-clusters-app + # Building nrf-native-posix-64-tests ninja -C {out}/nrf-native-posix-64-tests diff --git a/scripts/build/testdata/build_linux_on_x64.txt b/scripts/build/testdata/build_linux_on_x64.txt index 2d2f1cc2f4ea73..8e28a1abd6e909 100644 --- a/scripts/build/testdata/build_linux_on_x64.txt +++ b/scripts/build/testdata/build_linux_on_x64.txt @@ -181,6 +181,9 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa # Generating linux-x64-all-clusters-app-nodeps-ipv6only gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/linux '--args=chip_inet_config_enable_ipv4=false chip_config_network_layer_ble=false chip_enable_wifi=false chip_enable_openthread=false is_clang=true' {out}/linux-x64-all-clusters-app-nodeps-ipv6only +# Generating linux-x64-all-clusters-coverage +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/linux --args=use_coverage=true {out}/linux-x64-all-clusters-coverage + # Generating linux-x64-all-clusters-ipv6only gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/linux --args=chip_inet_config_enable_ipv4=false {out}/linux-x64-all-clusters-ipv6only @@ -202,6 +205,9 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root} '-- # Generating linux-x64-chip-tool gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool {out}/linux-x64-chip-tool +# Generating linux-x64-chip-tool-coverage +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool --args=use_coverage=true {out}/linux-x64-chip-tool-coverage + # Generating linux-x64-chip-tool-ipv6only gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/chip-tool --args=chip_inet_config_enable_ipv4=false {out}/linux-x64-chip-tool-ipv6only @@ -268,6 +274,15 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root} --a # Generating linux-x64-tests-clang gn gen --check --fail-on-unused-args --export-compile-commands --root={root} '--args=is_clang=true chip_build_tests=true' {out}/linux-x64-tests-clang +# Generating linux-x64-tests-coverage +gn gen --check --fail-on-unused-args --export-compile-commands --root={root} '--args=use_coverage=true chip_build_tests=true' {out}/linux-x64-tests-coverage + +# Create coverage output location +mkdir -p {out}/linux-x64-tests-coverage/coverage + +# Initial coverage baseline +lcov --initial --capture --directory {out}/linux-x64-tests-coverage/obj --output-file {out}/linux-x64-tests-coverage/coverage/lcov_base.info + # Generating linux-x64-thermostat gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/thermostat/linux {out}/linux-x64-thermostat @@ -359,7 +374,7 @@ ninja -C {out}/linux-arm64-ota-requestor ninja -C {out}/linux-arm64-ota-requestor-ipv6only # Building linux-arm64-python-bindings -ninja -C {out}/linux-arm64-python-bindings python +ninja -C {out}/linux-arm64-python-bindings chip-repl # Building linux-arm64-shell ninja -C {out}/linux-arm64-shell @@ -400,6 +415,9 @@ ninja -C {out}/linux-x64-all-clusters-app-nodeps # Building linux-x64-all-clusters-app-nodeps-ipv6only ninja -C {out}/linux-x64-all-clusters-app-nodeps-ipv6only +# Building linux-x64-all-clusters-coverage +ninja -C {out}/linux-x64-all-clusters-coverage + # Building linux-x64-all-clusters-ipv6only ninja -C {out}/linux-x64-all-clusters-ipv6only @@ -421,6 +439,9 @@ ninja -C {out}/linux-x64-chip-cert src/tools/chip-cert # Building linux-x64-chip-tool ninja -C {out}/linux-x64-chip-tool +# Building linux-x64-chip-tool-coverage +ninja -C {out}/linux-x64-chip-tool-coverage + # Building linux-x64-chip-tool-ipv6only ninja -C {out}/linux-x64-chip-tool-ipv6only @@ -470,7 +491,7 @@ ninja -C {out}/linux-x64-ota-requestor ninja -C {out}/linux-x64-ota-requestor-ipv6only # Building linux-x64-python-bindings -ninja -C {out}/linux-x64-python-bindings python +ninja -C {out}/linux-x64-python-bindings chip-repl # Building linux-x64-rpc-console ninja -C {out}/linux-x64-rpc-console @@ -487,6 +508,24 @@ ninja -C {out}/linux-x64-tests check # Building linux-x64-tests-clang ninja -C {out}/linux-x64-tests-clang check +# Build-only +ninja -C {out}/linux-x64-tests-coverage default + +# Initial coverage baseline +lcov --initial --capture --directory {out}/linux-x64-tests-coverage/obj --output-file {out}/linux-x64-tests-coverage/coverage/lcov_base.info + +# Building linux-x64-tests-coverage +ninja -C {out}/linux-x64-tests-coverage check + +# Update coverage +lcov --capture --directory {out}/linux-x64-tests-coverage/obj --output-file {out}/linux-x64-tests-coverage/coverage/lcov_test.info + +# Final coverage info +lcov --add-tracefile {out}/linux-x64-tests-coverage/coverage/lcov_base.info --add-tracefile {out}/linux-x64-tests-coverage/coverage/lcov_test.info --output-file {out}/linux-x64-tests-coverage/coverage/lcov_final.info + +# HTML coverage +genhtml {out}/linux-x64-tests-coverage/coverage/lcov_final.info --output-directory {out}/linux-x64-tests-coverage/coverage/html + # Building linux-x64-thermostat ninja -C {out}/linux-x64-thermostat diff --git a/scripts/build/testdata/glob_star_targets_except_host.txt b/scripts/build/testdata/glob_star_targets_except_host.txt index 5211dff002d074..d7090c2c52ccfd 100644 --- a/scripts/build/testdata/glob_star_targets_except_host.txt +++ b/scripts/build/testdata/glob_star_targets_except_host.txt @@ -85,6 +85,7 @@ mbed-CY8CPROTO_062_4343W-light-release mbed-CY8CPROTO_062_4343W-lock-release mbed-CY8CPROTO_062_4343W-pigweed-release mbed-CY8CPROTO_062_4343W-shell-release +mw320-all-clusters-app nrf-native-posix-64-tests nrf-nrf52840dk-all-clusters nrf-nrf52840dk-all-clusters-minimal diff --git a/scripts/build_python.sh b/scripts/build_python.sh index c4504f1433907c..9247b873d568ee 100755 --- a/scripts/build_python.sh +++ b/scripts/build_python.sh @@ -120,13 +120,13 @@ gn --root="$CHIP_ROOT" gen "$OUTPUT_ROOT" --args="chip_detail_logging=$chip_deta if [ "$enable_pybindings" == true ]; then ninja -C "$OUTPUT_ROOT" pycontroller else - ninja -C "$OUTPUT_ROOT" python + ninja -C "$OUTPUT_ROOT" chip-repl fi if [ "$enable_pybindings" == true ]; then - WHEEL=$(ls "$OUTPUT_ROOT"/pybindings/pycontroller/pychip-*.whl | head -n 1) + WHEEL=("$OUTPUT_ROOT"/pybindings/pycontroller/pychip-*.whl) else - WHEEL=$(ls "$OUTPUT_ROOT"/controller/python/chip-*.whl | head -n 1) + WHEEL=("$OUTPUT_ROOT"/controller/python/chip*.whl) fi if [ "$install_wheel" = "no" ]; then @@ -137,7 +137,7 @@ elif [ "$install_wheel" = "separate" ]; then source "$ENVIRONMENT_ROOT"/bin/activate "$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade pip - "$ENVIRONMENT_ROOT"/bin/pip install --upgrade --force-reinstall --no-cache-dir "$WHEEL" + "$ENVIRONMENT_ROOT"/bin/pip install --upgrade --force-reinstall --no-cache-dir "${WHEEL[@]}" echo "" echo_green "Compilation completed and WHL package installed in: " @@ -146,7 +146,7 @@ elif [ "$install_wheel" = "separate" ]; then echo_green "To use please run:" echo_bold_white " source $ENVIRONMENT_ROOT/bin/activate" elif [ "$install_wheel" = "build-env" ]; then - pip install --force-reinstall "$WHEEL" + pip install --force-reinstall "${WHEEL[@]}" echo "" echo_green "Compilation completed and WHL package installed in virtualenv for building sdk" diff --git a/scripts/build_python_device.sh b/scripts/build_python_device.sh index 5f637fa41ad937..30779c6ab2f02c 100755 --- a/scripts/build_python_device.sh +++ b/scripts/build_python_device.sh @@ -104,7 +104,7 @@ gn --root="$CHIP_ROOT" gen "$OUTPUT_ROOT" --args="chip_detail_logging=$chip_deta if [ "$enable_pybindings" == true ]; then ninja -v -C "$OUTPUT_ROOT" pycontroller else - ninja -v -C "$OUTPUT_ROOT" python + ninja -v -C "$OUTPUT_ROOT" chip-library fi # Create a virtual environment that has access to the built python tools @@ -113,14 +113,14 @@ virtualenv --clear "$ENVIRONMENT_ROOT" # Activate the new environment to register the python WHL if [ "$enable_pybindings" == true ]; then - WHEEL=$(ls "$OUTPUT_ROOT"/pybindings/pycontroller/pychip-*.whl | head -n 1) + WHEEL=("$OUTPUT_ROOT"/pybindings/pycontroller/pychip-*.whl) else - WHEEL=$(ls "$OUTPUT_ROOT"/controller/python/chip-*.whl | head -n 1) + WHEEL=("$OUTPUT_ROOT"/controller/python/chip_library*.whl) fi source "$ENVIRONMENT_ROOT"/bin/activate "$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade pip -"$ENVIRONMENT_ROOT"/bin/pip install --upgrade --force-reinstall --no-cache-dir "$WHEEL" +"$ENVIRONMENT_ROOT"/bin/pip install --upgrade --force-reinstall --no-cache-dir "${WHEEL[@]}" echo "" echo_green "Compilation completed and WHL package installed in: " diff --git a/scripts/tools/memory/platform/bl602.cfg b/scripts/tools/memory/platform/bl602.cfg new file mode 100644 index 00000000000000..1370bfcf5f777c --- /dev/null +++ b/scripts/tools/memory/platform/bl602.cfg @@ -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. + +# Memory tools default configuation for Bouffalolab BL602. + +{ + 'section': { + # By default, only these sections will be included + # when operating by sections. + 'default': ['.text', '.data', '.bss'] + }, + # 'symbol': { + # 'free': { + # # These symbols mark the start or end of areas where memory that + # # does not belong to any symbol is considered unused (rather than + # # a gap that may be in use for some non-symbol purpose, e.g. string + # # constants or alignment). + # 'start': [], + # 'end': [], + # } + # }, + # 'region': { + # # Regions are sets of sections that can be used for aggregate reports. + # 'sections': { + # 'FLASH': [], + # 'RAM': [] + # } + # }, +} diff --git a/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py b/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py index 62e9fa303e051b..9cf7a10341c1ee 100644 --- a/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py +++ b/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py @@ -16,6 +16,7 @@ # from os.path import exists +import os import sys import json import jsonschema @@ -24,6 +25,7 @@ import subprocess import logging as log import base64 +from collections import namedtuple from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.serialization import load_der_private_key @@ -31,6 +33,7 @@ # the factory data version set in the nRF Connect platform Kconfig file (CHIP_FACTORY_DATA_VERSION). FACTORY_DATA_VERSION = 1 +MATTER_ROOT = os.path.dirname(os.path.realpath(__file__))[:-len("/scripts/tools/nrfconnect")] HEX_PREFIX = "hex:" PUB_KEY_PREFIX = b'\x04' INVALID_PASSCODES = [00000000, 11111111, 22222222, 33333333, 44444444, @@ -61,6 +64,112 @@ def get_raw_private_key_der(der_file: str, password: str): return None +def gen_test_certs(chip_cert_exe: str, + output: str, + vendor_id: int, + product_id: int, + device_name: str, + generate_cd: bool = False, + paa_cert_path: str = None, + paa_key_path: str = None): + """ + Generate Matter certificates according to given Vendor ID and Product ID using the chip-cert executable. + To use own Product Attestation Authority certificate provide paa_cert_path and paa_key_path arguments. + Without providing these arguments a PAA certificate will be get from /credentials/test/attestation directory + in the Matter repository. + + Args: + chip_cert_exe (str): path to chip-cert executable + output (str): output path to store a newly generated certificates (CD, DAC, PAI) + vendor_id (int): an identification number specific to Vendor + product_id (int): an identification number specific to Product + device_name (str): human-readable device name + generate_cd (bool, optional): Generate Certificate Declaration and store it in thee output directory. Defaults to False. + paa_cert_path (str, optional): provide PAA certification path. Defaults to None - a path will be set to /credentials/test/attestation directory. + paa_key_path (str, optional): provide PAA key path. Defaults to None - a path will be set to /credentials/test/attestation directory. + + Returns: + dictionary: ["PAI_CERT": (str), + "DAC_CERT": (str), + "DAC_KEY": (str)] + """ + + CD_PATH = MATTER_ROOT + "/credentials/test/certification-declaration/Chip-Test-CD-Signing-Cert.pem" + CD_KEY_PATH = MATTER_ROOT + "/credentials/test/certification-declaration/Chip-Test-CD-Signing-Key.pem" + PAA_PATH = paa_cert_path if paa_cert_path != None else MATTER_ROOT + "/credentials/test/attestation/Chip-Test-PAA-NoVID-Cert.pem" + PAA_KEY_PATH = paa_key_path if paa_key_path != None else MATTER_ROOT + "/credentials/test/attestation/Chip-Test-PAA-NoVID-Key.pem" + + attestation_certs = namedtuple("attestation_certs", ["dac_cert", "dac_key", "pai_cert"]) + + log.info("Generating new certificates using chip-cert...") + + if generate_cd: + # generate Certification Declaration + cmd = [chip_cert_exe, "gen-cd", + "--key", CD_KEY_PATH, + "--cert", CD_PATH, + "--out", output + "/CD.der", + "--format-version", str(1), + "--vendor-id", hex(vendor_id), + "--product-id", hex(product_id), + "--device-type-id", "0xA", + "--certificate-id", "ZIG20142ZB330003-24", + "--security-level", str(0), + "--security-info", str(0), + "--certification-type", str(0), + "--version-number", "0x2694", + ] + subprocess.run(cmd) + + new_certificates = {"PAI_CERT": output + "/PAI_cert", + "PAI_KEY": output + "/PAI_key", + "DAC_CERT": output + "/DAC_cert", + "DAC_KEY": output + "/DAC_key" + } + + # generate PAI + cmd = [chip_cert_exe, "gen-att-cert", + "-t", "i", + "-c", device_name, + "-V", hex(vendor_id), + "-C", PAA_PATH, + "-K", PAA_KEY_PATH, + "-o", new_certificates["PAI_CERT"] + ".pem", + "-O", new_certificates["PAI_KEY"] + ".pem", + "-l", str(10000), + ] + subprocess.run(cmd) + + # generate DAC + cmd = [chip_cert_exe, "gen-att-cert", + "-t", "d", + "-c", device_name, + "-V", hex(vendor_id), + "-P", hex(product_id), + "-C", new_certificates["PAI_CERT"] + ".pem", + "-K", new_certificates["PAI_KEY"] + ".pem", + "-o", new_certificates["DAC_CERT"] + ".pem", + "-O", new_certificates["DAC_KEY"] + ".pem", + "-l", str(10000), + ] + subprocess.run(cmd) + + # convert to .der files + for cert_k, cert_v in new_certificates.items(): + action_type = "convert-cert" if cert_k.find("CERT") != -1 else "convert-key" + log.info(cert_v + ".der") + cmd = [chip_cert_exe, action_type, + cert_v + ".pem", + cert_v + ".der", + "--x509-der", + ] + subprocess.run(cmd) + + return attestation_certs(new_certificates["DAC_CERT"] + ".der", + new_certificates["DAC_KEY"] + ".der", + new_certificates["PAI_CERT"] + ".der") + + def gen_spake2p_params(spake2p_path: str, passcode: int, it: int, salt: str) -> dict: """ Generate spake2 params using external spake2p script @@ -144,19 +253,37 @@ def generate_json(self): # rotating device ID unique ID was not provided, so do not store it in factory data. rd_uid = None else: - rd_uid = self._args.rd_uid + rd_uid = HEX_PREFIX + self._args.rd_uid + if not self._args.spake2_verifier: spake_2_verifier = base64.b64decode(self._generate_spake2_verifier()) else: spake_2_verifier = base64.b64decode(self._args.spake2_verifier) # convert salt to bytestring to be coherent with spake2 verifier type - spake_2_salt = base64.b64decode(self._args.spake2_salt) + spake_2_salt = bytes(self._args.spake2_salt, 'utf-8') + + if self._args.chip_cert_path: + certs = gen_test_certs(self._args.chip_cert_path, + self._args.output[:self._args.output.rfind("/")], + self._args.vendor_id, + self._args.product_id, + self._args.vendor_name + "_" + self._args.product_name, + self._args.gen_cd, + self._args.paa_cert, + self._args.paa_key) + dac_cert = certs.dac_cert + pai_cert = certs.pai_cert + dac_key = certs.dac_key + else: + dac_cert = self._args.dac_cert + dac_key = self._args.dac_key + pai_cert = self._args.pai_cert # try to read DAC public and private keys - dac_priv_key = get_raw_private_key_der(self._args.dac_key, self._args.dac_key_password) + dac_priv_key = get_raw_private_key_der(dac_key, self._args.dac_key_password) if dac_priv_key is None: - log.error("Can not read DAC keys from : {}".format(self._args.dac_key)) + log.error("Can not read DAC keys from : {}".format(dac_key)) sys.exit(-1) try: @@ -175,9 +302,9 @@ def generate_json(self): self._add_entry("date", self._args.date) self._add_entry("hw_ver", self._args.hw_ver) self._add_entry("hw_ver_str", self._args.hw_ver_str) - self._add_entry("dac_cert", self._process_der(self._args.dac_cert)) + self._add_entry("dac_cert", self._process_der(dac_cert)) self._add_entry("dac_key", dac_priv_key) - self._add_entry("pai_cert", self._process_der(self._args.pai_cert)) + self._add_entry("pai_cert", self._process_der(pai_cert)) if self._args.include_passcode: self._add_entry("passcode", self._args.passcode) self._add_entry("spake2_it", self._args.spake2_it) @@ -186,6 +313,7 @@ def generate_json(self): self._add_entry("discriminator", self._args.discriminator) if rd_uid: self._add_entry("rd_uid", rd_uid) + self._add_entry("enable_key", HEX_PREFIX + self._args.enable_key) # add user-specific data self._add_entry("user", self._args.user) @@ -320,15 +448,24 @@ def allow_any_int(i): return int(i, 0) optional_arguments.add_argument("--pai_cert", type=str, help="[.der] Provide the path to .der file containing PAI certificate.") optional_arguments.add_argument("--rd_uid", type=str, - help="[hex string] Provide the rotating device unique ID. If this argument is not provided a new rotating device id unique id will be generated.") + help="[hex string] [128-bit hex-encoded] Provide the rotating device unique ID. If this argument is not provided a new rotating device id unique id will be generated.") optional_arguments.add_argument("--passcode", type=allow_any_int, help="[int | hex] Default PASE session passcode. (This is mandatory to generate Spake2 Verifier).") optional_arguments.add_argument("--spake2p_path", type=str, help="[string] Provide a path to spake2p. By default You can find spake2p in connectedhomeip/src/tools/spake2p directory and build it there.") optional_arguments.add_argument("--spake2_verifier", type=str, help="[ascii string] Provide Spake2 Verifier without generating it.") + optional_arguments.add_argument("--enable_key", type=str, + help="[hex string] [128-bit hex-encoded] The Enable Key is a 128-bit value that triggers manufacturer-specific action while invoking the TestEventTrigger Command." + "This value is used during Certification Tests, and should not be present on production devices.") optional_arguments.add_argument("--user", type=str, help="[string] Provide additional user-specific keys in Json format: {'name_1': 'value_1', 'name_2': 'value_2', ... 'name_n', 'value_n'}.") + optional_arguments.add_argument("--gen_cd", action="store_true", default=False, + help="Generate a new Certificate Declaration in .der format according to used Vendor ID and Product ID. This certificate will not be included to the factory data.") + optional_arguments.add_argument("--paa_cert", type=str, + help="Provide a path to the Product Attestation Authority (PAA) certificate to generate the PAI certificate. Without providing it, a testing PAA stored in the Matter repository will be used.") + optional_arguments.add_argument("--paa_key", type=str, + help="Provide a path to the Product Attestation Authority (PAA) key to generate the PAI certificate. Without providing it, a testing PAA key stored in the Matter repository will be used.") args = parser.parse_args() if args.verbose: @@ -336,10 +473,6 @@ def allow_any_int(i): return int(i, 0) else: log.basicConfig(format='[%(levelname)s] %(message)s', level=log.INFO) - if(args.chip_cert_path): - log.error("Generating DAC and PAI certificates is not supported yet") - return - # check if json file already exist if(exists(args.output) and not args.overwrite): log.error("Output file: {} already exist, to create a new one add argument '--overwrite'. By default overwriting is disabled".format(args.output)) diff --git a/scripts/tools/nrfconnect/nrfconnect_factory_data.schema b/scripts/tools/nrfconnect/nrfconnect_factory_data.schema index 621e20fc6c4074..fa2e9a2679d6cc 100644 --- a/scripts/tools/nrfconnect/nrfconnect_factory_data.schema +++ b/scripts/tools/nrfconnect/nrfconnect_factory_data.schema @@ -75,23 +75,30 @@ "rd_uid": { "description": "A randomly-generated 128-bit or longer octet string. Length has been expanded with 'hex:' prefix", "type": "string", + "pattern:": "^hex:{1}", "minLength": 20, + "minLength": 5, "maxLength": 36 }, "dac_cert": { "description": "DAC certificate in hex-string format", "type": "string", + "pattern:": "^hex:{1}([0-9A-Fa-f]){2,}", + "minLength": 5, "maxLength": 1204 }, "dac_key": { "description": "DAC Private Key in hex-string format", "type": "string", + "pattern:": "^hex:{1}([0-9A-Fa-f]){2,}", "minLength": 68, "maxLength": 68 }, "pai_cert": { "description": "PAI certificate in hex-string format", "type": "string", + "pattern:": "^hex:{1}([0-9A-Fa-f]){2,}", + "minLength": 5, "maxLength": 1204 }, "passcode": { @@ -109,12 +116,14 @@ "spake2_salt": { "description": "A key-derivation function for the Symmetric Password-Authenticated Key Exchange.", "type": "string", + "pattern:": "^hex:{1}([0-9A-Fa-f]){2,}", "minLength": 36, "maxLength": 68 }, "spake2_verifier": { "description": "A verifier for the Symmetric Password-Authenticated Key Exchange", "type": "string", + "pattern:": "^hex:{1}([0-9A-Fa-f]){2,}", "minLength": 97 }, "discriminator": { @@ -123,6 +132,13 @@ "minimum": 0, "maximum": 4095 }, + "enable_key": { + "description": "The Enable Key is a 128-bit value that triggers manufacturer-specific action while invoking the TestEventTrigger Command", + "type": "string", + "pattern": "^hex:{1}([0-9A-Fa-f]){32}", + "minLength": 36, + "maxLength": 36 + }, "user": { "description": "A user-specific additional data which should be added to factory data. This should be a Json format.", "type": "object" diff --git a/src/app/CommandHandler.cpp b/src/app/CommandHandler.cpp index 95c77f04949466..cff9ae492cd4fa 100644 --- a/src/app/CommandHandler.cpp +++ b/src/app/CommandHandler.cpp @@ -328,9 +328,9 @@ CHIP_ERROR CommandHandler::ProcessCommandDataIB(CommandDataIB::Parser & aCommand { ChipLogDetail(DataManagement, "Received command for Endpoint=%u Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, concretePath.mEndpointId, ChipLogValueMEI(concretePath.mClusterId), ChipLogValueMEI(concretePath.mCommandId)); - SuccessOrExit(MatterPreCommandReceivedCallback(concretePath)); + SuccessOrExit(MatterPreCommandReceivedCallback(concretePath, GetSubjectDescriptor())); mpCallback->DispatchCommand(*this, concretePath, commandDataReader); - MatterPostCommandReceivedCallback(concretePath); + MatterPostCommandReceivedCallback(concretePath, GetSubjectDescriptor()); } exit: @@ -432,12 +432,11 @@ CHIP_ERROR CommandHandler::ProcessGroupCommandDataIB(CommandDataIB::Parser & aCo continue; } } - - if ((err = MatterPreCommandReceivedCallback(concretePath)) == CHIP_NO_ERROR) + if ((err = MatterPreCommandReceivedCallback(concretePath, GetSubjectDescriptor())) == CHIP_NO_ERROR) { TLV::TLVReader dataReader(commandDataReader); mpCallback->DispatchCommand(*this, concretePath, dataReader); - MatterPostCommandReceivedCallback(concretePath); + MatterPostCommandReceivedCallback(concretePath, GetSubjectDescriptor()); } else { @@ -675,8 +674,10 @@ void CommandHandler::Abort() } // namespace app } // namespace chip -CHIP_ERROR __attribute__((weak)) MatterPreCommandReceivedCallback(const chip::app::ConcreteCommandPath & commandPath) +CHIP_ERROR __attribute__((weak)) MatterPreCommandReceivedCallback(const chip::app::ConcreteCommandPath & commandPath, + const chip::Access::SubjectDescriptor & subjectDescriptor) { return CHIP_NO_ERROR; } -void __attribute__((weak)) MatterPostCommandReceivedCallback(const chip::app::ConcreteCommandPath & commandPath) {} +void __attribute__((weak)) MatterPostCommandReceivedCallback(const chip::app::ConcreteCommandPath & commandPath, + const chip::Access::SubjectDescriptor & subjectDescriptor) {} diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 8c721b2ecefca0..47ebd1cd926293 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -108,7 +108,10 @@ template("chip_data_model") { foreach(cluster, _cluster_sources) { if (cluster == "door-lock-server") { - sources += [ "${_app_root}/clusters/${cluster}/door-lock-server.cpp" ] + sources += [ + "${_app_root}/clusters/${cluster}/door-lock-server-callback.cpp", + "${_app_root}/clusters/${cluster}/door-lock-server.cpp", + ] } else if (cluster == "mode-select-server") { sources += [ "${_app_root}/clusters/${cluster}/${cluster}.cpp", diff --git a/src/app/clusters/door-lock-server/door-lock-server-callback.cpp b/src/app/clusters/door-lock-server/door-lock-server-callback.cpp new file mode 100644 index 00000000000000..db76ab62abe129 --- /dev/null +++ b/src/app/clusters/door-lock-server/door-lock-server-callback.cpp @@ -0,0 +1,193 @@ +/** + * + * 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 + * @brief Routines for the Door Lock Server plugin. + ******************************************************************************* + ******************************************************************************/ + +#include "door-lock-server.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::DataModel; +using namespace chip::app::Clusters::DoorLock; + +// ============================================================================= +// 'Default' callbacks for cluster commands +// ============================================================================= + +bool __attribute__((weak)) +emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional & pinCode, DlOperationError & err) +{ + err = DlOperationError::kUnspecified; + return false; +} + +bool __attribute__((weak)) +emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional & pinCode, DlOperationError & err) +{ + err = DlOperationError::kUnspecified; + return false; +} + +// ============================================================================= +// 'Default' pre-change callbacks for cluster attributes +// ============================================================================= + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnLanguageChange(chip::EndpointId EndpointId, chip::CharSpan 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, const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attrType, uint16_t attrSize, uint8_t * attrValue) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +// ============================================================================= +// Users and credentials access callbacks +// ============================================================================= + +bool __attribute__((weak)) +emberAfPluginDoorLockGetUser(chip::EndpointId endpointId, uint16_t userIndex, EmberAfPluginDoorLockUserInfo & user) +{ + return false; +} + +bool __attribute__((weak)) +emberAfPluginDoorLockSetUser(chip::EndpointId endpointId, uint16_t userIndex, chip::FabricIndex creator, chip::FabricIndex modifier, + const chip::CharSpan & userName, uint32_t uniqueId, DlUserStatus userStatus, DlUserType usertype, + DlCredentialRule credentialRule, const DlCredential * credentials, size_t totalCredentials) +{ + return false; +} + +bool __attribute__((weak)) +emberAfPluginDoorLockGetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, DlCredentialType credentialType, + EmberAfPluginDoorLockCredentialInfo & credential) +{ + return false; +} + +bool __attribute__((weak)) +emberAfPluginDoorLockSetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, chip::FabricIndex creator, + chip::FabricIndex modifier, DlCredentialStatus credentialStatus, DlCredentialType credentialType, + const chip::ByteSpan & credentialData) +{ + return false; +} + +DlStatus __attribute__((weak)) emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t weekdayIndex, + uint16_t userIndex, EmberAfPluginDoorLockWeekDaySchedule & schedule) +{ + return DlStatus::kFailure; +} + +DlStatus __attribute__((weak)) emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t yearDayIndex, + uint16_t userIndex, EmberAfPluginDoorLockYearDaySchedule & schedule) +{ + return DlStatus::kFailure; +} + +DlStatus __attribute__((weak)) +emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t holidayIndex, EmberAfPluginDoorLockHolidaySchedule & schedule) +{ + return DlStatus::kFailure; +} + +DlStatus __attribute__((weak)) +emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t weekdayIndex, uint16_t userIndex, DlScheduleStatus status, + DlDaysMaskMap daysMask, uint8_t startHour, uint8_t startMinute, uint8_t endHour, uint8_t endMinute) +{ + return DlStatus::kFailure; +} + +DlStatus __attribute__((weak)) +emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t yearDayIndex, uint16_t userIndex, DlScheduleStatus status, + uint32_t localStartTime, uint32_t localEndTime) +{ + return DlStatus::kFailure; +} + +DlStatus __attribute__((weak)) +emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t holidayIndex, DlScheduleStatus status, + uint32_t localStartTime, uint32_t localEndTime, DlOperatingMode operatingMode) +{ + return DlStatus::kFailure; +} 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 2c92d1c73ae616..cfff140c65dac8 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -3602,155 +3602,6 @@ void MatterDoorLockPluginServerInitCallback() void MatterDoorLockClusterServerAttributeChangedCallback(const app::ConcreteAttributePath & attributePath) {} -// ============================================================================= -// 'Default' callbacks for cluster commands -// ============================================================================= - -bool __attribute__((weak)) -emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const Optional & pinCode, DlOperationError & err) -{ - err = DlOperationError::kUnspecified; - return false; -} - -bool __attribute__((weak)) -emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const Optional & pinCode, DlOperationError & err) -{ - err = DlOperationError::kUnspecified; - return false; -} - -// ============================================================================= -// 'Default' pre-change callbacks for cluster attributes -// ============================================================================= - -chip::Protocols::InteractionModel::Status __attribute__((weak)) -emberAfPluginDoorLockOnLanguageChange(chip::EndpointId EndpointId, chip::CharSpan 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, const chip::app::ConcreteAttributePath & attributePath, - EmberAfAttributeType attrType, uint16_t attrSize, uint8_t * attrValue) -{ - return chip::Protocols::InteractionModel::Status::Success; -} - -// ============================================================================= -// Users and credentials access callbacks -// ============================================================================= - -bool __attribute__((weak)) -emberAfPluginDoorLockGetUser(chip::EndpointId endpointId, uint16_t userIndex, EmberAfPluginDoorLockUserInfo & user) -{ - return false; -} - -bool __attribute__((weak)) -emberAfPluginDoorLockSetUser(chip::EndpointId endpointId, uint16_t userIndex, chip::FabricIndex creator, chip::FabricIndex modifier, - const chip::CharSpan & userName, uint32_t uniqueId, DlUserStatus userStatus, DlUserType usertype, - DlCredentialRule credentialRule, const DlCredential * credentials, size_t totalCredentials) -{ - return false; -} - -bool __attribute__((weak)) -emberAfPluginDoorLockGetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, DlCredentialType credentialType, - EmberAfPluginDoorLockCredentialInfo & credential) -{ - return false; -} - -bool __attribute__((weak)) -emberAfPluginDoorLockSetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, chip::FabricIndex creator, - chip::FabricIndex modifier, DlCredentialStatus credentialStatus, DlCredentialType credentialType, - const chip::ByteSpan & credentialData) -{ - return false; -} - -DlStatus __attribute__((weak)) emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t weekdayIndex, - uint16_t userIndex, EmberAfPluginDoorLockWeekDaySchedule & schedule) -{ - return DlStatus::kFailure; -} - -DlStatus __attribute__((weak)) emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t yearDayIndex, - uint16_t userIndex, EmberAfPluginDoorLockYearDaySchedule & schedule) -{ - return DlStatus::kFailure; -} - -DlStatus __attribute__((weak)) -emberAfPluginDoorLockGetSchedule(chip::EndpointId endpointId, uint8_t holidayIndex, EmberAfPluginDoorLockHolidaySchedule & schedule) -{ - return DlStatus::kFailure; -} - -DlStatus __attribute__((weak)) -emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t weekdayIndex, uint16_t userIndex, DlScheduleStatus status, - DlDaysMaskMap daysMask, uint8_t startHour, uint8_t startMinute, uint8_t endHour, uint8_t endMinute) -{ - return DlStatus::kFailure; -} - -DlStatus __attribute__((weak)) -emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t yearDayIndex, uint16_t userIndex, DlScheduleStatus status, - uint32_t localStartTime, uint32_t localEndTime) -{ - return DlStatus::kFailure; -} - -DlStatus __attribute__((weak)) -emberAfPluginDoorLockSetSchedule(chip::EndpointId endpointId, uint8_t holidayIndex, DlScheduleStatus status, - uint32_t localStartTime, uint32_t localEndTime, DlOperatingMode operatingMode) -{ - return DlStatus::kFailure; -} - // ============================================================================= // Timer callbacks // ============================================================================= diff --git a/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp b/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp index 3f4cf67829c56d..bc7f857834b7cf 100644 --- a/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp +++ b/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp @@ -638,14 +638,12 @@ void DefaultOTARequestor::OnDownloadStateChanged(OTADownloader::State state, OTA { case OTADownloader::State::kComplete: mOtaRequestorDriver->UpdateDownloaded(); - mBdxMessenger.Reset(); break; case OTADownloader::State::kIdle: if (reason != OTAChangeReasonEnum::kSuccess) { RecordErrorUpdateState(CHIP_ERROR_CONNECTION_ABORTED, reason); } - mBdxMessenger.Reset(); break; default: break; @@ -825,10 +823,10 @@ CHIP_ERROR DefaultOTARequestor::StartDownload(OperationalDeviceProxy & devicePro Optional session = deviceProxy.GetSecureSession(); VerifyOrReturnError(session.HasValue(), CHIP_ERROR_INCORRECT_STATE); - chip::Messaging::ExchangeContext * exchangeCtx = exchangeMgr->NewContext(session.Value(), &mBdxMessenger); - VerifyOrReturnError(exchangeCtx != nullptr, CHIP_ERROR_NO_MEMORY); + mExchangeCtx = exchangeMgr->NewContext(session.Value(), &mBdxMessenger); + VerifyOrReturnError(mExchangeCtx != nullptr, CHIP_ERROR_NO_MEMORY); - mBdxMessenger.Init(mBdxDownloader, exchangeCtx); + mBdxMessenger.Init(mBdxDownloader, mExchangeCtx); mBdxDownloader->SetMessageDelegate(&mBdxMessenger); mBdxDownloader->SetStateDelegate(this); diff --git a/src/app/clusters/ota-requestor/DefaultOTARequestor.h b/src/app/clusters/ota-requestor/DefaultOTARequestor.h index 99e9ae14c1b123..13c2f1bea9a504 100644 --- a/src/app/clusters/ota-requestor/DefaultOTARequestor.h +++ b/src/app/clusters/ota-requestor/DefaultOTARequestor.h @@ -175,13 +175,6 @@ class DefaultOTARequestor : public OTARequestorInterface, public BDXDownloader:: mDownloader = downloader; } - void Reset() - { - VerifyOrReturn(mExchangeCtx != nullptr); - mExchangeCtx->Close(); - mExchangeCtx = nullptr; - } - private: chip::Messaging::ExchangeContext * mExchangeCtx; chip::BDXDownloader * mDownloader; @@ -299,12 +292,13 @@ class DefaultOTARequestor : public OTARequestorInterface, public BDXDownloader:: */ static void OnCommissioningCompleteRequestor(const DeviceLayer::ChipDeviceEvent * event, intptr_t arg); - OTARequestorStorage * mStorage = nullptr; - OTARequestorDriver * mOtaRequestorDriver = nullptr; - CASESessionManager * mCASESessionManager = nullptr; - OnConnectedAction mOnConnectedAction = kQueryImage; - BDXDownloader * mBdxDownloader = nullptr; // TODO: this should be OTADownloader - BDXMessenger mBdxMessenger; // TODO: ideally this is held by the application + OTARequestorStorage * mStorage = nullptr; + OTARequestorDriver * mOtaRequestorDriver = nullptr; + CASESessionManager * mCASESessionManager = nullptr; + OnConnectedAction mOnConnectedAction = kQueryImage; + Messaging::ExchangeContext * mExchangeCtx = nullptr; + BDXDownloader * mBdxDownloader = nullptr; // TODO: this should be OTADownloader + BDXMessenger mBdxMessenger; // TODO: ideally this is held by the application uint8_t mUpdateTokenBuffer[kMaxUpdateTokenLen]; ByteSpan mUpdateToken; uint32_t mCurrentVersion = 0; 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 f1e6f5d66ae9fc..8c09b782a06677 100644 --- a/src/app/clusters/user-label-server/user-label-server.cpp +++ b/src/app/clusters/user-label-server/user-label-server.cpp @@ -129,7 +129,7 @@ CHIP_ERROR UserLabelAttrAccess::WriteLabelList(const ConcreteDataAttributePath & LabelList::TypeInfo::DecodableType decodablelist; ReturnErrorOnFailure(aDecoder.Decode(decodablelist)); - ReturnErrorCodeIf(!IsValidLabelEntryList(decodablelist), CHIP_ERROR_INVALID_ARGUMENT); + ReturnErrorCodeIf(!IsValidLabelEntryList(decodablelist), CHIP_IM_GLOBAL_STATUS(ConstraintError)); auto iter = decodablelist.begin(); while (iter.Next()) @@ -146,7 +146,7 @@ CHIP_ERROR UserLabelAttrAccess::WriteLabelList(const ConcreteDataAttributePath & Structs::LabelStruct::DecodableType entry; ReturnErrorOnFailure(aDecoder.Decode(entry)); - ReturnErrorCodeIf(!IsValidLabelEntry(entry), CHIP_ERROR_INVALID_ARGUMENT); + ReturnErrorCodeIf(!IsValidLabelEntry(entry), CHIP_IM_GLOBAL_STATUS(ConstraintError)); return provider->AppendUserLabel(endpoint, entry); } diff --git a/src/app/ota_image_tool.py b/src/app/ota_image_tool.py index 7e14ed19c97759..6ff27ab91e6533 100755 --- a/src/app/ota_image_tool.py +++ b/src/app/ota_image_tool.py @@ -41,6 +41,7 @@ from chip.tlv import TLVReader, TLVWriter, uint # noqa: E402 HEADER_MAGIC = 0x1BEEF11E +FIXED_HEADER_FORMAT = ' int: + """ + Returns the size of the fixed header + header + """ + _magic, _total_size, header_size, _header_tlv = parse_header(args) + return struct.calcsize(FIXED_HEADER_FORMAT) + header_size + + +def read_chunk(file, size=1024): + while data := file.read(size): + yield data + + +def remove_header(args: object) -> None: + """ + Removes the header from args.image_file and writes to args.output_file + """ + image_start = full_header_size(args) + with open(args.image_file, 'rb') as file: + with open(args.output_file, 'wb') as outfile: + file.seek(image_start) + for chunk in read_chunk(file): + outfile.write(chunk) + + def show_header(args: object): """ Parse and present OTA image header in human-readable form @@ -252,6 +276,47 @@ def show_header(args: object): print(f' [{tag}] {tag_name}: {value}') +def update_header_args(args: object) -> None: + """ + Generates an image file with a new header + + New header values can be specified in args, otherwise the values from args.image_file are used. + The new file is written out to args.output_file. + """ + _magic, _total_size, _header_size, header_tlv = parse_header(args) + + payload_size = header_tlv[HeaderTag.PAYLOAD_SIZE] + payload_digest = header_tlv[HeaderTag.DIGEST] + + if args.vendor_id is None: + args.vendor_id = header_tlv[HeaderTag.VENDOR_ID] + if args.product_id is None: + args.product_id = header_tlv[HeaderTag.PRODUCT_ID] + if args.version is None: + args.version = header_tlv[HeaderTag.VERSION] + if args.version_str is None: + args.version_str = header_tlv[HeaderTag.VERSION_STRING] + if args.digest_algorithm is None: + val = header_tlv[HeaderTag.DIGEST_TYPE] + args.digest_algorithm = next(key for key, value in DIGEST_ALGORITHM_ID.items() if value == val) + if args.min_version is None and HeaderTag.MIN_VERSION in header_tlv: + args.min_version = header_tlv[HeaderTag.MIN_VERSION] + if args.max_version is None and HeaderTag.MAX_VERSION in header_tlv: + args.max_version = header_tlv[HeaderTag.MAX_VERSION] + if args.release_notes is None and HeaderTag.RELEASE_NOTES_URL in header_tlv: + args.release_notes = header_tlv[HeaderTag.RELEASE_NOTES_URL] + + new_header_tlv = generate_header_tlv(args, payload_size, payload_digest) + header = generate_header(new_header_tlv, payload_size) + + with open(args.image_file, 'rb') as infile: + with open(args.output_file, 'wb') as outfile: + outfile.write(header) + infile.seek(full_header_size(args)) + for chunk in read_chunk(infile): + outfile.write(chunk) + + def main(): def any_base_int(s): return int(s, 0) @@ -284,6 +349,31 @@ def any_base_int(s): return int(s, 0) show_parser = subcommands.add_parser('show', help='Show OTA image info') show_parser.add_argument('image_file', help='Path to OTA image file') + extract_tool = subcommands.add_parser('extract', help='Remove the OTA header from an image file') + extract_tool.add_argument('image_file', help='Path to OTA image file with header') + extract_tool.add_argument('output_file', help='Path to put the output file (no header)') + + change_tool = subcommands.add_parser('change_header', help='Change the specified values in the header') + change_tool.add_argument('-v', '--vendor-id', type=any_base_int, + help='Vendor ID') + change_tool.add_argument('-p', '--product-id', type=any_base_int, + help='Product ID') + change_tool.add_argument('-vn', '--version', type=any_base_int, + help='Software version (numeric)') + change_tool.add_argument('-vs', '--version-str', + help='Software version (string)') + change_tool.add_argument('-da', '--digest-algorithm', choices=DIGEST_ALL_ALGORITHMS, + help='Digest algorithm') + change_tool.add_argument('-mi', '--min-version', type=any_base_int, + help='Minimum software version that can be updated to this image') + change_tool.add_argument('-ma', '--max-version', type=any_base_int, + help='Maximum software version that can be updated to this image') + change_tool.add_argument( + '-rn', '--release-notes', help='Release note URL') + change_tool.add_argument('image_file', + help='Path to input OTA file') + change_tool.add_argument('output_file', help='Path to output OTA file') + args = parser.parse_args() if args.subcommand == 'create': @@ -291,6 +381,10 @@ def any_base_int(s): return int(s, 0) generate_image(args) elif args.subcommand == 'show': show_header(args) + elif args.subcommand == 'extract': + remove_header(args) + elif args.subcommand == 'change_header': + update_header_args(args) if __name__ == "__main__": diff --git a/src/app/tests/suites/TestFabricRemovalWhileSubscribed.yaml b/src/app/tests/suites/TestFabricRemovalWhileSubscribed.yaml new file mode 100644 index 00000000000000..5271f380749cf1 --- /dev/null +++ b/src/app/tests/suites/TestFabricRemovalWhileSubscribed.yaml @@ -0,0 +1,102 @@ +# Copyright (c) 2022 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: + Validate removal of a fabric while another fabric is subscribed to the + fabrics list does not crash + +config: + nodeId: 0x12344321 + cluster: "Operational Credentials" + endpoint: 0 + discriminator: + type: INT16U + defaultValue: 3840 + payload: + type: CHAR_STRING + defaultValue: "MT:-24J0AFN00KA0648G00" # This value needs to be generated automatically + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read number of commissioned fabrics" + command: "readAttribute" + attribute: "CommissionedFabrics" + response: + value: 1 + constraints: + type: uint8 + + - label: "Read current fabric index" + command: "readAttribute" + attribute: "CurrentFabricIndex" + response: + saveAs: ourFabricIndex + constraints: + type: uint8 + # 0 is not a valid value, but past that we have no idea what the + # other side will claim here. + minValue: 1 + + - label: "Open commissioning window from alpha" + cluster: "AdministratorCommissioning" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + + - label: "Commission from beta" + identity: "beta" + cluster: "CommissionerCommands" + command: "PairWithCode" + arguments: + values: + - name: "nodeId" + value: 0x12345 + - name: "payload" + value: payload + + - label: "Wait for the commissioned device to be retrieved for beta" + identity: "beta" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: 0x12345 + + - label: "Subscribe Fabrics Attribute from beta" + identity: "beta" + command: "subscribeAttribute" + attribute: "Fabrics" + minInterval: 2 + maxInterval: 5 + response: + constraints: + type: list + + - label: "Remove single own fabric" + command: "RemoveFabric" + arguments: + values: + - name: "FabricIndex" + value: ourFabricIndex diff --git a/src/app/tests/suites/TestUserLabelClusterConstraints.yaml b/src/app/tests/suites/TestUserLabelClusterConstraints.yaml index 2072b91f8df64b..51d938583f1c06 100644 --- a/src/app/tests/suites/TestUserLabelClusterConstraints.yaml +++ b/src/app/tests/suites/TestUserLabelClusterConstraints.yaml @@ -40,7 +40,7 @@ tests: }, ] response: - error: FAILURE + error: CONSTRAINT_ERROR - label: "Attempt to write overly long item for value" command: "writeAttribute" @@ -54,4 +54,4 @@ tests: }, ] response: - error: FAILURE + error: CONSTRAINT_ERROR diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 4d8b397123af95..ae3e8212551b0a 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -570,6 +570,9 @@ PICS: device?" id: TM.M.ManuallyControlled + - label: "Does the device implement the Tolerance attribute?" + id: A_TEMPERATURE_TOLERANCE + # Thermostat User Configuration cluster - label: "Does the device implement the TemperatureDisplayMode attribute?" id: TSUIC.S.A0000 @@ -602,11 +605,17 @@ PICS: id: DGSW.S.C00 # Thermostat cluster - - label: "Does the device implement the OccupiedCoolingSetpoint attribute" - id: A_OCCUPIEDCOOLINGSETPOINT + - label: "Does the device implement the Heating feature" + id: TSTAT.S.F00 + + - label: "Does the device implement the Cooling feature" + id: TSTAT.S.F01 + + - label: "Does the device implement the Occupancy feature" + id: TSTAT.S.F02 - - label: "Does the device implement the OccupiedHeatingSetpoint attribute" - id: A_OCCUPIEDHEATINGSETPOINT + - label: "Does the device implement the Auto feature" + id: TSTAT.S.F05 - label: "Does the device implement the MinHeatSetpointLimit attribute" id: A_MINHEATSETPOINTLIMIT @@ -620,45 +629,204 @@ PICS: - label: "Does the device implement the MaxCoolSetpointLimit attribute" id: A_MAXCOOLSETPOINTLIMIT + - label: "Does the device implement the Tolerance attribute?" + id: A_TEMPERATURE_TOLERANCE + + - label: "Does the device implement the LocalTemperature attribute?" + id: TSTAT.S.A0000 + + - label: "Does the device implement the OutdoorTemperature attribute?" + id: TSTAT.S.A0001 + + - label: "Does the device implement the Occupancy attribute?" + id: TSTAT.S.A0002 + + - label: "Does the device implement the AbsMinHeatSetpointLimit attribute?" + id: TSTAT.S.A0003 + + - label: "Does the device implement the AbsMaxHeatSetpointLimit attribute?" + id: TSTAT.S.A0004 + + - label: "Does the device implement the AbsMinCoolSetpointLimit attribute?" + id: TSTAT.S.A0005 + + - label: "Does the device implement the AbsMaxCoolSetpointLimit attribute?" + id: TSTAT.S.A0006 + + - label: "Does the device implement the PICoolingDemand attribute?" + id: TSTAT.S.A0007 + + - label: "Does the device implement the PIHeatingDemand attribute?" + id: TSTAT.S.A0008 + - label: - "Does the device implement the ControlSequenceOfOperation attribute" - id: A_CONTROLSEQUENCEOFOPERATION + "Does the device implement the HVACSystemTypeConfiguration attribute?" + id: TSTAT.S.A0009 - label: - "Does the device implement receiving the SetpointRaiseLower command?" - id: CR_SetpointRaiseLower + "Does the device implement the LocalTemperatureCalibration attribute?" + id: TSTAT.S.A0010 + + - label: "Does the device implement the OccupiedCoolingSetpoint attribute?" + id: TSTAT.S.A0011 + + - label: "Does the device implement the OccupiedHeatingSetpoint attribute?" + id: TSTAT.S.A0012 - label: "Does the device implement the UnoccupiedCoolingSetpoint attribute?" - id: A_UNOCCUPIEDCOOLINGSETPOINT + id: TSTAT.S.A0013 - label: "Does the device implement the UnoccupiedHeatingSetpoint attribute?" - id: A_UNOCCUPIEDHEATINGSETPOINT + id: TSTAT.S.A0014 + + - label: "Does the device implement the MinHeatSetpointLimit attribute?" + id: TSTAT.S.A0015 + + - label: "Does the device implement the MaxHeatSetpointLimit attribute?" + id: TSTAT.S.A0016 + + - label: "Does the device implement the MinCoolSetpointLimit attribute?" + id: TSTAT.S.A0017 + + - label: "Does the device implement the MaxCoolSetpointLimit attribute?" + id: TSTAT.S.A0018 - label: "Does the device implement the MinSetpointDeadBand attribute?" - id: A_MINSETPOINTDEADBAND + id: TSTAT.S.A0019 - - label: "Does the device implement the Tolerance attribute?" - id: A_TEMPERATURE_TOLERANCE + - label: "Does the device implement the RemoteSensing attribute?" + id: TSTAT.S.A001a + + - label: + "Does the device implement the ControlSequenceOfOperation attribute?" + id: TSTAT.S.A001b + + - label: "Does the device implement the SystemMode attribute?" + id: TSTAT.S.A001c + + - label: "Does the device implement the AlarmMask attribute?" + id: TSTAT.S.A001d + + - label: "Does the device implement the ThermostatRunningMode attribute?" + id: TSTAT.S.A001e + + - label: "Does the device implement the StartOfWeek attribute?" + id: TSTAT.S.A0020 + + - label: + "Does the device implement the NumberOfWeeklyTransitions attribute?" + id: TSTAT.S.A0021 + + - label: "Does the device implement the NumberOfDailyTransitions attribute?" + id: TSTAT.S.A0022 + + - label: "Does the device implement the TemperatureSetpointHold attribute?" + id: TSTAT.S.A0023 + + - label: + "Does the device implement the TemperatureSetpointHoldDuration + attribute?" + id: TSTAT.S.A0024 + + - label: + "Does the device implement the ThermostatProgrammingOperationMode + attribute?" + id: TSTAT.S.A0025 + + - label: "Does the device implement the ThermostatRunningState attribute?" + id: TSTAT.S.A0029 + + - label: "Does the device implement the SetpointChangeSource attribute?" + id: TSTAT.S.A0030 + + - label: "Does the device implement the SetpointChangeAmount attribute?" + id: TSTAT.S.A0031 + + - label: + "Does the device implement the SetpointChangeSourceTimestamp + attribute?" + id: TSTAT.S.A0032 + + - label: "Does the device implement the OccupiedSetback attribute?" + id: TSTAT.S.A0034 + + - label: "Does the device implement the OccupiedSetbackMin attribute?" + id: TSTAT.S.A0035 + + - label: "Does the device implement the OccupiedSetbackMax attribute?" + id: TSTAT.S.A0036 + + - label: "Does the device implement the UnoccupiedSetback attribute?" + id: TSTAT.S.A0037 + + - label: "Does the device implement the UnoccupiedSetbackMin attribute?" + id: TSTAT.S.A0038 + + - label: "Does the device implement the UnoccupiedSetbackMax attribute?" + id: TSTAT.S.A0039 + + - label: "Does the device implement the EmergencyHeatDelta attribute?" + id: TSTAT.S.A003a + + - label: "Does the device implement the ACType attribute?" + id: TSTAT.S.A0040 + + - label: "Does the device implement the ACCapacity attribute?" + id: TSTAT.S.A0041 + + - label: "Does the device implement the ACRefrigerantType attribute?" + id: TSTAT.S.A0042 + + - label: "Does the device implement the ACCompressorType attribute?" + id: TSTAT.S.A0043 + + - label: "Does the device implement the ACErrorCode attribute?" + id: TSTAT.S.A0044 + + - label: "Does the device implement the ACLouverPosition attribute?" + id: TSTAT.S.A0045 + + - label: "Does the device implement the ACCoilTemperature attribute?" + id: TSTAT.S.A0046 + + - label: "Does the device implement the ACCapacityFormat attribute?" + id: TSTAT.S.A0047 + + #Thermostat commands + - label: "Does the device implement the SetpointRaiseLower command?" + id: TSTAT.S.C00.Rsp + + - label: "Does the device implement the SetWeeklySchedule command?" + id: TSTAT.S.C01.Rsp + + - label: "Does the device implement the GetWeeklySchedule command?" + id: TSTAT.S.C02.Rsp + + - label: "Does the device implement the ClearWeeklySchedule command?" + id: TSTAT.S.C03.Rsp + + - label: "Does the device implement the GetRelayStatusLog command?" + id: TSTAT.S.C04.Rsp - label: "Thermostat is capable of managing a heating device" - id: TSTAT_HEAT + id: TSTAT.S.F00 - label: "Thermostat is capable of managing a cooling device" - id: TSTAT_COOL + id: TSTAT.S.F01 - label: "Supports Occupied and Unoccupied setpoints" - id: TSTAT_OCC + id: TSTAT.S.F02 - label: "Supports a weekly schedule of setpoint transitions" - id: TSTAT_SCH + id: TSTAT.S.F03 - label: "Supports configurable setback (or span)" - id: TSTAT_SB + id: TSTAT.S.F04 - label: "Supports a System Mode of Auto" - id: TSTAT_AUTO + id: TSTAT.S.F05 #Client Commands - label: "Does the device implement sending the SetpointRaiseLower command?" @@ -900,6 +1068,10 @@ PICS: - label: "Does the device implement sending the OnWithTimedOff command?" id: OO.C.C42.Tx + #Features + - label: "Level Control for Lighting" + id: OO.S.F00 + - label: "Does Dnssd advertisment broadcast Vendor ID" id: VENDOR_SUBTYPE diff --git a/src/app/tests/suites/certification/Test_TC_ALOGIN_1_12.yaml b/src/app/tests/suites/certification/Test_TC_ALOGIN_1_12.yaml index 5f9e3b1af91e6a..250ab154a943e9 100644 --- a/src/app/tests/suites/certification/Test_TC_ALOGIN_1_12.yaml +++ b/src/app/tests/suites/certification/Test_TC_ALOGIN_1_12.yaml @@ -50,25 +50,25 @@ tests: command: "readAttribute" attribute: "AttributeList" response: - value: [65528, 65529, 65531, 65532, 65533] constraints: type: list + contains: [65528, 65529, 65531, 65532, 65533] - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" response: - value: [0, 2, 3] constraints: type: list + contains: [0, 2, 3] - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" response: - value: [1] constraints: type: list + contains: [1] #issue #11053 disabled steps below Global attributes missing from YAML framework - label: diff --git a/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_1_3.yaml b/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_1_3.yaml index 2e9638707c65c1..7014c54dec5cdd 100644 --- a/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_1_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_APPLAUNCHER_1_3.yaml @@ -60,17 +60,17 @@ tests: command: "readAttribute" attribute: "AcceptedCommandList" response: - value: [0, 1, 2] constraints: type: list + contains: [0, 1, 2] - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" response: - value: [3] constraints: type: list + contains: [3] #issue #11053 disabled steps below Global attributes missing from YAML framework - label: diff --git a/src/app/tests/suites/certification/Test_TC_BINFO_2_1.yaml b/src/app/tests/suites/certification/Test_TC_BINFO_2_1.yaml index 4e2c8f2a4e9aa8..e9fda6db810f28 100644 --- a/src/app/tests/suites/certification/Test_TC_BINFO_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BINFO_2_1.yaml @@ -29,96 +29,263 @@ tests: - name: "nodeId" value: nodeId - - label: "Query Data Model Revision" + - label: "TH reads Location from the DUT." + command: "readAttribute" + attribute: "Location" + response: + saveAs: CountryCode + + - label: "TH reads DataModelRevision from the DUT." PICS: BINFO.S.A0000 command: "readAttribute" attribute: "DataModelRevision" response: + saveAs: DataModelRevisionValue constraints: type: uint16 + minValue: 0 + maxValue: 65534 + + - label: "TH writes DataModelRevision from the DUT." + PICS: BINFO.S.A0000 + command: "writeAttribute" + attribute: "DataModelRevision" + arguments: + value: 4388 + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads DataModelRevision from the DUT." + PICS: BINFO.S.A0000 + command: "readAttribute" + attribute: "DataModelRevision" + response: + value: DataModelRevisionValue - - label: "Query Vendor Name" + - label: "TH reads VendorName from the DUT." PICS: BINFO.S.A0001 command: "readAttribute" attribute: "VendorName" response: + saveAs: VendorNameValue constraints: type: string maxLength: 32 - - label: "Query VendorID" + - label: "TH writes VendorName from the DUT." + PICS: BINFO.S.A0001 + command: "writeAttribute" + attribute: "VendorName" + arguments: + value: "sample" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads VendorName from the DUT." + PICS: BINFO.S.A0001 + command: "readAttribute" + attribute: "VendorName" + response: + value: VendorNameValue + + - label: "TH reads VendorID from the DUT." PICS: BINFO.S.A0002 command: "readAttribute" attribute: "VendorID" response: + saveAs: VendorIDValue constraints: type: uint16 + minValue: 1 + maxValue: 65521 + + - label: "TH writes VendorID from the DUT." + PICS: BINFO.S.A0002 + command: "writeAttribute" + attribute: "VendorID" + arguments: + value: 17 + response: + error: UNSUPPORTED_WRITE - - label: "Query Product Name" + - label: "TH reads VendorID from the DUT." + PICS: BINFO.S.A0002 + command: "readAttribute" + attribute: "VendorID" + response: + value: VendorIDValue + + - label: "TH reads ProductName from the DUT" PICS: BINFO.S.A0003 command: "readAttribute" attribute: "ProductName" response: + saveAs: ProductNameValue constraints: type: string maxLength: 32 - - label: "Query ProductID" + - label: "TH writes ProductName from the DUT." + PICS: BINFO.S.A0003 + command: "writeAttribute" + attribute: "ProductName" + arguments: + value: "newproduct" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads ProductName from the DUT" + PICS: BINFO.S.A0003 + command: "readAttribute" + attribute: "ProductName" + response: + value: ProductNameValue + + - label: "TH reads ProductID from the DUT." PICS: BINFO.S.A0004 command: "readAttribute" attribute: "ProductID" response: + saveAs: ProductIDValue constraints: type: uint16 + minValue: 1 + maxValue: 65534 + + - label: "TH writes ProductID from the DUT." + PICS: BINFO.S.A0004 + command: "writeAttribute" + attribute: "ProductID" + arguments: + value: 17697 + response: + error: UNSUPPORTED_WRITE - - label: "Query Node Label" + - label: "TH reads ProductID from the DUT." + PICS: BINFO.S.A0004 + command: "readAttribute" + attribute: "ProductID" + response: + value: ProductIDValue + + - label: "TH reads NodeLabel from the DUT" PICS: BINFO.S.A0005 command: "readAttribute" attribute: "NodeLabel" response: + saveAs: NodeLabelValue constraints: type: string maxLength: 32 - - label: "Query User Location" + - label: "TH writes NodeLabel from the DUT." + PICS: BINFO.S.A0005 + command: "writeAttribute" + attribute: "NodeLabel" + arguments: + value: "newnode" + + - label: "TH reads NodeLabel from the DUT" + PICS: BINFO.S.A0005 + command: "readAttribute" + attribute: "NodeLabel" + response: + value: "newnode" + + - label: "TH reads Location from the DUT." PICS: BINFO.S.A0006 command: "readAttribute" attribute: "Location" response: + value: CountryCode constraints: type: string maxLength: 16 - - label: "Query HardwareVersion" + - label: "TH write Location from the DUT" + PICS: BINFO.S.A0006 + command: "writeAttribute" + attribute: "Location" + arguments: + value: "in" + + - label: "TH reads Location from the DUT." + PICS: BINFO.S.A0006 + command: "readAttribute" + attribute: "Location" + response: + value: "in" + + - label: "TH reads HardwareVersion from the DUT" PICS: BINFO.S.A0007 command: "readAttribute" attribute: "HardwareVersion" response: + saveAs: HardwareVersionValue constraints: type: uint16 + minValue: 0 + maxValue: 65534 + + - label: "TH writes HardwareVersion from the DUT." + PICS: BINFO.S.A0007 + command: "writeAttribute" + attribute: "HardwareVersion" + arguments: + value: 17713 + response: + error: UNSUPPORTED_WRITE - - label: "Query HardwareVersionString" + - label: "TH reads HardwareVersion from the DUT" + PICS: BINFO.S.A0007 + command: "readAttribute" + attribute: "HardwareVersion" + response: + value: HardwareVersionValue + + - label: "TH reads HardwareVersionString from the DUT." PICS: BINFO.S.A0008 command: "readAttribute" attribute: "HardwareVersionString" response: + saveAs: HardwareVersionStringValue constraints: type: string minLength: 1 maxLength: 64 + - label: "TH writes HardwareVersionString from the DUT." + PICS: BINFO.S.A0008 + command: "writeAttribute" + attribute: "HardwareVersionString" + arguments: + value: "newhardwareversion" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads HardwareVersionString from the DUT." + PICS: BINFO.S.A0008 + command: "readAttribute" + attribute: "HardwareVersionString" + response: + value: HardwareVersionStringValue + + - label: "TH reads SoftwareVersion from the DUT" + PICS: BINFO.S.A0009 + command: "readAttribute" + attribute: "SoftwareVersion" + response: + saveAs: SoftwareVersionValue + constraints: + minValue: 0 + maxValue: 4294967294 + - label: - "TH reads SoftwareVersionString from the DUT and Verify it is of type - string and verify the format" - verification: | - ./chip-tool basic read software-version 1 0 - - [1654069233.033848][11164:11169] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0009 DataVersion: 2079473958 - [1654069233.033880][11164:11169] CHIP:TOO: SoftwareVersion: 1 - [1654069233.033902][11164:11169] CHIP:EM: Sending Standalone Ack for MessageCounter:3270959 on exchange 29106i + "Verify that the SoftwareVersion is not displayed to the end-user + through any device specific means (ex: screen, audio)" cluster: "LogCommands" command: "UserPrompt" - PICS: PICS_USER_PROMPT && BINFO.S.A000a + PICS: PICS_USER_PROMPT && BINFO.S.A0009 arguments: values: - name: "message" @@ -126,17 +293,62 @@ tests: - name: "expectedValue" value: "y" - - label: - "TH reads ManufacturingDate from the DUT and Verify it is of type - string and verify the format" - verification: | - ./chip-tool basic read manufacturing-date 1 0 + - label: "TH writes SoftwareVersion from the DUT." + PICS: BINFO.S.A0009 + command: "writeAttribute" + attribute: "SoftwareVersion" + arguments: + value: 33299 + response: + error: UNSUPPORTED_WRITE + - label: "TH reads SoftwareVersion from the DUT" + PICS: BINFO.S.A0009 + command: "readAttribute" + attribute: "SoftwareVersion" + response: + value: SoftwareVersionValue - [1640336849.202099][14335:14340] CHIP:DMG: - [1640336849.202186][14335:14340] CHIP:DMG: SuppressResponse = true, - [1640336849.202239][14335:14340] CHIP:DMG: } - [1640336849.202479][14335:14340] CHIP:TOO: Basic.ManufacturingDate response: 20210614123456ZZ + - label: "TH reads SoftwareVersionString from the DUT" + PICS: BINFO.S.A000a + command: "readAttribute" + attribute: "SoftwareVersionString" + response: + saveAs: SoftwareVersionStringValue + constraints: + minLength: 1 + maxLenght: 64 + + - label: "TH writes SoftwareVersionString from the DUT." + PICS: BINFO.S.A000a + command: "writeAttribute" + attribute: "SoftwareVersionString" + arguments: + value: "1.0" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads SoftwareVersionString from the DUT" + PICS: BINFO.S.A000a + command: "readAttribute" + attribute: "SoftwareVersionString" + response: + value: SoftwareVersionStringValue + + - label: "TH reads ManufacturingDate from the DUT." + PICS: BINFO.S.A000b + command: "readAttribute" + attribute: "ManufacturingDate" + response: + saveAs: ManufacturingDateValue + constraints: + type: string + minLength: 8 + maxLength: 16 + + - label: + "Verify if the first 8 characters specify date according to ISO 8601, + i.e, YYYYMMDD" cluster: "LogCommands" command: "UserPrompt" PICS: PICS_USER_PROMPT && BINFO.S.A000b @@ -147,26 +359,61 @@ tests: - name: "expectedValue" value: "y" - - label: "Query PartNumber" + - label: "TH writes ManufacturingDate from the DUT." + PICS: BINFO.S.A000b + command: "writeAttribute" + attribute: "ManufacturingDate" + arguments: + value: "20210814789452IN" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads ManufacturingDate from the DUT." + PICS: BINFO.S.A000b + command: "readAttribute" + attribute: "ManufacturingDate" + response: + value: ManufacturingDateValue + + - label: "TH reads PartNumber from the DUT" + PICS: BINFO.S.A000c && PART_NUM command: "readAttribute" attribute: "PartNumber" - PICS: BINFO.S.A000c response: + saveAs: PartNumberValue constraints: type: string maxLength: 32 - - label: - "TH reads ProductURL from the DUT and Verify it is of type string and - verify the format" - verification: | - ./chip-tool basic read product-url 1 0 + - label: "TH writes PartNumber from the DUT." + PICS: BINFO.S.A000c + command: "writeAttribute" + attribute: "PartNumber" + arguments: + value: "newpart" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads PartNumber from the DUT" + PICS: BINFO.S.A000c && PART_NUM + command: "readAttribute" + attribute: "PartNumber" + response: + value: PartNumberValue + - label: "TH reads ProductURL from the DUT" + PICS: BINFO.S.A000d + command: "readAttribute" + attribute: "ProductURL" + response: + saveAs: ProductURLValue + constraints: + type: string + maxLength: 256 - [1640337847.187590][14399:14404] CHIP:DMG: - [1640337847.187633][14399:14404] CHIP:DMG: SuppressResponse = true, - [1640337847.187676][14399:14404] CHIP:DMG: } - [1640337847.187868][14399:14404] CHIP:TOO: Basic.ProductURL response: + - label: + "Verify that it specifies a link to a specific web page, Verify that + it follows the syntax rules specified in RFC 3986." cluster: "LogCommands" command: "UserPrompt" PICS: PICS_USER_PROMPT && BINFO.S.A000d @@ -177,45 +424,187 @@ tests: - name: "expectedValue" value: "y" - - label: "Query ProductLabel" + - label: "TH writes ProductURL from the DUT." + PICS: BINFO.S.A000d + command: "writeAttribute" + attribute: "ProductURL" + arguments: + value: "https://www.example.com" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads ProductURL from the DUT" + PICS: BINFO.S.A000d + command: "readAttribute" + attribute: "ProductURL" + response: + value: ProductURLValue + + - label: "TH reads ProductLabel from the DUT." PICS: BINFO.S.A000e command: "readAttribute" attribute: "ProductLabel" response: + saveAs: ProductLabelValue constraints: type: string maxLength: 64 - - label: "Query SerialNumber" - PICS: BINFO.S.A000f + - label: + "Verify that it does not include the name of the vendor as defined + within the VendorName attribute" + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && BINFO.S.A000e + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "TH writes ProductLabel from the DUT." + PICS: BINFO.S.A000e + command: "writeAttribute" + attribute: "ProductLabel" + arguments: + value: "newproductlabel" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads ProductLabel from the DUT." + PICS: BINFO.S.A000e + command: "readAttribute" + attribute: "ProductLabel" + response: + value: ProductLabelValue + + - label: "TH reads SerialNumber from the DUT." command: "readAttribute" attribute: "SerialNumber" response: + saveAs: SerialNumberValue constraints: type: string maxLength: 32 - - label: "Query LocalConfigDisabled" + - label: "TH writes SerialNumber from the DUT." + PICS: BINFO.S.A000f + command: "writeAttribute" + attribute: "SerialNumber" + arguments: + value: "newserialnumber" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads SerialNumber from the DUT." + PICS: BINFO.S.A000f + command: "readAttribute" + attribute: "SerialNumber" + response: + value: SerialNumberValue + + - label: "TH reads LocalConfigDisabled from the DUT." PICS: BINFO.S.A0010 command: "readAttribute" attribute: "LocalConfigDisabled" response: + value: false constraints: type: boolean - - label: "Query Reachable" + - label: "TH sets LocalConfigDisabled to True" + PICS: BINFO.S.A0010 + command: "writeAttribute" + attribute: "LocalConfigDisabled" + arguments: + value: true + + - label: "TH reads LocalConfigDisabled from the DUT." + PICS: BINFO.S.A0010 + command: "readAttribute" + attribute: "LocalConfigDisabled" + response: + value: true + + - label: "TH reads Reachable from the DUT." PICS: BINFO.S.A0011 command: "readAttribute" attribute: "Reachable" response: + value: true constraints: type: boolean - - label: "Query UniqueID" + - label: + "TH sends Write request message to DUT to change value of Reachable to + false" + PICS: BINFO.S.A0011 + command: "writeAttribute" + attribute: "Reachable" + arguments: + value: false + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads UniqueID from the DUT." PICS: BINFO.S.A0012 command: "readAttribute" attribute: "UniqueID" response: + saveAs: UniqueIDValue constraints: type: string maxLength: 32 + + - label: "TH writes UniqueID from the DUT." + PICS: BINFO.S.A0012 + command: "writeAttribute" + attribute: "UniqueID" + arguments: + value: "newid" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads UniqueID from the DUT." + PICS: BINFO.S.A0012 + command: "readAttribute" + attribute: "UniqueID" + response: + value: UniqueIDValue + + - label: "TH reads CapabilityMinima attribute from the DUT." + PICS: BINFO.S.A0013 + command: "readAttribute" + attribute: "CapabilityMinima" + response: + saveAs: CapabilityMinimaValue + + - label: + "Step 56 is implicitly validating the attribute(CapabilityMinima) + constraints, as long as the payload is being parsed successfully" + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && BINFO.S.A0013 + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "TH writes CapabilityMinima from the DUT." + PICS: BINFO.S.A0013 + command: "writeAttribute" + attribute: "CapabilityMinima" + arguments: + value: { "CaseSessionsPerFabric": 4, "SubscriptionsPerFabric": 4 } + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads CapabilityMinima attribute from the DUT." + PICS: BINFO.S.A0013 + command: "readAttribute" + attribute: "CapabilityMinima" + response: + value: CapabilityMinimaValue diff --git a/src/app/tests/suites/certification/Test_TC_CC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_2_1.yaml index dfacc37a3217fe..91da2d93193ab1 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_2_1.yaml @@ -28,33 +28,32 @@ tests: - name: "nodeId" value: nodeId - - label: "Validate constraints of attribute: CurrentHue" - PICS: CC.S.A0000 + - label: "TH reads CurrentHue attribute from DUT" + PICS: CC.S.A0000 && CC.S.F00 command: "readAttribute" attribute: "CurrentHue" response: - value: 0 constraints: type: uint8 - - label: "Validate constraints of attribute: CurrentSaturation" - PICS: CC.S.A0001 + - label: "TH reads CurrentSaturation attribute from DUT" + PICS: CC.S.A0001 && CC.S.F00 command: "readAttribute" attribute: "CurrentSaturation" response: - value: 0 constraints: type: uint8 - - label: "Reads CurrentX attribute from DUT" - PICS: CC.S.A0003 + - label: "TH reads RemainingTime attribute from DUT" + PICS: CC.S.A0002 command: "readAttribute" - attribute: "CurrentX" + attribute: "RemainingTime" response: - value: 24939 + constraints: + type: uint16 - - label: "Validate constraints of attribute: CurrentX" - PICS: CC.S.A0003 + - label: "TH reads CurrentX attribute from DUT" + PICS: CC.S.A0003 && CC.S.F03 command: "readAttribute" attribute: "CurrentX" response: @@ -63,33 +62,37 @@ tests: minValue: 0 maxValue: 65279 - - label: "Reads CurrentY attribute from DUT" - PICS: CC.S.A0004 + - label: "TH reads CurrentY attribute from DUT" + PICS: CC.S.A0004 && CC.S.F04 command: "readAttribute" attribute: "CurrentY" response: - value: 24701 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - - label: "Validate constraints of attribute: CurrentY" - PICS: CC.S.A0004 + - label: "TH reads DriftCompensation attribute from DUT" + PICS: CC.S.A0005 command: "readAttribute" - attribute: "CurrentY" + attribute: "DriftCompensation" response: constraints: - type: uint16 + type: enum8 minValue: 0 - maxValue: 65279 + maxValue: 4 - #issue #18104 - - label: "Reads ColorTemperatureMireds attribute from DUT" - PICS: PICS_SKIP_SAMPLE_APP + - label: "TH reads CompensationText attribute from DUT" + PICS: CC.S.A0005 command: "readAttribute" - attribute: "ColorTemperature" + attribute: "CompensationText" response: - value: 250 + constraints: + type: string + maxLength: 254 - - label: "Validate constraints of attribute: ColorTemperatureMireds" - PICS: CC.S.A0007 + - label: "TH reads ColorTemperatureMireds attribute from DUT" + PICS: CC.S.A0007 && CC.S.F04 command: "readAttribute" attribute: "ColorTemperature" response: @@ -98,15 +101,7 @@ tests: minValue: 0 maxValue: 65279 - #issue #18104 - - label: "Reads ColorMode attribute from DUT" - PICS: PICS_SKIP_SAMPLE_APP - command: "readAttribute" - attribute: "ColorMode" - response: - value: 1 - - - label: "Validate constraints of attribute: ColorMode" + - label: "TH reads ColorMode attribute from DUT" PICS: CC.S.A0008 command: "readAttribute" attribute: "ColorMode" @@ -116,111 +111,93 @@ tests: minValue: 0 maxValue: 2 - - label: "Validate constraints of attribute: Options" + - label: "TH reads Options attribute from DUT" PICS: CC.S.A000f command: "readAttribute" attribute: "Options" response: - value: 0 constraints: - type: map8 + type: bitmap8 + minValue: 0 + maxValue: 4 - - label: "Validate constraints of attribute: EnhancedCurrentHue" - PICS: CC.S.A4000 + - label: "TH reads EnhancedCurrentHue attribute from DUT" + PICS: CC.S.A4000 && CC.S.F01 command: "readAttribute" attribute: "EnhancedCurrentHue" response: - value: 0 constraints: type: uint16 - #issue #18104 - - label: "Validate constraints of attribute: EnhancedColorMode" - PICS: PICS_SKIP_SAMPLE_APP + - label: "TH reads EnhancedColorMode attribute from DUT" + PICS: CC.S.F02 && CC.S.A4001 command: "readAttribute" attribute: "EnhancedColorMode" response: - value: 1 constraints: type: enum8 + minValue: 0 + maxValue: 3 - - label: "Validate constraints of attribute: ColorLoopActive" - PICS: CC.S.A4002 + - label: "TH reads ColorLoopActive attribute from DUT" + PICS: CC.S.A4002 && CC.S.F02 command: "readAttribute" attribute: "ColorLoopActive" response: - value: 0 constraints: type: uint8 - - label: "Validate constraints of attribute: ColorLoopDirection" - PICS: CC.S.A4003 + - label: "TH reads ColorLoopDirection attribute from DUT" + PICS: CC.S.A4003 && CC.S.F02 command: "readAttribute" attribute: "ColorLoopDirection" response: - value: 0 constraints: type: uint8 - - label: "Validate constraints of attribute: ColorLoopTime" - PICS: CC.S.A4004 + - label: "TH reads ColorLoopTime attribute from DUT" + PICS: CC.S.A4004 && CC.S.F02 command: "readAttribute" attribute: "ColorLoopTime" response: - value: 25 constraints: type: uint16 - - label: "Validate constraints of attribute: ColorLoopStartEnhancedHue" - PICS: CC.S.A4005 + - label: "TH reads ColorLoopStartEnhancedHue attribute from DUT" + PICS: CC.S.A4005 && CC.S.F02 command: "readAttribute" attribute: "ColorLoopStartEnhancedHue" response: - value: 8960 constraints: type: uint16 - - label: "Validate constraints of attribute: ColorLoopStoredEnhancedHue" - PICS: CC.S.A4006 + - label: "TH reads ColorLoopStoredEnhancedHue attribute from DUT" + PICS: CC.S.A4006 && CC.S.F02 command: "readAttribute" attribute: "ColorLoopStoredEnhancedHue" response: - value: 0 constraints: type: uint16 - - label: "read the optional global attribute: FeatureMap" + - label: "TH reads FeatureMap attribute from DUT" command: "readAttribute" attribute: "FeatureMap" response: saveAs: FeatureMapValue - - label: "Reads ColorCapabilities attribute from DUT" + - label: "TH reads ColorCapabilities attribute from DUT" PICS: CC.S.A400a command: "readAttribute" attribute: "ColorCapabilities" response: value: FeatureMapValue - - - label: "Validate constraints of attribute: ColorCapabilities" - PICS: CC.S.A400a - command: "readAttribute" - attribute: "ColorCapabilities" - response: constraints: type: map16 minValue: 0 maxValue: 31 - - label: "Reads ColorTempPhysicalMinMireds attribute from DUT" - PICS: CC.S.A400b - command: "readAttribute" - attribute: "ColorTempPhysicalMinMireds" - response: - value: 0 - - - label: "Validate constraints of attribute: ColorTempPhysicalMinMireds" - PICS: CC.S.A400b + - label: "TH reads ColorTempPhysicalMinMireds attribute from DUT" + PICS: CC.S.A400b && CC.S.F04 command: "readAttribute" attribute: "ColorTempPhysicalMinMireds" response: @@ -229,15 +206,8 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read ColorTempPhysicalMaxMireds attribute from DUT" - PICS: CC.S.A400c - command: "readAttribute" - attribute: "ColorTempPhysicalMaxMireds" - response: - value: 65279 - - - label: "Validate constraints of attribute: ColorTempPhysicalMaxMireds" - PICS: CC.S.A400c + - label: "TH reads ColorTempPhysicalMaxMireds attribute from DUT" + PICS: CC.S.A400c && CC.S.F04 command: "readAttribute" attribute: "ColorTempPhysicalMaxMireds" response: @@ -246,8 +216,8 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the optional attribute: CoupleColorTempToLevelMinMireds" - PICS: CC.S.A400d + - label: "TH reads CoupleColorTempToLevelMinMireds attribute from DUT" + PICS: CC.S.A400d && CC.S.F04 command: "readAttribute" attribute: "CoupleColorTempToLevelMinMireds" response: @@ -256,8 +226,8 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the optional attribute: StartUpColorTemperatureMireds" - PICS: CC.S.A4010 + - label: "TH reads StartUpColorTemperatureMireds attribute from DUT" + PICS: CC.S.A4010 && CC.S.F04 command: "readAttribute" attribute: "StartUpColorTemperatureMireds" response: @@ -266,36 +236,8 @@ tests: minValue: 0 maxValue: 65279 - - label: "Validate constraints of attribute: RemainingTime" - PICS: CC.S.A0002 - command: "readAttribute" - attribute: "RemainingTime" - response: - value: 0 - constraints: - type: uint16 - - - label: "Read the optional attribute: DriftCompensation" - PICS: CC.S.A0005 - command: "readAttribute" - attribute: "DriftCompensation" - response: - constraints: - type: enum8 - minValue: 0 - maxValue: 4 - - - label: "Read the optional attribute: CompensationText" - PICS: CC.S.A0005 - command: "readAttribute" - attribute: "CompensationText" - response: - constraints: - type: string - maxLength: 254 - #Defined Primaries Information Attribute Set - - label: "Read the mandatory attribute: NumberOfPrimaries" + - label: "TH reads NumberOfPrimaries attribute from DUT" PICS: CC.S.A0010 command: "readAttribute" attribute: "NumberOfPrimaries" @@ -305,7 +247,7 @@ tests: minValue: 0 maxValue: 6 - - label: "Read the mandatory attribute: Primary1X" + - label: "TH reads Primary1X attribute from DUT" PICS: CC.S.A0011 command: "readAttribute" attribute: "Primary1X" @@ -315,7 +257,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the mandatory attribute: Primary1Y" + - label: "TH reads Primary1Y attribute from DUT" PICS: CC.S.A0012 command: "readAttribute" attribute: "Primary1Y" @@ -325,7 +267,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the mandatory attribute: Primary1Intensity" + - label: "TH reads Primary1Intensity attribute from DUT" PICS: CC.S.A0013 command: "readAttribute" attribute: "Primary1Intensity" @@ -333,7 +275,7 @@ tests: constraints: type: uint8 - - label: "Read the mandatory attribute: Primary2X" + - label: "TH reads Primary2X attribute from DUT" PICS: CC.S.A0015 command: "readAttribute" attribute: "Primary2X" @@ -343,7 +285,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the mandatory attribute: Primary2Y" + - label: "TH reads Primary2Y attribute from DUT" PICS: CC.S.A0016 command: "readAttribute" attribute: "Primary2Y" @@ -353,7 +295,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Validate constraints of attribute: Primary2Intensity" + - label: "TH reads Primary2Intensity attribute from DUT" PICS: CC.S.A0017 command: "readAttribute" attribute: "Primary2Intensity" @@ -361,7 +303,7 @@ tests: constraints: type: uint8 - - label: "Read the mandatory attribute: Primary3X" + - label: "TH reads Primary3X attribute from DUT" PICS: CC.S.A0019 command: "readAttribute" attribute: "Primary3X" @@ -371,7 +313,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the mandatory attribute: Primary3Y" + - label: "TH reads Primary3Y attribute from DUT" PICS: CC.S.A001a command: "readAttribute" attribute: "Primary3Y" @@ -381,7 +323,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the mandatory attribute: Primary3Intensity" + - label: "TH reads Primary3Intensity attribute from DUT" PICS: CC.S.A001b command: "readAttribute" attribute: "Primary3Intensity" @@ -390,7 +332,7 @@ tests: type: uint8 #Additional Defined Primaries Information Attribute Set - - label: "Read the mandatory attribute: Primary4X" + - label: "TH reads Primary4X attribute from DUT" PICS: CC.S.A0020 command: "readAttribute" attribute: "Primary4X" @@ -400,7 +342,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the mandatory attribute: Primary4Y" + - label: "TH reads Primary4Y attribute from DUT" PICS: CC.S.A0021 command: "readAttribute" attribute: "Primary4Y" @@ -410,7 +352,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the mandatory attribute: Primary4Intensity" + - label: "TH reads Primary4Intensity attribute from DUT" PICS: CC.S.A0022 command: "readAttribute" attribute: "Primary4Intensity" @@ -418,7 +360,7 @@ tests: constraints: type: uint8 - - label: "Read the mandatory attribute: Primary5X" + - label: "TH reads Primary5X attribute from DUT" PICS: CC.S.A0024 command: "readAttribute" attribute: "Primary5X" @@ -428,7 +370,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the mandatory attribute: Primary5Y" + - label: "TH reads Primary5Y attribute from DUT" PICS: CC.S.A0025 command: "readAttribute" attribute: "Primary5Y" @@ -438,7 +380,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the mandatory attribute: Primary5Intensity" + - label: "TH reads Primary5Intensity attribute from DUT" PICS: CC.S.A0026 command: "readAttribute" attribute: "Primary5Intensity" @@ -446,7 +388,7 @@ tests: constraints: type: uint8 - - label: "Read the mandatory attribute: Primary6X" + - label: "TH reads Primary6X attribute from DUT" PICS: CC.S.A0028 command: "readAttribute" attribute: "Primary6X" @@ -456,7 +398,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the mandatory attribute: Primary6Y" + - label: "TH reads Primary6Y attribute from DUT" PICS: CC.S.A0029 command: "readAttribute" attribute: "Primary6Y" @@ -466,7 +408,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the mandatory attribute: Primary6Intensity" + - label: "TH reads Primary6Intensity attribute from DUT" PICS: CC.S.A002a command: "readAttribute" attribute: "Primary6Intensity" @@ -475,7 +417,7 @@ tests: type: uint8 #Defined Color Points Settings Attribute Set - - label: "Read the optional attribute: WhitePointX" + - label: "TH reads WhitePointX attribute from DUT" PICS: CC.S.A0030 command: "readAttribute" attribute: "WhitePointX" @@ -485,7 +427,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the optional attribute: WhitePointY" + - label: "TH reads WhitePointY attribute from DUT" PICS: CC.S.A0031 command: "readAttribute" attribute: "WhitePointY" @@ -495,7 +437,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the optional attribute: ColorPointRX" + - label: "TH reads ColorPointRX attribute from DUT" PICS: CC.S.A0032 command: "readAttribute" attribute: "ColorPointRX" @@ -505,7 +447,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the optional attribute: ColorPointRY" + - label: "TH reads ColorPointRY attribute from DUT" PICS: CC.S.A0033 command: "readAttribute" attribute: "ColorPointRY" @@ -515,7 +457,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the optional attribute: ColorPointRIntensity" + - label: "TH reads ColorPointRIntensity attribute from DUT" PICS: CC.S.A0034 command: "readAttribute" attribute: "ColorPointRIntensity" @@ -523,7 +465,7 @@ tests: constraints: type: uint8 - - label: "Read the optional attribute: ColorPointGX" + - label: "TH reads ColorPointGX attribute from DUT" PICS: CC.S.A0036 command: "readAttribute" attribute: "ColorPointGX" @@ -533,7 +475,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the optional attribute: ColorPointGY" + - label: "TH reads ColorPointGY attribute from DUT" PICS: CC.S.A0037 command: "readAttribute" attribute: "ColorPointGY" @@ -543,7 +485,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the optional attribute: ColorPointGIntensity" + - label: "TH reads ColorPointGIntensity attribute from DUT" PICS: CC.S.A0038 command: "readAttribute" attribute: "ColorPointGIntensity" @@ -551,7 +493,7 @@ tests: constraints: type: uint8 - - label: "Read the optional attribute: ColorPointBX" + - label: "TH reads ColorPointBX attribute from DUT" PICS: CC.S.A003a command: "readAttribute" attribute: "ColorPointBX" @@ -561,7 +503,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the optional attribute: ColorPointBY" + - label: "TH reads ColorPointBY attribute from DUT" PICS: CC.S.A003b command: "readAttribute" attribute: "ColorPointBY" @@ -571,7 +513,7 @@ tests: minValue: 0 maxValue: 65279 - - label: "Read the optional attribute: ColorPointBIntensity" + - label: "TH reads ColorPointBIntensity attribute from DUT" PICS: CC.S.A003c command: "readAttribute" attribute: "ColorPointBIntensity" diff --git a/src/app/tests/suites/certification/Test_TC_CC_9_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_9_1.yaml index f17724fcec3317..1c3a6386fc99e9 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_9_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_9_1.yaml @@ -223,8 +223,6 @@ tests: PICS: CC.S.A4005 response: saveAs: ColorLoopStartEnhancedHue - constraints: - type: uint16 - label: "Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" @@ -287,8 +285,6 @@ tests: PICS: CC.S.A4006 response: saveAs: ColorLoopStoredEnhancedHueValue1 - constraints: - type: uint16 - label: "Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" @@ -372,8 +368,6 @@ tests: PICS: CC.S.A4005 response: saveAs: ColorLoopStartEnhancedHue2 - constraints: - type: uint16 - label: "Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" @@ -436,8 +430,6 @@ tests: PICS: CC.S.A4006 response: saveAs: ColorLoopStoredEnhancedHueValue2 - constraints: - type: uint16 - label: "Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" @@ -552,8 +544,6 @@ tests: PICS: CC.S.A4005 response: saveAs: ColorLoopStartEnhancedHue3 - constraints: - type: uint16 - label: "Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" @@ -616,8 +606,6 @@ tests: PICS: CC.S.A4006 response: saveAs: ColorLoopStoredEnhancedHueValue3 - constraints: - type: uint16 - label: "Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" @@ -701,8 +689,6 @@ tests: PICS: CC.S.A4005 response: saveAs: ColorLoopStartEnhancedHue4 - constraints: - type: uint16 - label: "Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" @@ -765,8 +751,6 @@ tests: PICS: CC.S.A4006 response: saveAs: ColorLoopStoredEnhancedHue4 - constraints: - type: uint16 - label: "Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_CC_9_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_9_2.yaml index 0260d8aadc90a0..6677f80a07296c 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_9_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_9_2.yaml @@ -164,8 +164,6 @@ tests: PICS: CC.S.A4005 response: saveAs: ColorLoopStartEnhancedHueValue - constraints: - type: uint16 - label: "Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" @@ -236,8 +234,6 @@ tests: PICS: CC.S.A4005 response: saveAs: ColorLoopStartEnhancedHue1 - constraints: - type: uint16 - label: "Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" @@ -300,8 +296,6 @@ tests: attribute: "ColorLoopStoredEnhancedHue" response: saveAs: ColorLoopStoredEnhancedHueValue - constraints: - type: uint16 - label: "Read EnhancedCurrentHue attribute from DUT." command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_CC_9_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_9_3.yaml index d9d163b9bcc6a1..52c888d5b48644 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_9_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_9_3.yaml @@ -163,8 +163,6 @@ tests: PICS: CC.S.A4005 response: saveAs: ColorLoopStartEnhancedHueValue - constraints: - type: uint16 - label: "Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" @@ -290,8 +288,6 @@ tests: PICS: CC.S.A4006 response: saveAs: ColorLoopStoredEnhancedHueValue - constraints: - type: uint16 - label: "Read EnhancedCurrentHue attribute from DUT." command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_CGEN_1_1.yaml b/src/app/tests/suites/certification/Test_TC_CGEN_1_1.yaml index 00c94f11026069..983145e592e4b8 100644 --- a/src/app/tests/suites/certification/Test_TC_CGEN_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CGEN_1_1.yaml @@ -56,17 +56,17 @@ tests: command: "readAttribute" attribute: "AcceptedCommandList" response: - value: [0, 2, 4] constraints: type: list + contains: [0, 2, 4] - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" response: - value: [1, 3, 5] constraints: type: list + contains: [1, 3, 5] #issue #15011 - label: diff --git a/src/app/tests/suites/certification/Test_TC_CGEN_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CGEN_2_1.yaml index 4a8cd4b7eb7ad0..9f318bb7e44166 100644 --- a/src/app/tests/suites/certification/Test_TC_CGEN_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CGEN_2_1.yaml @@ -72,6 +72,7 @@ tests: maxValue: 2 #Issue 17997 + #this step implicitly validating the attribute(BasicCommissioningInfo)constraints, as long as the payload is being parsed successfully - label: "TH1 reads BasicCommissioningInfo attribute from DUT and Verify that the BasicCommissioningInfo attribute has the following field: @@ -81,19 +82,6 @@ tests: command: "readAttribute" attribute: "BasicCommissioningInfo" - - label: - "Step 6 is implicitly validating the attribute(BasicCommissioningInfo) - constraints, as long as the payload is being parsed successfully" - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - label: "TH1 reads SupportsConcurrentConnection attribute from the DUT" PICS: CGEN.S.A0004 command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_CHANNEL_1_6.yaml b/src/app/tests/suites/certification/Test_TC_CHANNEL_1_6.yaml index 0b27875e2bdfa6..69f314073cf611 100644 --- a/src/app/tests/suites/certification/Test_TC_CHANNEL_1_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_CHANNEL_1_6.yaml @@ -60,9 +60,9 @@ tests: command: "readAttribute" attribute: "AcceptedCommandList" response: - value: [0, 2, 3] constraints: type: list + contains: [0, 2, 3] - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_1_11.yaml b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_1_11.yaml index 7b46c6f82f1b9e..94c30db611e942 100644 --- a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_1_11.yaml +++ b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_1_11.yaml @@ -69,9 +69,9 @@ tests: command: "readAttribute" attribute: "GeneratedCommandList" response: - value: [2] constraints: type: list + contains: [2] #issue #11053 disabled steps below Global attributes missing from YAML framework - label: diff --git a/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml index 06586558ffd83c..d27e6f29454356 100644 --- a/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGGEN_1_1.yaml @@ -57,9 +57,9 @@ tests: command: "readAttribute" attribute: "AcceptedCommandList" response: - value: [0] constraints: type: list + contains: [0] - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_2.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_2.yaml index 37b70334b52eb0..a7efd0c912d0bf 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_2.yaml @@ -28,37 +28,56 @@ tests: - name: "nodeId" value: nodeId - - label: - "TH writes the RequirePINforRemoteOperation attribute value as False - on the DUT" - PICS: DRLK.S.A0033 - command: "writeAttribute" - attribute: "RequirePINforRemoteOperation" - arguments: - value: false - - - label: "TH sends Lock Door Command to the DUT without PINCode" - PICS: DRLK.S.C00.Rsp - command: "LockDoor" + - label: "Create new user" + command: "SetUser" timedInteractionTimeoutMs: 10000 arguments: values: - - name: "PINCode" - value: "" - response: - error: FAILURE + - name: "operationType" + value: 0 + - name: "userIndex" + value: 1 + - name: "userName" + value: "xxx" + - name: "userUniqueId" + value: 6452 + - name: "userStatus" + value: 1 + - name: "userType" + value: 0 + - name: "credentialRule" + value: 0 - - label: - "TH writes the RequirePINforRemoteOperation attribute value as True on - the DUT" - PICS: DRLK.S.A0033 - command: "writeAttribute" - attribute: "RequirePINforRemoteOperation" + - label: "Read the user back and verify its fields" + command: "GetUser" arguments: - value: true + values: + - name: "userIndex" + value: 1 + response: + values: + - name: "userIndex" + value: 1 + - name: "userName" + value: "xxx" + - name: "userUniqueId" + value: 6452 + - name: "userStatus" + value: 1 + - name: "userType" + value: 0 + - name: "credentialRule" + value: 0 + - name: "credentials" + value: null + - name: "creatorFabricIndex" + value: 1 + - name: "lastModifiedFabricIndex" + value: 1 + - name: "nextUserIndex" + value: null - label: "Create new PIN credential and lock/unlock user" - PICS: DRLK.S.C22.Rsp command: "SetCredential" timedInteractionTimeoutMs: 10000 arguments: @@ -70,20 +89,80 @@ tests: - name: "credentialData" value: "123456" - name: "userIndex" - value: null + value: 1 - name: "userStatus" - value: null + value: 0 - name: "userType" - value: null + value: 0 response: values: - name: "status" value: 0 - name: "userIndex" - value: 1 + value: null - name: "nextCredentialIndex" value: 2 + - label: "Verify created PIN credential" + command: "GetCredentialStatus" + arguments: + values: + - name: "credential" + value: { CredentialType: 1, CredentialIndex: 1 } + response: + values: + - name: "credentialExists" + value: true + - name: "userIndex" + value: 1 + - name: "creatorFabricIndex" + value: 1 + - name: "lastModifiedFabricIndex" + value: 1 + - name: "nextCredentialIndex" + value: null + + - label: + "TH writes the RequirePINforRemoteOperation attribute value as False + on the DUT" + PICS: DRLK.S.A0033 + command: "writeAttribute" + attribute: "RequirePINforRemoteOperation" + arguments: + value: false + + - label: "TH sends Lock Door Command to the DUT without PINCode" + PICS: DRLK.S.C00.Rsp + command: "LockDoor" + timedInteractionTimeoutMs: 10000 + response: + error: 0x00 + + - label: "TH sends Lock Door Command to the DUT with valid PINCode" + PICS: DRLK.S.C00.Rsp + command: "LockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "pinCode" + value: "123456" + + - label: + "TH writes the RequirePINforRemoteOperation attribute value as True on + the DUT" + PICS: DRLK.S.A0033 + command: "writeAttribute" + attribute: "RequirePINforRemoteOperation" + arguments: + value: true + + - label: "TH reads the RequirePINforRemoteOperation attribute from the DUT" + PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033 + command: "readAttribute" + attribute: "RequirePINforRemoteOperation" + response: + value: true + - label: "TH sends Lock Door Command to the DUT with valid PINCode" PICS: DRLK.S.C00.Rsp command: "LockDoor" @@ -93,6 +172,17 @@ tests: - name: "pinCode" value: "123456" + - label: "TH sends Lock Door Command to the DUT without valid PINCode" + PICS: DRLK.S.C00.Rsp + command: "LockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "pinCode" + value: "645321" + response: + error: FAILURE + - label: "TH sends Lock Door Command to the DUT without any argument PINCode" PICS: DRLK.S.C00.Rsp @@ -119,7 +209,7 @@ tests: command: "writeAttribute" attribute: "UserCodeTemporaryDisableTime" arguments: - value: 5 + value: 15 - label: "TH sends Lock Door Command to the DUT with invalid PINCode" PICS: DRLK.S.C00.Rsp @@ -170,7 +260,7 @@ tests: command: "readAttribute" attribute: "UserCodeTemporaryDisableTime" response: - value: 5 + value: 15 - label: "TH sends Lock Door Command to the DUT with valid PINCode" PICS: DRLK.S.C00.Rsp @@ -181,7 +271,15 @@ tests: - name: "pinCode" value: "123456" - - label: "Clean the created credential" + - label: "Clean the created user" + command: "ClearUser" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "userIndex" + value: 1 + + - label: "Cleanup the created credential" PICS: DRLK.S.C26.Rsp command: "ClearCredential" timedInteractionTimeoutMs: 10000 diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_3.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_3.yaml index a8177cb10a1aff..6ade07cbbd046b 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_3.yaml @@ -28,8 +28,56 @@ tests: - name: "nodeId" value: nodeId + - label: "Create new user" + command: "SetUser" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "operationType" + value: 0 + - name: "userIndex" + value: 1 + - name: "userName" + value: "xxx" + - name: "userUniqueId" + value: 6452 + - name: "userStatus" + value: 1 + - name: "userType" + value: 0 + - name: "credentialRule" + value: 0 + + - label: "Read the user back and verify its fields" + command: "GetUser" + arguments: + values: + - name: "userIndex" + value: 1 + response: + values: + - name: "userIndex" + value: 1 + - name: "userName" + value: "xxx" + - name: "userUniqueId" + value: 6452 + - name: "userStatus" + value: 1 + - name: "userType" + value: 0 + - name: "credentialRule" + value: 0 + - name: "credentials" + value: null + - name: "creatorFabricIndex" + value: 1 + - name: "lastModifiedFabricIndex" + value: 1 + - name: "nextUserIndex" + value: null + - label: "Create new PIN credential and lock/unlock user" - PICS: DRLK.S.C22.Rsp command: "SetCredential" timedInteractionTimeoutMs: 10000 arguments: @@ -41,20 +89,39 @@ tests: - name: "credentialData" value: "123456" - name: "userIndex" - value: null + value: 1 - name: "userStatus" - value: null + value: 0 - name: "userType" - value: null + value: 0 response: values: - name: "status" value: 0 - name: "userIndex" - value: 1 + value: null - name: "nextCredentialIndex" value: 2 + - label: "Verify created PIN credential" + command: "GetCredentialStatus" + arguments: + values: + - name: "credential" + value: { CredentialType: 1, CredentialIndex: 1 } + response: + values: + - name: "credentialExists" + value: true + - name: "userIndex" + value: 1 + - name: "creatorFabricIndex" + value: 1 + - name: "lastModifiedFabricIndex" + value: 1 + - name: "nextCredentialIndex" + value: null + - label: "Precondition: Door is in locked state" PICS: DRLK.S.C00.Rsp command: "LockDoor" @@ -69,7 +136,7 @@ tests: command: "writeAttribute" attribute: "AutoRelockTime" arguments: - value: 10 + value: 60 - label: "TH sends the unlock Door command to the DUT with valid PINCode" PICS: DRLK.S.C01.Rsp @@ -80,13 +147,6 @@ tests: - name: "PINCode" value: "123456" - - label: "TH reads AutoRelockTime attribute from DUT" - PICS: DRLK.S.A0023 - command: "readAttribute" - attribute: "AutoRelockTime" - response: - value: 10 - - label: "Wait 10000ms" cluster: "DelayCommands" command: "WaitForMs" @@ -100,7 +160,15 @@ tests: command: "readAttribute" attribute: "LockState" response: - value: 1 + value: 2 + + - label: "Cleanup the created user" + command: "ClearUser" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "userIndex" + value: 1 - label: "Clean the created credential" PICS: DRLK.S.C26.Rsp diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml index d27f97b414e44f..a9b03a5237e9b4 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml @@ -31,32 +31,54 @@ tests: - name: "nodeId" value: nodeId - - label: "Create new PIN credential and lock/unlock user" - PICS: DRLK.S.C22.Rsp - command: "SetCredential" + - label: "Create new user" + command: "SetUser" timedInteractionTimeoutMs: 10000 arguments: values: - name: "operationType" value: 0 - - name: "credential" - value: { CredentialType: 1, CredentialIndex: 1 } - - name: "credentialData" - value: "123456" - name: "userIndex" - value: null + value: 1 + - name: "userName" + value: "xxx" + - name: "userUniqueId" + value: 6452 - name: "userStatus" - value: null + value: 1 - name: "userType" - value: null + value: 0 + - name: "credentialRule" + value: 0 + + - label: "Read the user back and verify its fields" + command: "GetUser" + arguments: + values: + - name: "userIndex" + value: 1 response: values: - - name: "status" - value: 0 - name: "userIndex" value: 1 - - name: "nextCredentialIndex" - value: 2 + - name: "userName" + value: "xxx" + - name: "userUniqueId" + value: 6452 + - name: "userStatus" + value: 1 + - name: "userType" + value: 0 + - name: "credentialRule" + value: 0 + - name: "credentials" + value: null + - name: "creatorFabricIndex" + value: 1 + - name: "lastModifiedFabricIndex" + value: 1 + - name: "nextUserIndex" + value: null - label: "Get Max number of Week Day schedules for user" PICS: DRLK.S.F04 && DRLK.S.A0014 @@ -64,7 +86,9 @@ tests: attribute: "NumberOfWeekDaySchedulesSupportedPerUser" response: saveAs: NumberOfWeekDaySchedulesSupportedPerUser - value: 10 + constraints: + minValue: 0 + maxValue: 255 - label: "Get number of supported users" PICS: DRLK.S.F08 && DRLK.S.A0011 @@ -72,7 +96,9 @@ tests: attribute: "NumberOfTotalUsersSupported" response: saveAs: NumberOfTotalUsersSupported - value: 10 + constraints: + minValue: 0 + maxValue: 65534 - label: "Send Set Week Day Schedule Command to DUT" PICS: DRLK.S.F04 && DRLK.S.C0B.Rsp @@ -109,9 +135,11 @@ tests: - name: "weekDayIndex" constraints: minValue: 1 + maxValue: NumberOfWeekDaySchedulesSupportedPerUser - name: "userIndex" constraints: minValue: 1 + maxValue: NumberOfTotalUsersSupported - name: "status" value: 0x0 - name: "daysMask" @@ -205,7 +233,7 @@ tests: arguments: values: - name: "weekDayIndex" - value: 0xFE + value: 1 - name: "userIndex" value: 1 @@ -241,3 +269,11 @@ tests: - name: "endMinute" constraints: hasValue: false + + - label: "Cleanup the created user" + command: "ClearUser" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "userIndex" + value: 1 diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml index 6e082ffbe9d30d..0b0f1c71ac9a23 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml @@ -31,57 +31,54 @@ tests: - name: "nodeId" value: nodeId - - label: "Create new PIN credential and lock/unlock user" - command: "SetCredential" + - label: "Create new user" + command: "SetUser" timedInteractionTimeoutMs: 10000 arguments: values: - name: "operationType" value: 0 - - name: "credential" - value: { CredentialType: 1, CredentialIndex: 1 } - - name: "credentialData" - value: "123456" - name: "userIndex" - value: null + value: 1 + - name: "userName" + value: "xxx" + - name: "userUniqueId" + value: 6452 - name: "userStatus" - value: null + value: 1 - name: "userType" - value: null - response: - values: - - name: "status" value: 0 - - name: "userIndex" - value: 1 - - name: "nextCredentialIndex" - value: 2 + - name: "credentialRule" + value: 0 - - label: "Create new PIN credential and lock/unlock for second user" - command: "SetCredential" - timedInteractionTimeoutMs: 10000 + - label: "Read the user back and verify its fields" + command: "GetUser" arguments: values: - - name: "operationType" - value: 0 - - name: "credential" - value: { CredentialType: 1, CredentialIndex: 2 } - - name: "credentialData" - value: "123457" - name: "userIndex" - value: null - - name: "userStatus" - value: null - - name: "userType" - value: null + value: 1 response: values: - - name: "status" - value: 0 - name: "userIndex" - value: 2 - - name: "nextCredentialIndex" - value: 3 + value: 1 + - name: "userName" + value: "xxx" + - name: "userUniqueId" + value: 6452 + - name: "userStatus" + value: 1 + - name: "userType" + value: 0 + - name: "credentialRule" + value: 0 + - name: "credentials" + value: null + - name: "creatorFabricIndex" + value: 1 + - name: "lastModifiedFabricIndex" + value: 1 + - name: "nextUserIndex" + value: null - label: "Get Max number of year Day schedules for user" PICS: DRLK.S.F04 && DRLK.S.A0015 @@ -89,7 +86,9 @@ tests: attribute: "NumberOfYearDaySchedulesSupportedPerUser" response: saveAs: NumberOfYearDaySchedulesSupportedPerUser - value: 10 + constraints: + minValue: 0 + maxValue: 255 - label: "Get number of supported users" PICS: DRLK.C.F08 && DRLK.S.A0011 @@ -97,7 +96,9 @@ tests: attribute: "NumberOfTotalUsersSupported" response: saveAs: NumberOfTotalUsersSupported - value: 10 + constraints: + minValue: 0 + maxValue: 65534 - label: "Send Set Year Day Schedule Command to DUT" PICS: DRLK.S.F04 && DRLK.S.C0E.Rsp @@ -109,11 +110,11 @@ tests: - name: "userIndex" value: 1 - name: "LocalStartTime" - value: 10 + value: 960 - name: "LocalEndTime" - value: 20 + value: 1980 - #issue #18591 and #18590 + #issue #18591 - label: "send Get Year Day Schedule Command" PICS: DRLK.S.F04 && DRLK.S.C0F.Rsp && DRLK.S.C0F.Tx command: "GetYearDaySchedule" @@ -128,9 +129,11 @@ tests: - name: "YearDayIndex" constraints: minValue: 1 + maxValue: NumberOfYearDaySchedulesSupportedPerUser - name: "userIndex" constraints: minValue: 1 + maxValue: NumberOfTotalUsersSupported - name: "status" value: 0x0 - name: "LocalStartTime" @@ -152,11 +155,11 @@ tests: - name: "YearDayIndex" value: 0 - name: "userIndex" - value: 10 + value: 15 - name: "LocalStartTime" - value: 30 + value: 1020 - name: "LocalEndTime" - value: 10 + value: 2040 response: error: INVALID_COMMAND @@ -211,25 +214,35 @@ tests: constraints: hasValue: false + - label: "Clear a year day schedule for the first user" + PICS: DRLK.S.C10.Rsp + command: "ClearYearDaySchedule" + arguments: + values: + - name: "yearDayIndex" + value: 1 + - name: "userIndex" + value: 1 + - label: - "send Get Year Day Schedule Command to DUT and verify NOT_FOUND - response " - PICS: DRLK.S.F04 && DRLK.S.C0F.Rsp && DRLK.S.C0F.Tx + "send Get Year Day Schedule Command to DUT and verify NOT_FOUND + response" + PICS: DRLK.S.F04 && DRLK.S.C0F.Rsp && DRLK.S.C0F.Tx && DRLK.S.C10.Rsp command: "GetYearDaySchedule" arguments: values: - name: "YearDayIndex" - value: 2 + value: 1 - name: "userIndex" - value: 2 + value: 1 response: values: - name: "YearDayIndex" - value: 2 + value: 1 - name: "userIndex" - value: 2 + value: 1 - name: "status" - value: 0x8B + value: 0x01 - name: "LocalStartTime" constraints: hasValue: false @@ -237,38 +250,56 @@ tests: constraints: hasValue: false - - label: "Send Set Year Day Schedule Command to DUT" + - label: "Send Set Year Day Schedule Command to DUT " PICS: DRLK.S.C0E.Rsp command: "SetYearDaySchedule" arguments: values: - name: "YearDayIndex" - value: 2 + value: 1 - name: "userIndex" - value: 2 + value: 1 - name: "LocalStartTime" - value: 10 + value: 1080 - name: "LocalEndTime" - value: 20 + value: 2100 - - label: "send Get Year Day Schedule Command " + - label: "send Get Year Day Schedule Command" PICS: DRLK.S.F04 && DRLK.S.C0F.Rsp && DRLK.S.C0F.Tx command: "GetYearDaySchedule" arguments: values: - name: "YearDayIndex" - value: 2 + value: 1 - name: "userIndex" - value: 2 + value: 1 response: values: - name: "YearDayIndex" - value: 2 + value: 1 - name: "userIndex" - value: 2 + value: 1 - name: "status" - value: 0x0 + value: 0x00 - name: "LocalStartTime" - value: 10 + value: 1080 - name: "LocalEndTime" - value: 20 + value: 2100 + + - label: "Clear a year day schedule for the first user" + PICS: DRLK.S.F04 && DRLK.S.C10.Rsp + command: "ClearYearDaySchedule" + arguments: + values: + - name: "yearDayIndex" + value: 1 + - name: "userIndex" + value: 1 + + - label: "Cleanup the created user" + command: "ClearUser" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "userIndex" + value: 1 diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml index 77d8d60ec3ffd0..2c1da053d9c7fe 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml @@ -31,6 +31,55 @@ tests: - name: "nodeId" value: nodeId + - label: "Create new user with default parameters" + command: "SetUser" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "operationType" + value: 0 + - name: "userIndex" + value: 1 + - name: "userName" + value: "xxx" + - name: "userUniqueId" + value: 6452 + - name: "userStatus" + value: 1 + - name: "userType" + value: 0 + - name: "credentialRule" + value: 0 + + - label: "Read the user back and verify its fields" + command: "GetUser" + arguments: + values: + - name: "userIndex" + value: 1 + response: + values: + - name: "userIndex" + value: 1 + - name: "userName" + value: "xxx" + - name: "userUniqueId" + value: 6452 + - name: "userStatus" + value: 1 + - name: "userType" + value: 0 + - name: "credentialRule" + value: 0 + - name: "credentials" + value: null + - name: "creatorFabricIndex" + value: 1 + - name: "lastModifiedFabricIndex" + value: 1 + - name: "nextUserIndex" + value: null + - label: "TH reads NumberOfTotalUsersSupported attribute and saves for future use." @@ -39,7 +88,9 @@ tests: attribute: "NumberOfTotalUsersSupported" response: saveAs: NumberOfTotalUsersSupported - value: 10 + constraints: + minValue: 0 + maxValue: 255 - label: "TH sends Set Credential Command to DUT" PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx @@ -59,6 +110,14 @@ tests: value: 0 - name: "userType" value: 0 + response: + values: + - name: "status" + value: 0 + - name: "userIndex" + value: null + - name: "nextCredentialIndex" + value: 2 - label: "TH sends Get Credential Status Command" PICS: DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx @@ -69,22 +128,23 @@ tests: value: { CredentialType: 1, CredentialIndex: 1 } response: values: - - name: "CredentialType" - constraints: - minValue: 0 - maxValue: 5 - - name: "CredentialIndex" - constraints: - minValue: 0 - maxValue: 65534 - - name: "CredentialExists" + - name: "credentialExists" constraints: type: boolean - - name: "UserIndex" + - name: "userIndex" constraints: minValue: 1 + maxValue: NumberOfTotalUsersSupported + - name: "creatorFabricIndex" + value: 1 + - name: "lastModifiedFabricIndex" + value: 1 + - name: "nextCredentialIndex" + value: null - - label: "TH sends Set Credential Command to DUT" + - label: + "TH sends Set Credential Command to DUT and verify the + INVALID_COMMAND if any of the fields are invalid" PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx command: "SetCredential" timedInteractionTimeoutMs: 10000 @@ -93,7 +153,7 @@ tests: - name: "operationType" value: 0 - name: "credential" - value: { CredentialType: 1, CredentialIndex: 1 } + value: { CredentialType: 1, CredentialIndex: 2 } - name: "credentialData" value: "1234" - name: "userIndex" @@ -102,8 +162,18 @@ tests: value: 5 - name: "userType" value: 10 + response: + values: + - name: "status" + value: 0x85 + - name: "userIndex" + value: null + - name: "nextCredentialIndex" + value: 3 - - label: "TH sends Set Credential Command to DUT" + - label: + "TH sends Set Credential Command to DUT and verify response as + DUPLICATE if CredentialData is repeated" PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx command: "SetCredential" timedInteractionTimeoutMs: 10000 @@ -112,7 +182,7 @@ tests: - name: "operationType" value: 0 - name: "credential" - value: { CredentialType: 1, CredentialIndex: 1 } + value: { CredentialType: 1, CredentialIndex: 2 } - name: "credentialData" value: "123456" - name: "userIndex" @@ -121,8 +191,18 @@ tests: value: 0 - name: "userType" value: 0 + response: + values: + - name: "status" + value: 0x02 + - name: "userIndex" + value: null + - name: "nextCredentialIndex" + value: 3 - - label: "TH sends Set Credential Command to DUT" + - label: + "TH sends Set Credential Command to DUT and verify response as + OCCUPIED if CredentialIndex is repeated" PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx command: "SetCredential" timedInteractionTimeoutMs: 10000 @@ -140,27 +220,18 @@ tests: value: 0 - name: "userType" value: 0 - - - label: "TH sends Set Credential Command to DUT" - PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx - command: "SetCredential" - timedInteractionTimeoutMs: 10000 - arguments: + response: values: - - name: "operationType" - value: 0 - - name: "credential" - value: { CredentialType: 1, CredentialIndex: 2 } - - name: "credentialData" - value: "123456" + - name: "status" + value: 0x02 - name: "userIndex" - value: 3 - - name: "userStatus" - value: 0 - - name: "userType" - value: 0 + value: null + - name: "nextCredentialIndex" + value: 2 - - label: "TH sends Set Credential Command to DUT" + - label: + "TH sends Set Credential Command to DUT and verify the DUT response as + OCCUPIED if the CredentialIndex is not associated with the UserIndex" PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx command: "SetCredential" timedInteractionTimeoutMs: 10000 @@ -173,11 +244,19 @@ tests: - name: "credentialData" value: "123456" - name: "userIndex" - value: 3 + value: 2 - name: "userStatus" value: 0 - name: "userType" value: 0 + response: + values: + - name: "status" + value: 0x02 + - name: "userIndex" + value: null + - name: "nextCredentialIndex" + value: 4 - label: "TH sends Clear Credential Command to DUT" PICS: DRLK.S.F08 && DRLK.S.C26.Rsp @@ -188,33 +267,47 @@ tests: - name: "credential" value: { CredentialType: 1, CredentialIndex: 1 } - - label: "TH sends Set Credential Command to DUT" - PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx - command: "SetCredential" + - label: + "TH sends Get Credential Status Command and verify that the + CredentialType and CredentialIndex for the provided value is cleared" + PICS: DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx + command: "GetCredentialStatus" + arguments: + values: + - name: "credential" + value: { CredentialType: 1, CredentialIndex: 1 } + response: + values: + - name: "credentialExists" + value: false + - name: "userIndex" + value: null + - name: "creatorFabricIndex" + value: null + - name: "lastModifiedFabricIndex" + value: null + - name: "nextCredentialIndex" + value: null + + - label: "TH sends Set User Command to DUT" + command: "SetUser" timedInteractionTimeoutMs: 10000 arguments: values: - name: "operationType" value: 0 - - name: "credential" - value: { CredentialType: 1, CredentialIndex: 1 } - - name: "credentialData" - value: "123456" - name: "userIndex" value: 2 + - name: "userName" + value: "xxx" + - name: "userUniqueId" + value: 6452 - name: "userStatus" - value: 0 + value: 1 - name: "userType" value: 0 - - - label: "TH sends Clear Credential Command to DUT" - PICS: DRLK.S.F08 && DRLK.S.C26.Rsp - command: "ClearCredential" - timedInteractionTimeoutMs: 10000 - arguments: - values: - - name: "credential" - value: { CredentialType: 1, CredentialIndex: 0xFFFE } + - name: "credentialRule" + value: 0 - label: "TH sends Set Credential Command to DUT" PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx @@ -225,7 +318,7 @@ tests: - name: "operationType" value: 0 - name: "credential" - value: { CredentialType: 1, CredentialIndex: 1 } + value: { CredentialType: 1, CredentialIndex: 3 } - name: "credentialData" value: "123456" - name: "userIndex" @@ -234,6 +327,14 @@ tests: value: 0 - name: "userType" value: 0 + response: + values: + - name: "status" + value: 0 + - name: "userIndex" + value: null + - name: "nextCredentialIndex" + value: 4 - label: "TH sends Clear Credential Command to DUT" PICS: DRLK.S.F08 && DRLK.S.C26.Rsp @@ -242,7 +343,7 @@ tests: arguments: values: - name: "credential" - value: { CredentialType: 1, CredentialIndex: 0xFFFE } + value: { CredentialType: 1, CredentialIndex: 65534 } - label: "TH sends Get Credential Status Command" PICS: DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx @@ -250,30 +351,29 @@ tests: arguments: values: - name: "credential" - value: { CredentialType: 1, CredentialIndex: 1 } + value: { CredentialType: 1, CredentialIndex: 65534 } response: - values: - - name: "UserIndex" - value: null + error: INVALID_COMMAND - - label: "TH sends Set Credential Command to DUT" - PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx - command: "SetCredential" - timedInteractionTimeoutMs: 10000 + - label: "TH sends Get Credential Status Command" + PICS: DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx + command: "GetCredentialStatus" arguments: values: - - name: "operationType" - value: 0 - name: "credential" value: { CredentialType: 1, CredentialIndex: 1 } - - name: "credentialData" - value: "123456" + response: + values: + - name: "credentialExists" + value: false - name: "userIndex" - value: 2 - - name: "userStatus" - value: 0 - - name: "userType" - value: 0 + value: null + - name: "creatorFabricIndex" + value: null + - name: "lastModifiedFabricIndex" + value: null + - name: "nextCredentialIndex" + value: null - label: "TH sends Clear Credential Command to DUT" PICS: DRLK.S.F08 && DRLK.S.C26.Rsp diff --git a/src/app/tests/suites/certification/Test_TC_FLW_1_1.yaml b/src/app/tests/suites/certification/Test_TC_FLW_1_1.yaml index ea3657e7260bbe..57fbce069a464f 100644 --- a/src/app/tests/suites/certification/Test_TC_FLW_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_FLW_1_1.yaml @@ -58,9 +58,9 @@ tests: command: "readAttribute" attribute: "AttributeList" response: - value: [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533] constraints: type: list + contains: [0, 1, 2, 3, 65528, 65529, 65531, 65532, 65533] - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_I_1_1.yaml b/src/app/tests/suites/certification/Test_TC_I_1_1.yaml index 0172010ca6af04..d0a1ce53995050 100644 --- a/src/app/tests/suites/certification/Test_TC_I_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_I_1_1.yaml @@ -53,12 +53,22 @@ tests: contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - label: "Read the global attribute: AcceptedCommandList" + PICS: " !I.C.C40.Tx " command: "readAttribute" attribute: "AcceptedCommandList" response: - value: [0, 64] constraints: type: list + contains: [0] + + - label: "Read the global attribute: AcceptedCommandList" + PICS: I.C.C40.Tx + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0, 64] - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_KEYPADINPUT_1_2.yaml b/src/app/tests/suites/certification/Test_TC_KEYPADINPUT_1_2.yaml index f7ee45a3ec4aff..f1022e5cc105a0 100644 --- a/src/app/tests/suites/certification/Test_TC_KEYPADINPUT_1_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_KEYPADINPUT_1_2.yaml @@ -52,25 +52,25 @@ tests: command: "readAttribute" attribute: "AttributeList" response: - value: [65528, 65529, 65531, 65532, 65533] constraints: type: list + contains: [65528, 65529, 65531, 65532, 65533] - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" response: - value: [0] constraints: type: list + contains: [0] - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" response: - value: [1] constraints: type: list + contains: [1] #issue #11053 disabled steps below Global attributes missing from YAML framework - label: diff --git a/src/app/tests/suites/certification/Test_TC_LVL_2_1.yaml b/src/app/tests/suites/certification/Test_TC_LVL_2_1.yaml index 9290f5798aad21..bd2a45f4af5dcc 100644 --- a/src/app/tests/suites/certification/Test_TC_LVL_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LVL_2_1.yaml @@ -55,7 +55,6 @@ tests: command: "readAttribute" attribute: "current level" response: - value: 254 saveAs: CurrentLevelValue constraints: type: uint8 @@ -65,12 +64,11 @@ tests: command: "readAttribute" attribute: "remaining time" response: - value: 0 constraints: type: uint16 - label: "Reads the MinLevel attribute" - PICS: LVL.S.A0002 + PICS: LVL.S.A0002 && LVL.S.F01 command: "readAttribute" attribute: "min level" response: @@ -78,11 +76,9 @@ tests: saveAs: MinLevelValue constraints: type: uint8 - minValue: 0 - maxValue: 1 - label: "Reads the MinLevel attribute" - PICS: LVL.S.A0002 + PICS: LVL.S.A0002 && !LVL.S.F01 command: "readAttribute" attribute: "min level" response: @@ -93,7 +89,7 @@ tests: maxValue: 1 - label: "Reads the MaxLevel attribute" - PICS: LVL.S.A0003 + PICS: LVL.S.A0003 && LVL.S.F01 command: "readAttribute" attribute: "max level" response: @@ -101,18 +97,17 @@ tests: saveAs: MaxLevelValue constraints: type: uint8 - minValue: 1 - maxValue: 254 + minValue: MinLevelValue - label: "Reads the MaxLevel attribute" - PICS: LVL.S.A0003 + PICS: LVL.S.A0003 && !LVL.S.F01 command: "readAttribute" attribute: "max level" response: saveAs: MaxLevelValue1 constraints: type: uint8 - minValue: 1 + minValue: MinLevelValue1 maxValue: 254 - label: "Step 4b & 4C Reads the CurrentLevel attribute" @@ -162,7 +157,7 @@ tests: type: uint16 - label: "Step 7b & 7C Reads the CurrentFrequency attribute" - PICS: LVL.S.A0004 && LVL.S.A0005 + PICS: LVL.S.A0004 && LVL.S.A0005 && LVL.S.A0006 command: "readAttribute" attribute: "current frequency" response: @@ -181,7 +176,7 @@ tests: type: uint16 - label: "Reads the OnLevel attribute " - PICS: LVL.S.F01 + PICS: LVL.S.F01 && LVL.S.A0011 command: "readAttribute" attribute: "on level" response: @@ -191,7 +186,7 @@ tests: maxValue: MaxLevelValue - label: "Reads the OnLevel attribute " - PICS: " !LVL.S.F01 " + PICS: LVL.S.A0011 && !LVL.S.F01 command: "readAttribute" attribute: "on level" response: diff --git a/src/app/tests/suites/certification/Test_TC_LVL_3_1.yaml b/src/app/tests/suites/certification/Test_TC_LVL_3_1.yaml index 9ab73869aa45ea..b9748b888367d2 100644 --- a/src/app/tests/suites/certification/Test_TC_LVL_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LVL_3_1.yaml @@ -44,9 +44,9 @@ tests: constraints: type: uint8 - - label: "sends a Move to level command" + - label: "sends a MoveToLevelWithOnOff command" PICS: LVL.S.C00.Rsp - command: "MoveToLevel" + command: "MoveToLevelWithOnOff" arguments: values: - name: "level" @@ -102,14 +102,6 @@ tests: response: value: 100 - - label: "Reads On Off Transition Time attribute from DUT" - PICS: LVL.S.A0010 - command: "readAttribute" - attribute: "On Off Transition Time" - response: - constraints: - type: uint16 - - label: "sends a Move to level command" PICS: LVL.S.C00.Rsp && LVL.S.A0010 command: "MoveToLevel" @@ -144,9 +136,11 @@ tests: command: "readAttribute" attribute: "on off transition time" response: + saveAs: OnOffTransitionTimeValue constraints: type: uint16 + # Null is not supported here 0xFFFF is considerd as Null - label: "sends a Move to level command" PICS: LVL.S.C00.Rsp && LVL.S.A0010 command: "MoveToLevel" @@ -155,7 +149,7 @@ tests: - name: "level" value: 64 - name: "transitionTime" - value: 0 + value: 0xFFFF - name: "optionMask" value: 1 - name: "optionOverride" diff --git a/src/app/tests/suites/certification/Test_TC_LVL_4_1.yaml b/src/app/tests/suites/certification/Test_TC_LVL_4_1.yaml index 000381337e4c1e..2d3cba9891f4f4 100644 --- a/src/app/tests/suites/certification/Test_TC_LVL_4_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LVL_4_1.yaml @@ -37,9 +37,9 @@ tests: constraints: type: uint8 - - label: "sends a Move to level command" + - label: "sends a MoveToLevelWithOnOff command" PICS: LVL.S.C00.Rsp - command: "MoveToLevel" + command: "MoveToLevelWithOnOff" arguments: values: - name: "level" diff --git a/src/app/tests/suites/certification/Test_TC_LVL_6_1.yaml b/src/app/tests/suites/certification/Test_TC_LVL_6_1.yaml index b9e25ebcfad545..90b376f64e8c50 100644 --- a/src/app/tests/suites/certification/Test_TC_LVL_6_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LVL_6_1.yaml @@ -89,9 +89,9 @@ tests: arguments: values: - name: "optionMask" - value: 0 + value: 1 - name: "optionOverride" - value: 0 + value: 1 - label: "Physically verify that the device has stopped transitioning" cluster: "LogCommands" @@ -110,8 +110,8 @@ tests: attribute: "current level" response: constraints: - minValue: 23 - maxValue: 27 + minValue: 22 + maxValue: 28 notValue: CurrentLevelValue - label: "Sends a move up command to DUT" @@ -141,9 +141,9 @@ tests: arguments: values: - name: "optionMask" - value: 0 + value: 1 - name: "optionOverride" - value: 0 + value: 1 - label: "Physically verify that the device has stopped transitioning" cluster: "LogCommands" @@ -162,8 +162,8 @@ tests: attribute: "current level" response: constraints: - minValue: 48 - maxValue: 52 + minValue: 45 + maxValue: 55 notValue: CurrentLevelValue - label: "Reset level to 254" diff --git a/src/app/tests/suites/certification/Test_TC_MEDIAINPUT_1_4.yaml b/src/app/tests/suites/certification/Test_TC_MEDIAINPUT_1_4.yaml index a14f4bd8845f98..4ddd8516ba2a78 100644 --- a/src/app/tests/suites/certification/Test_TC_MEDIAINPUT_1_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_MEDIAINPUT_1_4.yaml @@ -60,9 +60,9 @@ tests: command: "readAttribute" attribute: "AcceptedCommandList" response: - value: [0, 1, 2, 3] constraints: type: list + contains: [0, 1, 2, 3] - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_1_7.yaml b/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_1_7.yaml index df84b4beafe19a..390b78ba468ba0 100644 --- a/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_1_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_1_7.yaml @@ -68,9 +68,9 @@ tests: command: "readAttribute" attribute: "GeneratedCommandList" response: - value: [10] constraints: type: list + contains: [10] #issue #11053 disabled steps below Global attributes missing from YAML framework - label: diff --git a/src/app/tests/suites/certification/Test_TC_MOD_1_1.yaml b/src/app/tests/suites/certification/Test_TC_MOD_1_1.yaml index bcaaea583eea12..3ef72b6c865f20 100644 --- a/src/app/tests/suites/certification/Test_TC_MOD_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_MOD_1_1.yaml @@ -56,9 +56,9 @@ tests: command: "readAttribute" attribute: "AcceptedCommandList" response: - value: [0] constraints: type: list + contains: [0] - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml index baa28ef6b658cf..53ff63b96bdd35 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_1_1.yaml @@ -39,13 +39,14 @@ tests: - label: "read the optional global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" - PICS: OO_LT + PICS: OO.S.F00 response: value: 1 constraints: type: map32 - label: "Read the global attribute: AttributeList" + PICS: OO.S.F00 command: "readAttribute" attribute: "AttributeList" response: @@ -65,14 +66,32 @@ tests: 65533, ] + - label: "Read the global attribute: AttributeList" + PICS: " !OO.S.F00 " + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 65528, 65529, 65531, 65532, 65533] + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: OO.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 64, 65, 66] + - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" - PICS: OO_LT + PICS: " !OO.S.F00 " response: - value: [0, 1, 2, 64, 65, 66] constraints: type: list + contains: [0, 1, 2] - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_OO_2_3.yaml b/src/app/tests/suites/certification/Test_TC_OO_2_3.yaml index 9abe1b5e2b0e88..00e1b44596f270 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_2_3.yaml @@ -287,8 +287,8 @@ tests: PICS: OO.S.A4001 response: constraints: - minValue: 295 - maxValue: 305 + minValue: 270 + maxValue: 320 - label: "9b:Reads OffWaitTime attribute from DUT" command: "readAttribute" @@ -382,8 +382,8 @@ tests: PICS: OO.S.A4001 response: constraints: - minValue: 295 - maxValue: 305 + minValue: 270 + maxValue: 325 - label: "10e:Reads OffWaitTime attribute from DUT" command: "readAttribute" @@ -430,8 +430,8 @@ tests: PICS: OO.S.A4002 response: constraints: - minValue: 295 - maxValue: 305 + minValue: 270 + maxValue: 320 - label: "Wait 10000ms" cluster: "DelayCommands" @@ -473,8 +473,8 @@ tests: PICS: OO.S.A4002 response: constraints: - minValue: 195 - maxValue: 205 + minValue: 180 + maxValue: 220 - label: "Wait 10000ms" cluster: "DelayCommands" @@ -563,8 +563,8 @@ tests: PICS: OO.S.A4002 response: constraints: - minValue: 295 - maxValue: 305 + minValue: 270 + maxValue: 320 - label: "Wait 30000ms" cluster: "DelayCommands" @@ -751,8 +751,8 @@ tests: PICS: PICS_SKIP_SAMPLE_APP && OO.S.A4001 response: constraints: - minValue: 295 - maxValue: 305 + minValue: 270 + maxValue: 320 # Issue 19159 OffWaitTime value mismatch: expected 300 but got 0 - label: "18b:Reads OffWaitTime attribute from DUT" @@ -815,8 +815,8 @@ tests: PICS: OO.S.A4001 response: constraints: - minValue: 195 - maxValue: 205 + minValue: 180 + maxValue: 220 - label: "19c:Reads OffWaitTime attribute from DUT" command: "readAttribute" @@ -849,8 +849,8 @@ tests: PICS: OO.S.A4002 response: constraints: - minValue: 295 - maxValue: 305 + minValue: 270 + maxValue: 320 - label: "21a:Sends OnWithTimedOff command to DUT" command: "OnWithTimedOff" @@ -884,8 +884,8 @@ tests: PICS: PICS_SKIP_SAMPLE_APP && OO.S.A4002 response: constraints: - minValue: 195 - maxValue: 205 + minValue: 180 + maxValue: 220 - label: "22a:Send On Command" PICS: OO.S.C01.Rsp @@ -956,8 +956,8 @@ tests: PICS: OO.S.A4002 response: constraints: - minValue: 295 - maxValue: 305 + minValue: 270 + maxValue: 320 - label: "Wait 40000ms" cluster: "DelayCommands" @@ -1015,8 +1015,8 @@ tests: PICS: OO.S.A4001 response: constraints: - minValue: 295 - maxValue: 305 + minValue: 270 + maxValue: 320 - label: "24b:Reads OffWaitTime attribute from DUT" command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_TGTNAV_1_9.yaml b/src/app/tests/suites/certification/Test_TC_TGTNAV_1_9.yaml index 33cfdc60a6d576..3b7467459f9b51 100644 --- a/src/app/tests/suites/certification/Test_TC_TGTNAV_1_9.yaml +++ b/src/app/tests/suites/certification/Test_TC_TGTNAV_1_9.yaml @@ -51,34 +51,34 @@ tests: command: "readAttribute" attribute: "AttributeList" response: - value: [0, 1, 65528, 65529, 65531, 65532, 65533] constraints: type: list + contains: [0, 1, 65528, 65529, 65531, 65532, 65533] - label: "Read the global attribute: AttributeList" - PICS: "!MC_TGTNAV.S.A0001" + PICS: " !MC_TGTNAV.S.A0001 " command: "readAttribute" attribute: "AttributeList" response: - value: [0, 65528, 65529, 65531, 65532, 65533] constraints: type: list + contains: [0, 65528, 65529, 65531, 65532, 65533] - label: "Read the global attribute: AcceptedCommandList" command: "readAttribute" attribute: "AcceptedCommandList" response: - value: [0] constraints: type: list + contains: [0] - label: "Read the global attribute: GeneratedCommandList" command: "readAttribute" attribute: "GeneratedCommandList" response: - value: [1] constraints: type: list + contains: [1] #issue #11053 disabled steps below Global attributes missing from YAML framework - label: diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml index 8fbcb156eb24d1..1b4a2ce115e2af 100644 --- a/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml @@ -37,9 +37,6 @@ tests: type: uint16 - label: "Read the optional global attribute constraints: FeatureMap" - PICS: - ( TSTAT_HEAT || TSTAT_COOL || TSTAT_OCC || TSTAT_SCH || TSTAT_SB || - TSTAT_AUTO ) command: "readAttribute" attribute: "FeatureMap" response: diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_2_1.yaml index 979fe2b669af25..52a27e40c3a941 100644 --- a/src/app/tests/suites/certification/Test_TC_TSTAT_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_2_1.yaml @@ -28,17 +28,34 @@ tests: - name: "nodeId" value: nodeId - - label: - "Reads constraints of mandatory attributes from DUT: LocalTemperature" + - label: "Reads mandatory attributes from DUT: LocalTemperature" command: "readAttribute" attribute: "LocalTemperature" + PICS: TSTAT.S.A0000 response: constraints: type: int16 - - label: - "Reads constraints of mandatory attributes from DUT: - AbsMinHeatSetpointLimit" + - label: "Read OutdoorTemperature attribute from the DUT" + PICS: TSTAT.S.A0001 + command: "readAttribute" + attribute: "OutdoorTemperature" + response: + constraints: + type: int16 + + - label: "Read Occupancy attribute from the DUT" + PICS: TSTAT.S.A0002 + command: "readAttribute" + attribute: "Occupancy" + response: + constraints: + type: int16 + minValue: 0 + maxValue: 1 + + - label: "Reads mandatory attributes from DUT: AbsMinHeatSetpointLimit" + PICS: TSTAT.S.A0003 command: "readAttribute" attribute: "AbsMinHeatSetpointLimit" response: @@ -47,9 +64,8 @@ tests: minValue: 700 maxValue: 3000 - - label: - "Reads constraints of mandatory attributes from DUT: - AbsMaxHeatSetpointLimit" + - label: "Reads mandatory attributes from DUT: AbsMaxHeatSetpointLimit" + PICS: TSTAT.S.A0004 command: "readAttribute" attribute: "AbsMaxHeatSetpointLimit" response: @@ -58,10 +74,8 @@ tests: minValue: 700 maxValue: 3000 - - label: - "Reads constraints of optional attributes from DUT: - AbsMinCoolSetpointLimit" - optional: true + - label: "Reads optional attributes from DUT: AbsMinCoolSetpointLimit" + PICS: TSTAT.S.A0005 command: "readAttribute" attribute: "AbsMinCoolSetpointLimit" response: @@ -70,10 +84,8 @@ tests: minValue: 1600 maxValue: 3200 - - label: - "Reads constraints of optional attributes from DUT: - AbsMaxCoolSetpointLimit" - optional: true + - label: "Reads optional attributes from DUT: AbsMaxCoolSetpointLimit" + PICS: TSTAT.S.A0006 command: "readAttribute" attribute: "AbsMaxCoolSetpointLimit" response: @@ -82,105 +94,48 @@ tests: minValue: 1600 maxValue: 3200 - #issue #18319 - - label: - "Read PICoolingDemand attribute from the DUT Verify that the DUT - responds with a uint8 value.The value has to be in the range of 0 to - 100" - verification: | - ./apps/chip-tool thermostat read pi-cooling-demand 54321 1 + - label: "Read PICoolingDemand attribute from the DUT" + PICS: TSTAT.S.A0007 + command: "readAttribute" + attribute: "PICoolingDemand" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 100 - [1651147835.214624][10638:10643] CHIP:DMG: ReportDataMessage = - [1651147835.214675][10638:10643] CHIP:DMG: { - [1651147835.214714][10638:10643] CHIP:DMG: AttributeReportIBs = - [1651147835.214772][10638:10643] CHIP:DMG: [ - [1651147835.214816][10638:10643] CHIP:DMG: AttributeReportIB = - [1651147835.214881][10638:10643] CHIP:DMG: { - [1651147835.214928][10638:10643] CHIP:DMG: AttributeStatusIB = - [1651147835.214985][10638:10643] CHIP:DMG: { - [1651147835.215039][10638:10643] CHIP:DMG: AttributePathIB = - [1651147835.215100][10638:10643] CHIP:DMG: { - [1651147835.215162][10638:10643] CHIP:DMG: Endpoint = 0x1, - [1651147835.215228][10638:10643] CHIP:DMG: Cluster = 0x201, - [1651147835.215293][10638:10643] CHIP:DMG: Attribute = 0x0000_0007, - [1651147835.215351][10638:10643] CHIP:DMG: } - [1651147835.215416][10638:10643] CHIP:DMG: - [1651147835.215469][10638:10643] CHIP:DMG: StatusIB = - [1651147835.215535][10638:10643] CHIP:DMG: { - [1651147835.215597][10638:10643] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147835.215657][10638:10643] CHIP:DMG: }, - [1651147835.215717][10638:10643] CHIP:DMG: - [1651147835.215772][10638:10643] CHIP:DMG: }, - [1651147835.215833][10638:10643] CHIP:DMG: - [1651147835.215879][10638:10643] CHIP:DMG: }, - [1651147835.215935][10638:10643] CHIP:DMG: - [1651147835.215978][10638:10643] CHIP:DMG: ], - [1651147835.216033][10638:10643] CHIP:DMG: - [1651147835.216078][10638:10643] CHIP:DMG: SuppressResponse = true, - [1651147835.216124][10638:10643] CHIP:DMG: InteractionModelRevision = 1 - [1651147835.216167][10638:10643] CHIP:DMG: } - [1651147835.216348][10638:10643] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "Read PIHeatingDemand attribute from the DUT" + PICS: TSTAT.S.A0008 + command: "readAttribute" + attribute: "PIHeatingDemand" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 100 - - label: - "Read PIHeatingDemand attribute from the DUT and Verify that the DUT - responds with a uint8 value.The value has to be in the range of 0 to - 100" - verification: | - ./apps/chip-tool thermostat read pi-heating-demand 54321 1 + - label: "Read HVACSystemTypeConfiguration attribute from the DUT" + PICS: TSTAT.S.A0009 + command: "readAttribute" + attribute: "HVACSystemTypeConfiguration" + response: + constraints: + type: map8 + minValue: 0 + maxValue: 63 - [1651147869.659064][10648:10653] CHIP:DMG: ReportDataMessage = - [1651147869.659093][10648:10653] CHIP:DMG: { - [1651147869.659116][10648:10653] CHIP:DMG: AttributeReportIBs = - [1651147869.659149][10648:10653] CHIP:DMG: [ - [1651147869.659174][10648:10653] CHIP:DMG: AttributeReportIB = - [1651147869.659215][10648:10653] CHIP:DMG: { - [1651147869.659244][10648:10653] CHIP:DMG: AttributeStatusIB = - [1651147869.659277][10648:10653] CHIP:DMG: { - [1651147869.659308][10648:10653] CHIP:DMG: AttributePathIB = - [1651147869.659373][10648:10653] CHIP:DMG: { - [1651147869.659411][10648:10653] CHIP:DMG: Endpoint = 0x1, - [1651147869.659469][10648:10653] CHIP:DMG: Cluster = 0x201, - [1651147869.659511][10648:10653] CHIP:DMG: Attribute = 0x0000_0008, - [1651147869.659567][10648:10653] CHIP:DMG: } - [1651147869.659629][10648:10653] CHIP:DMG: - [1651147869.659688][10648:10653] CHIP:DMG: StatusIB = - [1651147869.659729][10648:10653] CHIP:DMG: { - [1651147869.659794][10648:10653] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147869.659852][10648:10653] CHIP:DMG: }, - [1651147869.659916][10648:10653] CHIP:DMG: - [1651147869.659948][10648:10653] CHIP:DMG: }, - [1651147869.660004][10648:10653] CHIP:DMG: - [1651147869.660062][10648:10653] CHIP:DMG: }, - [1651147869.660098][10648:10653] CHIP:DMG: - [1651147869.660123][10648:10653] CHIP:DMG: ], - [1651147869.660178][10648:10653] CHIP:DMG: - [1651147869.660230][10648:10653] CHIP:DMG: SuppressResponse = true, - [1651147869.660277][10648:10653] CHIP:DMG: InteractionModelRevision = 1 - [1651147869.660304][10648:10653] CHIP:DMG: } - [1651147869.660459][10648:10653] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "Read LocalTemperatureCalibration attribute from the DUT" + PICS: TSTAT.S.A0010 + command: "readAttribute" + attribute: "LocalTemperatureCalibration" + response: + constraints: + type: int8 + minValue: 25 + maxValue: -25 - - label: - "Reads constraints of optional attributes from DUT: - OccupiedCoolingSetpoint" - optional: true + - label: "Reads optional attributes from DUT: OccupiedCoolingSetpoint" + PICS: TSTAT.S.A0011 command: "readAttribute" attribute: "OccupiedCoolingSetpoint" response: @@ -189,9 +144,8 @@ tests: minValue: 1600 maxValue: 2600 - - label: - "Reads constraints of mandatory attributes from DUT: - OccupiedHeatingSetpoint" + - label: "Reads mandatory attributes from DUT: OccupiedHeatingSetpoint" + PICS: TSTAT.S.A0012 command: "readAttribute" attribute: "OccupiedHeatingSetpoint" response: @@ -200,108 +154,32 @@ tests: minValue: 700 maxValue: 2600 - - label: - "Read UnoccupiedCoolingSetpoint attribute from the DUT and Verify that - the DUT responds with an int16 value" - verification: | - ./apps/chip-tool thermostat read unoccupied-cooling-setpoint 54321 1 - [1651148145.862809][10702:10707] CHIP:DMG: ReportDataMessage = - [1651148145.862848][10702:10707] CHIP:DMG: { - [1651148145.862880][10702:10707] CHIP:DMG: AttributeReportIBs = - [1651148145.862930][10702:10707] CHIP:DMG: [ - [1651148145.862966][10702:10707] CHIP:DMG: AttributeReportIB = - [1651148145.863018][10702:10707] CHIP:DMG: { - [1651148145.863057][10702:10707] CHIP:DMG: AttributeStatusIB = - [1651148145.863109][10702:10707] CHIP:DMG: { - [1651148145.863156][10702:10707] CHIP:DMG: AttributePathIB = - [1651148145.863205][10702:10707] CHIP:DMG: { - [1651148145.863250][10702:10707] CHIP:DMG: Endpoint = 0x1, - [1651148145.863307][10702:10707] CHIP:DMG: Cluster = 0x201, - [1651148145.863360][10702:10707] CHIP:DMG: Attribute = 0x0000_0013, - [1651148145.863408][10702:10707] CHIP:DMG: } - [1651148145.863466][10702:10707] CHIP:DMG: - [1651148145.863513][10702:10707] CHIP:DMG: StatusIB = - [1651148145.863562][10702:10707] CHIP:DMG: { - [1651148145.863609][10702:10707] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651148145.863658][10702:10707] CHIP:DMG: }, - [1651148145.863707][10702:10707] CHIP:DMG: - [1651148145.863750][10702:10707] CHIP:DMG: }, - [1651148145.863799][10702:10707] CHIP:DMG: - [1651148145.863836][10702:10707] CHIP:DMG: }, - [1651148145.863883][10702:10707] CHIP:DMG: - [1651148145.863920][10702:10707] CHIP:DMG: ], - [1651148145.863965][10702:10707] CHIP:DMG: - [1651148145.864000][10702:10707] CHIP:DMG: SuppressResponse = true, - [1651148145.864037][10702:10707] CHIP:DMG: InteractionModelRevision = 1 - [1651148145.864072][10702:10707] CHIP:DMG: } - [1651148145.864219][10702:10707] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "Read UnoccupiedCoolingSetpoint attribute from the DUT" + PICS: TSTAT.S.A0013 + command: "readAttribute" + attribute: "UnoccupiedCoolingSetpoint" + response: + constraints: + type: int16 - - label: - "Read UnoccupiedHeatingSetpoint attribute from the DUT and Verify that - the DUT responds with an int16 value" - verification: | - ./apps/chip-tool thermostat read occupied-heating-setpoint 54321 1 - [1651148114.140452][10694:10699] CHIP:DMG: ReportDataMessage = - [1651148114.140501][10694:10699] CHIP:DMG: { - [1651148114.140541][10694:10699] CHIP:DMG: AttributeReportIBs = - [1651148114.140597][10694:10699] CHIP:DMG: [ - [1651148114.140643][10694:10699] CHIP:DMG: AttributeReportIB = - [1651148114.140798][10694:10699] CHIP:DMG: { - [1651148114.140855][10694:10699] CHIP:DMG: AttributeDataIB = - [1651148114.140914][10694:10699] CHIP:DMG: { - [1651148114.141054][10694:10699] CHIP:DMG: DataVersion = 0xeb3241b, - [1651148114.141118][10694:10699] CHIP:DMG: AttributePathIB = - [1651148114.141179][10694:10699] CHIP:DMG: { - [1651148114.141285][10694:10699] CHIP:DMG: Endpoint = 0x1, - [1651148114.141396][10694:10699] CHIP:DMG: Cluster = 0x201, - [1651148114.141474][10694:10699] CHIP:DMG: Attribute = 0x0000_0012, - [1651148114.141667][10694:10699] CHIP:DMG: } - [1651148114.141780][10694:10699] CHIP:DMG: - [1651148114.141945][10694:10699] CHIP:DMG: Data = 2000, - [1651148114.142024][10694:10699] CHIP:DMG: }, - [1651148114.142136][10694:10699] CHIP:DMG: - [1651148114.142195][10694:10699] CHIP:DMG: }, - [1651148114.142263][10694:10699] CHIP:DMG: - [1651148114.142399][10694:10699] CHIP:DMG: ], - [1651148114.142466][10694:10699] CHIP:DMG: - [1651148114.142517][10694:10699] CHIP:DMG: SuppressResponse = true, - [1651148114.142569][10694:10699] CHIP:DMG: InteractionModelRevision = 1 - [1651148114.142698][10694:10699] CHIP:DMG: } - [1651148114.143048][10694:10699] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_0012 DataVersion: 246621211 - [1651148114.143195][10694:10699] CHIP:TOO: occupied heating setpoint: 2000 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "Read UnoccupiedHeatingSetpoint attribute from the DUT" + PICS: TSTAT.S.A0014 + command: "readAttribute" + attribute: "UnoccupiedHeatingSetpoint" + response: + constraints: + type: int16 - - label: - "Reads constraints of mandatory attributes from DUT: - MinHeatSetpointLimit" + - label: "Reads mandatory attributes from DUT: MinHeatSetpointLimit" + PICS: TSTAT.S.A0015 command: "readAttribute" attribute: "MinHeatSetpointLimit" response: constraints: type: int16 - minValue: 700 - maxValue: 3000 - - label: - "Reads constraints of mandatory attributes from DUT: - MaxHeatSetpointLimit" + - label: "Reads mandatory attributes from DUT: MaxHeatSetpointLimit" + PICS: TSTAT.S.A0016 command: "readAttribute" attribute: "MaxHeatSetpointLimit" response: @@ -310,10 +188,8 @@ tests: minValue: 700 maxValue: 3000 - - label: - "Reads constraints of optional attributes from DUT: - MinCoolSetpointLimit" - optional: true + - label: "Reads optional attributes from DUT: MinCoolSetpointLimit" + PICS: TSTAT.S.A0017 command: "readAttribute" attribute: "MinCoolSetpointLimit" response: @@ -322,10 +198,8 @@ tests: minValue: 1600 maxValue: 3200 - - label: - "Reads constraints of optional attributes from DUT: - MaxCoolSetpointLimit" - optional: true + - label: "Reads optional attributes from DUT: MaxCoolSetpointLimit" + PICS: TSTAT.S.A0018 command: "readAttribute" attribute: "MaxCoolSetpointLimit" response: @@ -334,9 +208,28 @@ tests: minValue: 1600 maxValue: 3200 - - label: - "Reads constraints of mandatory attributes from DUT: - ControlSequenceOfOperation" + - label: "Reads optional attributes from DUT: MinSetpointDeadBand" + PICS: TSTAT.S.A0019 + command: "readAttribute" + attribute: "MinSetpointDeadBand" + response: + constraints: + type: int8 + minValue: 0 + maxValue: 25 + + - label: "Read RemoteSensing attribute from the DUT" + PICS: TSTAT.S.A001a + command: "readAttribute" + attribute: "RemoteSensing" + response: + constraints: + type: map8 + minValue: 0 + maxValue: 7 + + - label: "Reads mandatory attributes from DUT: ControlSequenceOfOperation" + PICS: TSTAT.S.A001b command: "readAttribute" attribute: "ControlSequenceOfOperation" response: @@ -345,7 +238,8 @@ tests: minValue: 0 maxValue: 5 - - label: "Reads constraints of mandatory attributes from DUT: SystemMode" + - label: "Reads mandatory attributes from DUT: SystemMode" + PICS: TSTAT.S.A001c command: "readAttribute" attribute: "SystemMode" response: @@ -355,11 +249,11 @@ tests: maxValue: 9 - label: - "Read OutdoorTemperature attribute from the DUT and Verify the - datatype" + "Read AlarmMask attribute from the DUT and Verify that the DUT + responds with a map8 value.The value has to be in the range of 0x00 to + 0x07." verification: | - ./apps/chip-tool thermostat read outdoor-temperature 54321 1 - + ./apps/chip-tool thermostat read alarm-mask 54321 1 [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = [1651147597.962928][10583:10588] CHIP:DMG: { [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = @@ -372,7 +266,7 @@ tests: [1651147597.963286][10583:10588] CHIP:DMG: { [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0001, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_001D, [1651147597.963575][10583:10588] CHIP:DMG: } [1651147597.963641][10583:10588] CHIP:DMG: [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = @@ -392,7 +286,7 @@ tests: [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) cluster: "LogCommands" command: "UserPrompt" - PICS: PICS_USER_PROMPT + PICS: PICS_USER_PROMPT && TSTAT.S.A001d arguments: values: - name: "message" @@ -400,1097 +294,233 @@ tests: - name: "expectedValue" value: "y" - - label: - "Read Occupancy attribute from the DUT and Verify the datatype and - response value" - verification: | - ./apps/chip-tool thermostat read occupancy 54321 1 + - label: "Read ThermostatRunningMode attribute from the DUT" + PICS: TSTAT.S.A001e + command: "readAttribute" + attribute: "ThermostatRunningMode" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 - [1651147633.547776][10591:10596] CHIP:DMG: ReportDataMessage = - [1651147633.547816][10591:10596] CHIP:DMG: { - [1651147633.547848][10591:10596] CHIP:DMG: AttributeReportIBs = - [1651147633.547893][10591:10596] CHIP:DMG: [ - [1651147633.547929][10591:10596] CHIP:DMG: AttributeReportIB = - [1651147633.547988][10591:10596] CHIP:DMG: { - [1651147633.548028][10591:10596] CHIP:DMG: AttributeStatusIB = - [1651147633.548075][10591:10596] CHIP:DMG: { - [1651147633.548114][10591:10596] CHIP:DMG: AttributePathIB = - [1651147633.548168][10591:10596] CHIP:DMG: { - [1651147633.548222][10591:10596] CHIP:DMG: Endpoint = 0x1, - [1651147633.548278][10591:10596] CHIP:DMG: Cluster = 0x201, - [1651147633.548330][10591:10596] CHIP:DMG: Attribute = 0x0000_0002, - [1651147633.548383][10591:10596] CHIP:DMG: } - [1651147633.548446][10591:10596] CHIP:DMG: - [1651147633.548491][10591:10596] CHIP:DMG: StatusIB = - [1651147633.548538][10591:10596] CHIP:DMG: { - [1651147633.548585][10591:10596] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147633.548633][10591:10596] CHIP:DMG: }, - [1651147633.548679][10591:10596] CHIP:DMG: - [1651147633.548722][10591:10596] CHIP:DMG: }, - [1651147633.548773][10591:10596] CHIP:DMG: - [1651147633.548813][10591:10596] CHIP:DMG: }, - [1651147633.548860][10591:10596] CHIP:DMG: - [1651147633.548898][10591:10596] CHIP:DMG: ], - [1651147633.548942][10591:10596] CHIP:DMG: - [1651147633.548978][10591:10596] CHIP:DMG: SuppressResponse = true, - [1651147633.549016][10591:10596] CHIP:DMG: InteractionModelRevision = 1 - [1651147633.549050][10591:10596] CHIP:DMG: } - [1651147633.549200][10591:10596] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "Reads constraints of optional attributes from DUT: StartOfWeek" + PICS: TSTAT.S.A0020 + command: "readAttribute" + attribute: "StartOfWeek" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 6 - - label: - "Read HVACSystemTypeConfiguration attribute from the DUT and Verify - that the DUT responds with a map8 value. The value has to be in the - range of 0x00 to 0x3f" - verification: | - ./apps/chip-tool thermostat read hvac-system-type-configuration 54321 1 + - label: "Reads optional attributes from DUT: NumberOfWeeklyTransitions" + PICS: TSTAT.S.A0021 + command: "readAttribute" + attribute: "NumberOfWeeklyTransitions" + response: + constraints: + type: uint8 - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0009, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "Reads optional attributes from DUT: NumberOfDailyTransitions" + PICS: TSTAT.S.A0022 + command: "readAttribute" + attribute: "NumberOfDailyTransitions" + response: + constraints: + type: uint8 - - label: - "Read LocalTemperatureCalibration attribute from the DUT and Verify - that the DUT responds with an int8 value.The value has to be in the - range of -25 to 25" - verification: | - ./apps/chip-tool thermostat read local-temperature-calibration 54321 1 + - label: "Read TemperatureSetpointHold attribute from the DUT" + PICS: TSTAT.S.A0023 + command: "readAttribute" + attribute: "TemperatureSetpointHold" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 1 - [1651147993.335400][10670:10675] CHIP:DMG: ReportDataMessage = - [1651147993.335427][10670:10675] CHIP:DMG: { - [1651147993.335448][10670:10675] CHIP:DMG: AttributeReportIBs = - [1651147993.335480][10670:10675] CHIP:DMG: [ - [1651147993.335504][10670:10675] CHIP:DMG: AttributeReportIB = - [1651147993.335539][10670:10675] CHIP:DMG: { - [1651147993.335567][10670:10675] CHIP:DMG: AttributeStatusIB = - [1651147993.335599][10670:10675] CHIP:DMG: { - [1651147993.335626][10670:10675] CHIP:DMG: AttributePathIB = - [1651147993.335659][10670:10675] CHIP:DMG: { - [1651147993.335695][10670:10675] CHIP:DMG: Endpoint = 0x1, - [1651147993.335727][10670:10675] CHIP:DMG: Cluster = 0x201, - [1651147993.335763][10670:10675] CHIP:DMG: Attribute = 0x0000_0010, - [1651147993.335797][10670:10675] CHIP:DMG: } - [1651147993.335833][10670:10675] CHIP:DMG: - [1651147993.335868][10670:10675] CHIP:DMG: StatusIB = - [1651147993.335902][10670:10675] CHIP:DMG: { - [1651147993.335933][10670:10675] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147993.335968][10670:10675] CHIP:DMG: }, - [1651147993.336002][10670:10675] CHIP:DMG: - [1651147993.336029][10670:10675] CHIP:DMG: }, - [1651147993.336063][10670:10675] CHIP:DMG: - [1651147993.336089][10670:10675] CHIP:DMG: }, - [1651147993.336122][10670:10675] CHIP:DMG: - [1651147993.336143][10670:10675] CHIP:DMG: ], - [1651147993.336174][10670:10675] CHIP:DMG: - [1651147993.336198][10670:10675] CHIP:DMG: SuppressResponse = true, - [1651147993.336224][10670:10675] CHIP:DMG: InteractionModelRevision = 1 - [1651147993.336245][10670:10675] CHIP:DMG: } - [1651147993.336348][10670:10675] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "Read TemperatureSetpointHoldDuration attribute from the DUT" + PICS: TSTAT.S.A0024 + command: "readAttribute" + attribute: "TemperatureSetpointHoldDuration" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 1440 - - label: - "Reads constraints of optional attributes from DUT: - MinSetpointDeadBand" - optional: true + - label: "Read ThermostatProgrammingOperationMode attribute from the DUT" + PICS: TSTAT.S.A0025 command: "readAttribute" - attribute: "MinSetpointDeadBand" + attribute: "ThermostatProgrammingOperationMode" response: constraints: - type: int8 + type: map8 minValue: 0 - maxValue: 25 + maxValue: 7 - - label: - "Read RemoteSensing attribute from the DUT and Verify that the DUT - responds with a map8 value. The value has to be in the range of 0x00 - to 0x07" - verification: | - ./apps/chip-tool thermostat read remote-sensing 54321 1 + - label: "Read ThermostatRunningState attribute from the DUT" + PICS: TSTAT.S.A0029 + command: "readAttribute" + attribute: "ThermostatRunningState" + response: + constraints: + type: map16 + minValue: 0 + maxValue: 127 - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_001A, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "Read SetpointChangeSource attribute from the DUT" + PICS: TSTAT.S.A0030 + command: "readAttribute" + attribute: "SetpointChangeSource" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 - - label: - "Read AlarmMask attribute from the DUT and Verify that the DUT - responds with a map8 value.The value has to be in the range of 0x00 to - 0x07." - verification: | - ./apps/chip-tool thermostat read alarm-mask 54321 1 + - label: "Read SetpointChangeAmount attribute from the DUT" + PICS: TSTAT.S.A0031 + command: "readAttribute" + attribute: "SetpointChangeAmount" + response: + constraints: + type: int16 - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_001D, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "Read SetpointChangeSourceTimestamp attribute from the DUT" + PICS: TSTAT.S.A0032 + command: "readAttribute" + attribute: "SetpointChangeSourceTimestamp" + response: + constraints: + type: utc - - label: - "Read ThermostatRunningMode attribute from the DUT and Verify that the - DUT responds with an enum8 value.The value has to be 0, 3 or 4" - verification: | - ./apps/chip-tool thermostat read thermostat-running-mode 54321 1 + - label: "Read OccupiedSetback attribute from the DUT" + PICS: TSTAT.S.A0034 + command: "readAttribute" + attribute: "OccupiedSetback" + response: + constraints: + type: uint8 - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_001E, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "Read OccupiedSetbackMin attribute from the DUT" + PICS: TSTAT.S.A0035 + command: "readAttribute" + attribute: "OccupiedSetbackMin" + response: + constraints: + type: uint8 - - label: "Reads constraints of optional attributes from DUT: StartOfWeek" - optional: true + - label: "Read OccupiedSetbackMax attribute from the DUT" + PICS: TSTAT.S.A0036 command: "readAttribute" - attribute: "StartOfWeek" + attribute: "OccupiedSetbackMax" response: constraints: - type: enum8 - minValue: 0 - maxValue: 6 + type: uint8 - - label: - "Reads constraints of optional attributes from DUT: - NumberOfWeeklyTransitions" - optional: true + - label: "Read UnoccupiedSetback attribute from the DUT" + PICS: TSTAT.S.A0037 command: "readAttribute" - attribute: "NumberOfWeeklyTransitions" + attribute: "UnoccupiedSetback" response: constraints: type: uint8 - - label: - "Reads constraints of optional attributes from DUT: - NumberOfDailyTransitions" - optional: true + - label: "Read UnoccupiedSetbackMin attribute from the DUT" + PICS: TSTAT.S.A0038 command: "readAttribute" - attribute: "NumberOfDailyTransitions" + attribute: "UnoccupiedSetbackMin" response: constraints: type: uint8 - - label: - "Read TemperatureSetpointHold attribute from the DUT and Verify that - the DUT responds with an enum8 value.The value has to 0 or 1" - verification: | - ./apps/chip-tool thermostat read temperature-setpoint-hold 54321 1 + - label: "Read UnoccupiedSetbackMax attribute from the DUT" + PICS: TSTAT.S.A0039 + command: "readAttribute" + attribute: "UnoccupiedSetbackMax" + response: + constraints: + type: uint8 - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0023, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "Read EmergencyHeatDelta attribute from the DUT" + PICS: TSTAT.S.A003a + command: "readAttribute" + attribute: "EmergencyHeatDelta" + response: + constraints: + type: uint8 - - label: - "Read TemperatureSetpointHoldDuration attribute from the DUT and - Verify that the DUT responds with a uint16 value or NULL.The value has - to be in the range of 0 to 1440" - verification: | - ./apps/chip-tool thermostat read temperature-setpoint-hold-duration 54321 1 + - label: "Read ACType attribute from the DUT" + PICS: TSTAT.S.A0040 + command: "readAttribute" + attribute: "ACType" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0024, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "Read ACCapacity attribute from the DUT" + PICS: TSTAT.S.A0041 + command: "readAttribute" + attribute: "ACCapacity" + response: + constraints: + type: uint16 - - label: - "Read ThermostatProgrammingOperationMode attribute from the DUT and - Verify that the DUT responds with a map8 value.The value has to be in - the range of 0x00 to 0x07" - verification: | - ./apps/chip-tool thermostat read thermostat-programming-operation-mode 54321 1 + - label: "Read ACRefrigerantType attribute from the DUT" + PICS: TSTAT.S.A0042 + command: "readAttribute" + attribute: "ACRefrigerantType" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 3 - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0025, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "Read ACCompressorType attribute from the DUT" + PICS: TSTAT.S.A0043 + command: "readAttribute" + attribute: "ACCompressorType" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 3 - - label: - "Read ThermostatRunningState attribute from the DUT and Verify that - the DUT responds with a map16 value.The value has to be in the range - of 0x00 to 0x7F" - verification: | - ./apps/chip-tool thermostat read thermostat-running-mode 54321 1 + - label: "Read ACErrorCode attribute from the DUT" + PICS: TSTAT.S.A0044 + command: "readAttribute" + attribute: "ACErrorCode" + response: + constraints: + type: map32 - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_001E, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read SetpointChangeSource attribute from the DUT and Verify that the - DUT responds with an enum8 value. The value has to be in the range of - 0 to 2" - verification: | - ./apps/chip-tool thermostat read setpoint-change-source 54321 1 - - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0030, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read SetpointChangeAmount attribute from the DUT and Verify that the - DUT responds with an int16 value or NULL" - verification: | - ./apps/chip-tool thermostat read setpoint-change-amount 54321 1 - - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0031, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read SetpointChangeSourceTimestamp attribute from the DUT and Verify - that the DUT responds with a utc value" - verification: | - ./apps/chip-tool thermostat read setpoint-change-source-timestamp 54321 1 - - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0001, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read OccupiedSetback attribute from the DUT and Verify that the DUT - responds with a uint8 value or NULL" - verification: | - Attribute Not implemented in the SDK - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read OccupiedSetbackMin attribute from the DUT and Verify that the - DUT responds with a uint8 value or NULL" - verification: | - Attribute Not implemented in the SDK - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read OccupiedSetbackMax attribute from the DUT and Verify that the - DUT responds with a uint8 value or NULL" - verification: | - Attribute Not implemented in the SDK - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read UnoccupiedSetback attribute from the DUT and Verify that the DUT - responds with a uint8 value or NULL" - verification: | - Attribute Not implemented in the SDK - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read UnoccupiedSetbackMin attribute from the DUT and Verify that the - DUT responds with a uint8 value or NULL" - verification: | - Attribute Not implemented in the SDK - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read UnoccupiedSetbackMax attribute from the DUT and Verify that the - DUT responds with a uint8 value or NULL" - verification: | - Attribute Not implemented in the SDK - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read EmergencyHeatDelta attribute from the DUT and Verify that the - DUT responds with a uint8 value or NULL" - verification: | - Attribute Not implemented in the SDK - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read ACType attribute from the DUT and Verify that the DUT responds - with an enum8 value. The value has to be in the range of 0 to 4" - verification: | - ./apps/chip-tool thermostat read ac-type 54321 1 - - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0040, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read ACCapacity attribute from the DUT and Verify that the DUT - responds with a uint16 value" - verification: | - ./apps/chip-tool thermostat read ac-capacity 54321 1 - - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0041, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read ACRefrigerantType attribute from the DUT and VVerify that the - DUT responds with an enum8 value.The value has to be in the range of 0 - to 3" - verification: | - ./apps/chip-tool thermostat read ac-refrigerant-type 54321 1 - - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0042, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read ACCompressorType attribute from the DUT and Verify that the DUT - responds with an enum8 value.The value has to be in the range of 0 to - 3" - verification: | - ./apps/chip-tool thermostat read ac-compressor 54321 1 - - Attribute Not implemented in the SDK - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read ACErrorCode attribute from the DUT and Verify that the DUT - responds with a map32 value" - verification: | - ./apps/chip-tool thermostat read ac-error-code 54321 1 - - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0044, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read ACLouverPosition attribute from the DUT and Verify that the DUT - responds with an enum8 value.The value has to be in the range of 1 to - 5" - verification: | - ./apps/chip-tool thermostat read ac-louver-position 54321 1 - - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0045, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: - "Read ACCoilTemperature attribute from the DUT and Verify that the DUT - responds with an int16 value or NULL" - verification: | - ./apps/chip-tool thermostat read ac-coil-temperature 54321 1 - - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0046, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "Read ACLouverPosition attribute from the DUT" + PICS: TSTAT.S.A0045 + command: "readAttribute" + attribute: "ACLouverPosition" + response: + constraints: + type: enum8 + minValue: 1 + maxValue: 5 - - label: - "Read ACCapacityFormat attribute from the DUT and Verify that the DUT - responds with an enum8 value.The value has to be 0." - verification: | - ./apps/chip-tool thermostat read ac-capacity-format 54321 1 + - label: "Read ACCoilTemperature attribute from the DUT" + PICS: TSTAT.S.A0046 + command: "readAttribute" + attribute: "ACCoilTemperature" + response: + constraints: + type: int16 - [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = - [1651147597.962928][10583:10588] CHIP:DMG: { - [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = - [1651147597.963014][10583:10588] CHIP:DMG: [ - [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = - [1651147597.963103][10583:10588] CHIP:DMG: { - [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = - [1651147597.963177][10583:10588] CHIP:DMG: { - [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = - [1651147597.963286][10583:10588] CHIP:DMG: { - [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, - [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, - [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0047, - [1651147597.963575][10583:10588] CHIP:DMG: } - [1651147597.963641][10583:10588] CHIP:DMG: - [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = - [1651147597.963724][10583:10588] CHIP:DMG: { - [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1651147597.963846][10583:10588] CHIP:DMG: }, - [1651147597.963892][10583:10588] CHIP:DMG: - [1651147597.963945][10583:10588] CHIP:DMG: }, - [1651147597.963991][10583:10588] CHIP:DMG: - [1651147597.964040][10583:10588] CHIP:DMG: }, - [1651147597.964092][10583:10588] CHIP:DMG: - [1651147597.964125][10583:10588] CHIP:DMG: ], - [1651147597.964180][10583:10588] CHIP:DMG: - [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, - [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 - [1651147597.964290][10583:10588] CHIP:DMG: } - [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + - label: "Read ACCapacityFormat attribute from the DUT" + PICS: TSTAT.S.A0047 + command: "readAttribute" + attribute: "ACCapacityformat" + response: + value: 0 + constraints: + type: enum8 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 752468f829e576..6dadfb58e7005e 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 @@ -31,44 +31,39 @@ tests: - label: "Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is within range" - optional: true command: "readAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: A_OCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F01 response: - value: 2600 constraints: type: int16 minValue: 1600 - maxValue: 2600 + maxValue: 3200 - label: "Writes a value back that is different but valid for OccupiedCoolingSetpoint attribute" - optional: true command: "writeAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: A_OCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F01 arguments: - value: 2250 + value: 2500 - label: "Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute" - optional: true command: "readAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: A_OCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F01 response: - value: 2250 + value: 2500 - label: "Writes OccupiedCoolingSetpoint to value below the - MinCoolSetpointLimit" - optional: true + ABSMinCoolSetpointLimit" command: "writeAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: A_OCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F01 arguments: value: 30 response: @@ -77,48 +72,50 @@ tests: - label: "Writes OccupiedCoolingSetpoint to value above the MaxCoolSetpointLimit" - optional: true command: "writeAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: A_OCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F01 arguments: value: 4000 response: error: CONSTRAINT_ERROR - # Disabled: This test makes no sense: It's setting OccupiedCoolingSetpoint - # to below OccupiedHeatingSetpoint. - # See https://github.com/CHIP-Specifications/chip-test-plans/issues/1379 - label: "Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint attribute" - disabled: true - optional: true command: "writeAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: A_OCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F01 && !TSTAT.S.F05 arguments: value: 1600 + - label: + "Writes the CoolingSetpoint below the HeatingSetpoint when auto is + enabled" + command: "writeAttribute" + attribute: "OccupiedCoolingSetpoint" + PICS: TSTAT.S.F05 + arguments: + value: 1600 + response: + error: CONSTRAINT_ERROR + - label: "Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint attribute" - optional: true command: "writeAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: A_OCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F01 arguments: - value: 2600 + value: 3200 - label: "Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is within range" - optional: true command: "readAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: A_OCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F00 response: - value: 2000 constraints: type: int16 minValue: 700 @@ -127,30 +124,27 @@ tests: - label: "Writes a value back that is different but valid for OccupiedHeatingSetpoint attribute" - optional: true command: "writeAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: A_OCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F00 arguments: value: 2100 - label: "Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute" - optional: true command: "readAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: A_OCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F00 response: value: 2100 - label: "Writes OccupiedHeatingSetpoint to value below the MinHeatSetpointLimit" - optional: true command: "writeAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: A_OCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F00 arguments: value: 600 response: @@ -159,10 +153,9 @@ tests: - label: "Writes OccupiedHeatingSetpoint to value above the MaxHeatSetpointLimit" - optional: true command: "writeAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: A_OCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F00 arguments: value: 4010 response: @@ -171,34 +164,47 @@ tests: - label: "Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint attribute" - optional: true command: "writeAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: A_OCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F00 arguments: value: 700 - # Disabled: This test makes no sense: It's setting OccupiedHeatingSetpoint - # to above OccupiedCoolingSetpoint. - # See https://github.com/CHIP-Specifications/chip-test-plans/issues/1379 + - label: + "Reads it back again to confirm the successful write of + OccupiedHeatingSetpoint attribute" + command: "readAttribute" + attribute: "OccupiedHeatingSetpoint" + PICS: TSTAT.S.F00 + response: + value: 700 + + - label: + "Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint + attribute" + command: "writeAttribute" + attribute: "OccupiedHeatingSetpoint" + PICS: TSTAT.S.F00 && !TSTAT.S.F05 + arguments: + value: 3000 + - label: "Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint attribute" - disabled: true - optional: true command: "writeAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: A_OCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F05 arguments: value: 3000 + response: + error: CONSTRAINT_ERROR - label: "Reads UnoccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is within range" - optional: true command: "readAttribute" attribute: "UnoccupiedCoolingSetpoint" - PICS: A_UNOCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F02 && TSTAT.S.F01 response: value: 2600 constraints: @@ -209,30 +215,27 @@ tests: - label: "Writes a value back that is different but valid for UnoccupiedCoolingSetpoint attribute" - optional: true command: "writeAttribute" attribute: "UnoccupiedCoolingSetpoint" - PICS: A_UNOCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F02 && TSTAT.S.F01 arguments: value: 2500 - label: "Reads it back again to confirm the successful write of UnoccupiedCoolingSetpoint attribute" - optional: true command: "readAttribute" attribute: "UnoccupiedCoolingSetpoint" - PICS: A_UNOCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F02 && TSTAT.S.F01 response: value: 2500 - label: "Writes UnoccupiedCoolingSetpoint to value below the - MinHeatSetpointLimit" - optional: true + MinCoolSetpointLimit" command: "writeAttribute" attribute: "UnoccupiedCoolingSetpoint" - PICS: A_UNOCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F02 && TSTAT.S.F01 arguments: value: 1002 response: @@ -240,11 +243,10 @@ tests: - label: "Writes UnoccupiedCoolingSetpoint to value above the - MaxHeatSetpointLimit" - optional: true + MaxCoolSetpointLimit" command: "writeAttribute" attribute: "UnoccupiedCoolingSetpoint" - PICS: A_UNOCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F02 && TSTAT.S.F01 arguments: value: 4010 response: @@ -253,30 +255,27 @@ tests: - label: "Writes the limit of MinCoolSetpointLimit to UnoccupiedCoolingSetpoint attribute" - optional: true command: "writeAttribute" attribute: "UnoccupiedCoolingSetpoint" - PICS: A_UNOCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F02 && TSTAT.S.F01 arguments: value: 1800 - label: "Writes the limit of MaxCoolSetpointLimit to UnoccupiedCoolingSetpoint attribute" - optional: true command: "writeAttribute" attribute: "UnoccupiedCoolingSetpoint" - PICS: A_UNOCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F02 && TSTAT.S.F01 arguments: value: 3000 - label: "Reads UnoccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is within range" - optional: true command: "readAttribute" attribute: "UnoccupiedHeatingSetpoint" - PICS: A_UNOCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F02 && TSTAT.S.F00 response: value: 2000 constraints: @@ -287,30 +286,28 @@ tests: - label: "Writes a value back that is different but valid for UnoccupiedHeatingSetpoint attribute" - optional: true + command: "writeAttribute" attribute: "UnoccupiedHeatingSetpoint" - PICS: A_UNOCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F02 && TSTAT.S.F00 arguments: value: 2500 - label: "Reads it back again to confirm the successful write of UnoccupiedHeatingSetpoint attribute" - optional: true command: "readAttribute" attribute: "UnoccupiedHeatingSetpoint" - PICS: A_UNOCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F02 && TSTAT.S.F00 response: value: 2500 - label: "Writes UnoccupiedHeatingSetpoint to value below the MinHeatSetpointLimit" - optional: true command: "writeAttribute" attribute: "UnoccupiedHeatingSetpoint" - PICS: A_UNOCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F02 && TSTAT.S.F00 arguments: value: 500 response: @@ -319,10 +316,9 @@ tests: - label: "Writes UnoccupiedHeatingSetpoint to value above the MaxHeatSetpointLimit" - optional: true command: "writeAttribute" attribute: "UnoccupiedHeatingSetpoint" - PICS: A_UNOCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F02 && TSTAT.S.F00 arguments: value: 4010 response: @@ -331,30 +327,27 @@ tests: - label: "Writes the limit of MinHeatSetpointLimit to UnoccupiedHeatingSetpoint attribute" - optional: true command: "writeAttribute" attribute: "UnoccupiedHeatingSetpoint" - PICS: A_UNOCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F02 && TSTAT.S.F00 arguments: value: 1800 - label: "Writes the limit of MaxHeatSetpointLimit to UnoccupiedHeatingSetpoint attribute" - optional: true command: "writeAttribute" attribute: "UnoccupiedHeatingSetpoint" - PICS: A_UNOCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F02 && TSTAT.S.F00 arguments: value: 3000 - label: "Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within range" - optional: true command: "readAttribute" attribute: "MinHeatSetpointLimit" - PICS: A_MINHEATSETPOINTLIMIT + PICS: TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT response: value: 700 constraints: @@ -362,41 +355,39 @@ tests: minValue: 700 maxValue: 3000 - # Disabled: This test makes no sense: It's setting MinHeatSetpointLimit - # to above MinCoolSetpointLimit when AUTO is supported, which is not - # allowed. - # See https://github.com/CHIP-Specifications/chip-test-plans/issues/1379 - label: "Writes a value back that is different but valid for MinHeatSetpointLimit attribute" - disabled: true - optional: true command: "writeAttribute" attribute: "MinHeatSetpointLimit" - PICS: A_MINHEATSETPOINTLIMIT + PICS: TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT arguments: - value: 2000 + value: 800 - # Disabled: Because the previous set is disabled. - # See https://github.com/CHIP-Specifications/chip-test-plans/issues/1379 - label: "Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute" - disabled: true - optional: true command: "readAttribute" attribute: "MinHeatSetpointLimit" - PICS: A_MINHEATSETPOINTLIMIT + PICS: TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT response: + value: 800 + + - label: "Writes a value back that is different but violates the deadband" + command: "writeAttribute" + attribute: "MinHeatSetpointLimit" + PICS: A_MINHEATSETPOINTLIMIT && TSTAT.S.F05 + arguments: value: 2000 + response: + error: CONSTRAINT_ERROR - label: "Writes MinHeatSetpointLimit to value below the AbsMinHeatSetpointLimit " - optional: true command: "writeAttribute" attribute: "MinHeatSetpointLimit" - PICS: A_MINHEATSETPOINTLIMIT + PICS: TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT arguments: value: 650 response: @@ -405,10 +396,9 @@ tests: - label: "Writes MinHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit " - optional: true command: "writeAttribute" attribute: "MinHeatSetpointLimit" - PICS: A_MINHEATSETPOINTLIMIT + PICS: TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT arguments: value: 4050 response: @@ -417,36 +407,27 @@ tests: - label: "Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute" - optional: true command: "writeAttribute" attribute: "MinHeatSetpointLimit" - PICS: A_MINHEATSETPOINTLIMIT + PICS: TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT arguments: value: 700 - # Disabled: This test makes no sense: It's setting MinHeatSetpointLimit - # to higher than what we have various cooling limits set to. - # See https://github.com/CHIP-Specifications/chip-test-plans/issues/1379 - label: "Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute" - disabled: true - optional: true command: "writeAttribute" attribute: "MinHeatSetpointLimit" - PICS: A_MINHEATSETPOINTLIMIT + PICS: TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT && !TSTAT.S.F05 arguments: value: 3000 - # Disabled: Because the preceding write is disabled. - label: "Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within range" - disabled: true - optional: true command: "readAttribute" attribute: "MaxHeatSetpointLimit" - PICS: A_MAXHEATSETPOINTLIMIT + PICS: TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT && !TSTAT.S.F05 response: value: 3000 constraints: @@ -454,33 +435,50 @@ tests: minValue: 700 maxValue: 3000 + - label: + "Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit + attribute" + command: "writeAttribute" + attribute: "MinHeatSetpointLimit" + PICS: TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT + arguments: + value: 700 + + - label: + "Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit + attribute" + command: "writeAttribute" + attribute: "MinHeatSetpointLimit" + PICS: A_MINHEATSETPOINTLIMIT && TSTAT.S.F05 + arguments: + value: 3000 + response: + error: CONSTRAINT_ERROR + - label: "Writes a value back that is different but valid for MaxHeatSetpointLimit attribute" - optional: true command: "writeAttribute" attribute: "MaxHeatSetpointLimit" - PICS: A_MAXHEATSETPOINTLIMIT + PICS: TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT && !TSTAT.S.F05 arguments: - value: 2000 + value: 2900 - label: "Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute" - optional: true command: "readAttribute" attribute: "MaxHeatSetpointLimit" - PICS: A_MAXHEATSETPOINTLIMIT + PICS: TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT && !TSTAT.S.F05 response: - value: 2000 + value: 2900 - label: "Writes MaxHeatSetpointLimit to value below the AbsMinHeatSetpointLimit " - optional: true command: "writeAttribute" attribute: "MaxHeatSetpointLimit" - PICS: A_MAXHEATSETPOINTLIMIT + PICS: TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT arguments: value: 500 response: @@ -489,10 +487,9 @@ tests: - label: "Writes MaxHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit " - optional: true command: "writeAttribute" attribute: "MaxHeatSetpointLimit" - PICS: A_MAXHEATSETPOINTLIMIT + PICS: TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT arguments: value: 4000 response: @@ -501,34 +498,27 @@ tests: - label: "Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute" - optional: true command: "writeAttribute" attribute: "MaxHeatSetpointLimit" - PICS: A_MAXHEATSETPOINTLIMIT + PICS: TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT arguments: value: 700 - # Disabled: This test makes no sense: It's setting MaxHeatSetpointLimit to - # a value too close to MaxCoolSetpointLimit, ignoring deadband. - # See https://github.com/CHIP-Specifications/chip-test-plans/issues/1379 - label: "Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute" - disabled: true - optional: true command: "writeAttribute" attribute: "MaxHeatSetpointLimit" - PICS: A_MAXHEATSETPOINTLIMIT + PICS: TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT && !TSTAT.S.F05 arguments: value: 3000 - label: "Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within range" - optional: true command: "readAttribute" attribute: "MinCoolSetpointLimit" - PICS: A_MINCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT response: value: 1600 constraints: @@ -539,30 +529,27 @@ tests: - label: "Writes a value back that is different but valid for MinCoolSetpointLimit attribute" - optional: true command: "writeAttribute" attribute: "MinCoolSetpointLimit" - PICS: A_MINCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT arguments: value: 2000 - label: "Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute" - optional: true command: "readAttribute" attribute: "MinCoolSetpointLimit" - PICS: A_MINCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT response: value: 2000 - label: "Writes MinCoolSetpointLimit to value below the AbsMinCoolSetpointLimit " - optional: true command: "writeAttribute" attribute: "MinCoolSetpointLimit" - PICS: A_MINCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT arguments: value: 1000 response: @@ -570,10 +557,9 @@ tests: - label: "Writes MinCoolSetpointLimit to value above the MaxCoolSetpointLimit " - optional: true command: "writeAttribute" attribute: "MinCoolSetpointLimit" - PICS: A_MINCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT arguments: value: 4000 response: @@ -582,30 +568,36 @@ tests: - label: "Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute" - optional: true command: "writeAttribute" attribute: "MinCoolSetpointLimit" - PICS: A_MINCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT arguments: value: 1600 - label: "Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute" - optional: true command: "writeAttribute" attribute: "MinCoolSetpointLimit" - PICS: A_MINCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT arguments: value: 3200 + - label: + "Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit + attribute" + command: "writeAttribute" + attribute: "MinCoolSetpointLimit" + PICS: TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT + arguments: + value: 1600 + - label: "Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within range" - optional: true command: "readAttribute" attribute: "MaxCoolSetpointLimit" - PICS: A_MAXCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT response: value: 3200 constraints: @@ -613,40 +605,30 @@ tests: minValue: 1600 maxValue: 3200 - # Disabled: This test makes no sense: It's setting MaxCoolSetpointLimit to - # below what we just set MinCoolSetpointLimit to. - # See https://github.com/CHIP-Specifications/chip-test-plans/issues/1379 - label: "Writes a value back that is different but valid for MaxCoolSetpointLimit attribute" - disabled: true - optional: true command: "writeAttribute" attribute: "MaxCoolSetpointLimit" - PICS: A_MAXCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT && !TSTAT.S.F05 arguments: value: 2000 - # Disabled: Because the previous set is disabled. - # See https://github.com/CHIP-Specifications/chip-test-plans/issues/1379 - label: "Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute" - disabled: true - optional: true command: "readAttribute" attribute: "MaxCoolSetpointLimit" - PICS: A_MAXCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT && !TSTAT.S.F05 response: value: 2000 - label: "Writes MaxCoolSetpointLimit to value below the AbsMinCoolSetpointLimit " - optional: true command: "writeAttribute" attribute: "MaxCoolSetpointLimit" - PICS: A_MAXCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT arguments: value: 1000 response: @@ -654,82 +636,73 @@ tests: - label: "Writes MaxCoolSetpointLimit to value above the MaxCoolSetpointLimit " - optional: true command: "writeAttribute" attribute: "MaxCoolSetpointLimit" - PICS: A_MAXCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT arguments: value: 4000 response: error: CONSTRAINT_ERROR - # Disabled: This test makes no sense: It's setting MaxCoolSetpointLimit - # to below various heating setpoints. - # See https://github.com/CHIP-Specifications/chip-test-plans/issues/1379 - label: "Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute" - disabled: true - optional: true command: "writeAttribute" attribute: "MaxCoolSetpointLimit" - PICS: A_MAXCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT arguments: value: 1600 - label: "Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute" - optional: true command: "writeAttribute" attribute: "MaxCoolSetpointLimit" - PICS: A_MAXCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT arguments: value: 3200 - label: "Writes (sets back) default value of MinHeatSetpointLimit" - optional: true command: "writeAttribute" attribute: "MinHeatSetpointLimit" - PICS: A_MINHEATSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MINHEATSETPOINTLIMIT arguments: value: 700 - # Disabled: This test makes no sense: It's setting MaxHeatSetpointLimit to - # a value too close to MaxCoolSetpointLimit, ignoring deadband. - # See https://github.com/CHIP-Specifications/chip-test-plans/issues/1379 - label: "Writes (sets back)default value of MaxHeatSetpointLimit" - disabled: true - optional: true command: "writeAttribute" attribute: "MaxHeatSetpointLimit" - PICS: A_MINHEATSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MAXHEATSETPOINTLIMIT &&!TSTAT.S.F05 arguments: value: 3000 + - label: "Writes MaxHeatSetpointLimit That meets the deadband of 2.5C" + command: "writeAttribute" + attribute: "MaxHeatSetpointLimit" + PICS: TSTAT.S.F01 && A_MAXHEATSETPOINTLIMIT &&!TSTAT.S.F05 + arguments: + value: 2950 + - label: "Writes (sets back) default value of MinCoolSetpointLimit" - optional: true command: "writeAttribute" attribute: "MinCoolSetpointLimit" - PICS: A_MINCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT arguments: value: 1600 - label: "Writes (sets back) default value of MaxCoolSetpointLimit" - optional: true command: "writeAttribute" attribute: "MaxCoolSetpointLimit" - PICS: A_MAXCOOLSETPOINTLIMIT + PICS: TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT arguments: value: 3200 - label: "Reads MinSetpointDeadBand attribute from Server DUT and verifies that the value is within range" - optional: true command: "readAttribute" attribute: "MinSetpointDeadBand" - PICS: A_MINSETPOINTDEADBAND + PICS: TSTAT.S.F05 response: value: 25 constraints: @@ -740,56 +713,50 @@ tests: - label: "Writes a value back that is different but valid for MinSetpointDeadBand attribute" - optional: true command: "writeAttribute" attribute: "MinSetpointDeadBand" - PICS: A_MINSETPOINTDEADBAND + PICS: TSTAT.S.F05 arguments: value: 5 - label: "Reads it back again to confirm the successful write of MinSetpointDeadBand attribute" - optional: true command: "readAttribute" attribute: "MinSetpointDeadBand" - PICS: A_MINSETPOINTDEADBAND + PICS: TSTAT.S.F05 response: value: 5 - label: "Writes the value below MinSetpointDeadBand" - optional: true command: "writeAttribute" attribute: "MinSetpointDeadBand" - PICS: A_MINSETPOINTDEADBAND + PICS: TSTAT.S.F05 arguments: value: -1 response: error: CONSTRAINT_ERROR - label: "Writes the value above MinSetpointDeadBand " - optional: true command: "writeAttribute" attribute: "MinSetpointDeadBand" - PICS: A_MINSETPOINTDEADBAND + PICS: TSTAT.S.F05 arguments: value: 30 response: error: CONSTRAINT_ERROR - label: "Writes the min limit of MinSetpointDeadBand" - optional: true command: "writeAttribute" attribute: "MinSetpointDeadBand" - PICS: A_MINSETPOINTDEADBAND + PICS: TSTAT.S.F05 arguments: value: 0 - label: "Writes the max limit of MinSetpointDeadBand" - optional: true command: "writeAttribute" attribute: "MinSetpointDeadBand" - PICS: A_MINSETPOINTDEADBAND + PICS: TSTAT.S.F05 arguments: value: 25 @@ -798,7 +765,7 @@ tests: the value is valid" command: "readAttribute" attribute: "ControlSequenceOfOperation" - PICS: A_CONTROLSEQUENCEOFOPERATION + PICS: TSTAT.S.F00 || TSTAT.S.F01 response: value: 4 constraints: @@ -811,31 +778,42 @@ tests: valid value" command: "writeAttribute" attribute: "ControlSequenceOfOperation" - PICS: A_CONTROLSEQUENCEOFOPERATION + PICS: TSTAT.S.F00 || TSTAT.S.F01 arguments: value: 2 - label: "Read it back again to confirm the successful write" command: "readAttribute" attribute: "ControlSequenceOfOperation" - PICS: A_CONTROLSEQUENCEOFOPERATION + PICS: TSTAT.S.F00 || TSTAT.S.F01 response: value: 2 - # Disabled: This test can't work because our setpoint limits are all messed up. - # See https://github.com/CHIP-Specifications/chip-test-plans/issues/1379 + - label: + "Writes MaxHeatSetpointLimit attribute to default value of 2950 to + meet deadband constraint" + command: "writeAttribute" + attribute: "MaxHeatSetpointLimit" + PICS: TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT && TSTAT.S.F05 + arguments: + value: 2950 + + - label: "Sets OccupiedCoolingSetpoint to default value" + command: "writeAttribute" + attribute: "OccupiedCoolingSetpoint" + PICS: TSTAT.S.F01 + arguments: + value: 2600 + - label: "Sets OccupiedHeatingSetpoint to default value" - optional: true - disabled: true command: "writeAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: A_OCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F00 arguments: value: 2000 - #issue #18545 SetpointRaise command is failing - - label: "Sends SetpointRaise Command" - PICS: PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower + - label: "Sends SetpointRaise Command Heat Only" + PICS: TSTAT.S.F00 command: "SetpointRaiseLower" arguments: values: @@ -847,27 +825,21 @@ tests: - label: "Reads back OccupiedHeatingSetpoint to confirm the success of the write" - optional: true command: "readAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: PICS_SKIP_SAMPLE_APP && A_OCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F00 response: - value: -30 + value: 1700 - # Disabled: This test can't work because our setpoint limits are all messed up. - # See https://github.com/CHIP-Specifications/chip-test-plans/issues/1379 - label: "Sets OccupiedHeatingSetpoint to default value" - optional: true - disabled: true command: "writeAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: A_OCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F00 arguments: value: 2000 - #issue #18545 SetpointRaise command is failing - - label: "Sends SetpointRaise Command" - PICS: PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower + - label: "Sends SetpointRaise Command Heat Only" + PICS: TSTAT.S.F00 command: "SetpointRaiseLower" arguments: values: @@ -879,24 +851,14 @@ tests: - label: "Reads back OccupiedHeatingSetpoint to confirm the success of the write" - optional: true command: "readAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: PICS_SKIP_SAMPLE_APP && A_OCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F00 response: - value: 30 - - - label: "Sets OccupiedCoolingSetpoint to default value" - optional: true - command: "writeAttribute" - attribute: "OccupiedCoolingSetpoint" - PICS: A_OCCUPIEDCOOLINGSETPOINT - arguments: - value: 2600 + value: 2300 - #issue #18545 SetpointRaise command is failing - - label: "Sends SetpointRaise Command" - PICS: PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower + - label: "Sends SetpointRaise Command Cool Only" + PICS: TSTAT.S.F01 command: "SetpointRaiseLower" arguments: values: @@ -908,24 +870,21 @@ tests: - label: "Reads back OccupiedCoolingSetpoint to confirm the success of the write" - optional: true command: "readAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: PICS_SKIP_SAMPLE_APP && A_OCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F01 response: - value: -30 + value: 2300 - label: "Sets OccupiedCoolingSetpoint to default value" - optional: true command: "writeAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: A_OCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F01 arguments: value: 2600 - #issue #18545 SetpointRaise command is failing - - label: "Sends SetpointRaise Command" - PICS: PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower + - label: "Sends SetpointRaise Command Cool Only" + PICS: TSTAT.S.F01 command: "SetpointRaiseLower" arguments: values: @@ -937,35 +896,28 @@ tests: - label: "Reads back OccupiedCoolingSetpoint to confirm the success of the write" - optional: true command: "readAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: PICS_SKIP_SAMPLE_APP && A_OCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F01 response: - value: 30 + value: 2900 - label: "Sets OccupiedCoolingSetpoint to default value" - optional: true command: "writeAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: A_OCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F01 arguments: value: 2600 - # Disabled: This test can't work because our setpoint limits are all messed up. - # See https://github.com/CHIP-Specifications/chip-test-plans/issues/1379 - label: "Sets OccupiedHeatingSetpoint to default value" - disabled: true - optional: true command: "writeAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: A_OCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F00 arguments: value: 2000 - #issue #18545 SetpointRaise command is failing - - label: "Sends SetpointRaise Command" - PICS: PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower + - label: "Sends SetpointRaise Command Heat & Cool" + PICS: TSTAT.S.F00 || TSTAT.S.F01 command: "SetpointRaiseLower" arguments: values: @@ -977,45 +929,37 @@ tests: - label: "Reads back OccupiedCoolingSetpoint to confirm the success of the write" - optional: true command: "readAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: PICS_SKIP_SAMPLE_APP + PICS: TSTAT.S.F01 response: - value: -30 + value: 2300 - label: "Reads back OccupiedHeatingSetpoint to confirm the success of the write" - optional: true command: "readAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: PICS_SKIP_SAMPLE_APP && A_OCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F00 response: - value: -30 + value: 1700 - label: "Sets OccupiedCoolingSetpoint to default value" - optional: true command: "writeAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: A_OCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F01 arguments: value: 2600 - # Disabled: This test can't work because our setpoint limits are all messed up. - # See https://github.com/CHIP-Specifications/chip-test-plans/issues/1379 - label: "Sets OccupiedHeatingSetpoint to default value" - optional: true - disabled: true command: "writeAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: A_OCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F00 arguments: value: 2000 - #issue #18545 SetpointRaise command is failing - - label: "Sends SetpointRaise Command" - PICS: PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower + - label: "Sends SetpointRaise Command Heat & Cool" + PICS: TSTAT.S.F00 || TSTAT.S.F01 command: "SetpointRaiseLower" arguments: values: @@ -1027,19 +971,17 @@ tests: - label: "Reads back OccupiedCoolingSetpoint to confirm the success of the write" - optional: true command: "readAttribute" attribute: "OccupiedCoolingSetpoint" - PICS: PICS_SKIP_SAMPLE_APP && A_OCCUPIEDCOOLINGSETPOINT + PICS: TSTAT.S.F01 response: - value: 30 + value: 2900 - label: "Reads back OccupiedHeatingSetpoint to confirm the success of the write" - optional: true command: "readAttribute" attribute: "OccupiedHeatingSetpoint" - PICS: PICS_SKIP_SAMPLE_APP && A_OCCUPIEDHEATINGSETPOINT + PICS: TSTAT.S.F00 response: - value: 30 + value: 2300 diff --git a/src/app/tests/suites/certification/Test_TC_ULABEL_2_3.yaml b/src/app/tests/suites/certification/Test_TC_ULABEL_2_3.yaml index e2b32bad360cab..9321a7d0116a27 100644 --- a/src/app/tests/suites/certification/Test_TC_ULABEL_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_ULABEL_2_3.yaml @@ -44,7 +44,7 @@ tests: }, ] response: - error: FAILURE + error: CONSTRAINT_ERROR - label: "TH reads LabelList attribute of the DUT" PICS: ULABEL.S.A0000 @@ -59,4 +59,4 @@ tests: }, ] response: - error: FAILURE + error: CONSTRAINT_ERROR diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_2_2.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_2_2.yaml index 29abdb67949e91..e763489c1e2795 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_2_2.yaml @@ -46,20 +46,3 @@ tests: value: "Please enter 'y' for success" - name: "expectedValue" value: "y" - - - label: - "Reads ConfigStatus attribute from DUT, value of bit 0 must be 1b - operational" - verification: | - ./chip-tool windowcovering read config-status 1 1 - [1650882400.614314][8634:8639] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0102 Attribute 0x0000_0007 DataVersion: 366273182 - [1650882400.614428][8634:8639] CHIP:TOO: ConfigStatus: 27 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && WNCV.S.A0007 && WNCV.S.F01 && WNCV.S.F04 - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 645c7386554f85..610fcc4c7691c6 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -33,14 +33,12 @@ DGSW.S.A0002=1 DGSW.S.A0003=1 DGSW.S.A0004=1 DGSW.S.C00=1 -A_OCCUPIEDCOOLINGSETPOINT=1 -A_OCCUPIEDHEATINGSETPOINT=1 + A_MINHEATSETPOINTLIMIT=1 A_MAXHEATSETPOINTLIMIT=1 A_MINCOOLSETPOINTLIMIT=1 A_MAXCOOLSETPOINTLIMIT=1 -A_CONTROLSEQUENCEOFOPERATION=1 -CR_SetpointRaiseLower=1 + VENDOR_SUBTYPE=1 DEVTYPE_SUBTYPE=1 CRI_COMM_DISCOVERY_KEY=1 @@ -55,11 +53,20 @@ PICS_USER_PROMPT=0 PICS_SKIP_SAMPLE_APP=0 PICS_SDK_CI_ONLY=1 OO_LT=1 -A_UNOCCUPIEDCOOLINGSETPOINT=0 -A_UNOCCUPIEDHEATINGSETPOINT=0 -A_MINSETPOINTDEADBAND=1 MANUAL_FLOW_CHANGE=1 +#Thermostat Server +TSTAT.S.F00=1 +TSTAT.S.F01=1 +TSTAT.S.F02=0 +TSTAT.S.F03=0 +TSTAT.S.F04=0 +TSTAT.S.F05=1 +A_MINHEATSETPOINTLIMIT=1 +A_MAXHEATSETPOINTLIMIT=1 +A_MINCOOLSETPOINTLIMIT=1 +A_MAXCOOLSETPOINTLIMIT=1 + # WindowCovering aka WNCV WNCV.S.F00=1 WNCV.S.F02=1 @@ -112,12 +119,6 @@ WNCV.C.C01.Tx=1 WNCV.C.C05.Tx=1 WNCV.C.C08.Tx=1 A_TEMPERATURE_TOLERANCE=1 -TSTAT_OCC=1 -TSTAT_HEAT=1 -TSTAT_COOL=1 -TSTAT_SCH=1 -TSTAT_SB=1 -TSTAT_AUTO=1 # Color Control Cluster CC.S.A0000=1 @@ -792,6 +793,7 @@ OO.C.C02.Tx=1 OO.C.C40.Tx=1 OO.C.C41.Tx=1 OO.C.C42.Tx=1 +OO.S.F00=1 #Actions Cluster ACT.S.A0000=1 @@ -1052,7 +1054,7 @@ DRLK.S.C0C.Rsp=1 DRLK.S.C0D.Rsp=1 DRLK.S.C0E.Rsp=1 DRLK.S.C0F.Rsp=1 -DRLK.S.C10.Rsp=1 +DRLK.S.C10.Rsp=0 DRLK.S.C11.Rsp=1 DRLK.S.C12.Rsp=1 DRLK.S.C13.Rsp=1 @@ -1294,4 +1296,62 @@ OPCREDS.C.C07.Tx=1 OPCREDS.C.C08.Rsp=1 OPCREDS.C.C09.Tx=1 OPCREDS.C.C0a.Tx=1 -OPCREDS.C.C0b.Tx=1 \ No newline at end of file +OPCREDS.C.C0b.Tx=1 + +#Thermostat +TSTAT.S.A0000=1 +TSTAT.S.A0001=0 +TSTAT.S.A0002=0 +TSTAT.S.A0003=1 +TSTAT.S.A0004=1 +TSTAT.S.A0005=1 +TSTAT.S.A0006=1 +TSTAT.S.A0007=0 +TSTAT.S.A0008=0 +TSTAT.S.A0009=0 +TSTAT.S.A0010=0 +TSTAT.S.A0011=1 +TSTAT.S.A0012=1 +TSTAT.S.A0013=0 +TSTAT.S.A0014=0 +TSTAT.S.A0015=1 +TSTAT.S.A0016=1 +TSTAT.S.A0017=1 +TSTAT.S.A0018=1 +TSTAT.S.A0019=1 +TSTAT.S.A001a=0 +TSTAT.S.A001b=1 +TSTAT.S.A001c=1 +TSTAT.S.A001d=0 +TSTAT.S.A001e=0 +TSTAT.S.A0020=0 +TSTAT.S.A0021=0 +TSTAT.S.A0022=0 +TSTAT.S.A0023=0 +TSTAT.S.A0024=0 +TSTAT.S.A0025=0 +TSTAT.S.A0029=0 +TSTAT.S.A0030=0 +TSTAT.S.A0031=0 +TSTAT.S.A0032=0 +TSTAT.S.A0034=0 +TSTAT.S.A0035=0 +TSTAT.S.A0036=0 +TSTAT.S.A0037=0 +TSTAT.S.A0038=0 +TSTAT.S.A0039=0 +TSTAT.S.A003a=0 +TSTAT.S.A0040=0 +TSTAT.S.A0041=0 +TSTAT.S.A0042=0 +TSTAT.S.A0043=0 +TSTAT.S.A0044=0 +TSTAT.S.A0045=0 +TSTAT.S.A0046=0 +TSTAT.S.A0047=0 +#commands +TSTAT.S.C00.Rsp=1 +TSTAT.S.C01.Rsp=1 +TSTAT.S.C02.Rsp=1 +TSTAT.S.C03.Rsp=1 +TSTAT.S.C04.Rsp=1 diff --git a/src/app/tests/suites/tests.js b/src/app/tests/suites/tests.js index c31999ac3f06e4..d9f3c3fa83cb30 100644 --- a/src/app/tests/suites/tests.js +++ b/src/app/tests/suites/tests.js @@ -90,7 +90,11 @@ function getManualTests() { "Test_TC_BDX_2_5", ]; - const bridge = ["Test_TC_BR_1", "Test_TC_BR_2", "Test_TC_BR_3"]; + const bridge = [ + "Test_TC_BR_1", + "Test_TC_BR_2", + "Test_TC_BR_3", + ]; const DeviceAttestation = [ "Test_TC_DA_1_1", @@ -142,7 +146,10 @@ function getManualTests() { "Test_TC_DLOG_3_1", ]; - const Descriptor = ["Test_TC_DESC_2_1", "Test_TC_DESC_2_2"]; + const Descriptor = [ + "Test_TC_DESC_2_1", + "Test_TC_DESC_2_2", + ]; const EthernetNetworkDiagnostics = [ "Test_TC_DGETH_1_1", @@ -163,9 +170,15 @@ function getManualTests() { "Test_TC_DGGEN_3_2", ]; - const Identify = ["Test_TC_I_3_1", "Test_TC_I_3_2"]; + const Identify = [ + "Test_TC_I_3_1", + "Test_TC_I_3_2", + ]; - const IlluminanceMeasurement = ["Test_TC_ILL_2_2", "Test_TC_ILL_3_1"]; + const IlluminanceMeasurement = [ + "Test_TC_ILL_2_2", + "Test_TC_ILL_3_1", + ]; const InteractionDataModel = [ "Test_TC_IDM_1_1", @@ -315,9 +328,15 @@ function getManualTests() { "Test_TC_DGWIFI_3_2", ]; - const WindowCovering = ["Test_TC_WNCV_6_1", "Test_TC_WNCV_7_1"]; + const WindowCovering = [ + "Test_TC_WNCV_6_1", + "Test_TC_WNCV_7_1", + ]; - const FlowMeasurement = ["Test_TC_FLW_2_2", "Test_TC_FLW_3_1"]; + const FlowMeasurement = [ + "Test_TC_FLW_2_2", + "Test_TC_FLW_3_1", + ]; const OccupancySensing = [ "Test_TC_OCC_2_2", @@ -327,11 +346,20 @@ function getManualTests() { "Test_TC_OCC_3_2", ]; - const PressureMeasurement = ["Test_TC_PRS_2_2", "Test_TC_PRS_3_1"]; + const PressureMeasurement = [ + "Test_TC_PRS_2_2", + "Test_TC_PRS_3_1", + ]; - const PowerSource = ["Test_TC_PS_2_2", "Test_TC_PS_3_1"]; + const PowerSource = [ + "Test_TC_PS_2_2", + "Test_TC_PS_3_1", + ]; - const BooleanState = ["Test_TC_BOOL_2_2", "Test_TC_BOOL_3_1"]; + const BooleanState = [ + "Test_TC_BOOL_2_2", + "Test_TC_BOOL_3_1", + ]; const ColorControl = [ "Test_TC_CC_2_2", @@ -370,9 +398,16 @@ function getManualTests() { "Test_TC_LVL_8_1", ]; - const OnOff = ["Test_TC_OO_2_3", "Test_TC_OO_3_1", "Test_TC_OO_3_2"]; + const OnOff = [ + "Test_TC_OO_2_3", + "Test_TC_OO_3_1", + "Test_TC_OO_3_2", + ]; - const RelativeHumidityMeasurement = ["Test_TC_RH_2_2", "Test_TC_RH_3_1"]; + const RelativeHumidityMeasurement = [ + "Test_TC_RH_2_2", + "Test_TC_RH_3_1", + ]; const Switch = [ "Test_TC_SWTCH_1_1", @@ -381,11 +416,19 @@ function getManualTests() { "Test_TC_SWTCH_3_2", ]; - const TemperatureMeasurement = ["Test_TC_TMP_2_2", "Test_TC_TMP_3_1"]; + const TemperatureMeasurement = [ + "Test_TC_TMP_2_2", + "Test_TC_TMP_3_1", + ]; - const Thermostat = ["Test_TC_TSTAT_3_1", "Test_TC_TSTAT_3_2"]; + const Thermostat = [ + "Test_TC_TSTAT_3_1", + "Test_TC_TSTAT_3_2", + ]; - const ThermostatUserConfiguration = ["Test_TC_TSUIC_3_1"]; + const ThermostatUserConfiguration = [ + "Test_TC_TSUIC_3_1", + ]; const ThreadNetworkDiagnostics = [ "Test_TC_DGTHREAD_1_1", @@ -439,7 +482,9 @@ function getManualTests() { "Test_TC_S_3_1", ]; - const PumpConfigurationControl = ["Test_TC_PCC_3_1"]; + const PumpConfigurationControl = [ + "Test_TC_PCC_3_1", + ]; const tests = [ DeviceDiscovery, @@ -495,11 +540,18 @@ function getManualTests() { } function getTests() { - const AccessControl = ["TestAccessControlCluster"]; + const AccessControl = [ + "TestAccessControlCluster", + ]; - const BooleanState = ["Test_TC_BOOL_1_1", "Test_TC_BOOL_2_1"]; + const BooleanState = [ + "Test_TC_BOOL_1_1", + "Test_TC_BOOL_2_1", + ]; - const Actions = ["Test_TC_ACT_1_1"]; + const Actions = [ + "Test_TC_ACT_1_1", + ]; const ColorControl = [ "Test_TC_CC_1_1", @@ -524,20 +576,33 @@ function getTests() { "Test_TC_CC_8_1", ]; - const DeviceManagement = ["Test_TC_BINFO_2_1"]; + const DeviceManagement = [ + "Test_TC_BINFO_2_1", + ]; - const Descriptor = ["Test_TC_DESC_1_1"]; + const Descriptor = [ + "Test_TC_DESC_1_1", + ]; const EthernetNetworkDiagnostics = [ "Test_TC_DGETH_2_1", "Test_TC_DGETH_2_2", ]; - const FlowMeasurement = ["Test_TC_FLW_1_1", "Test_TC_FLW_2_1"]; + const FlowMeasurement = [ + "Test_TC_FLW_1_1", + "Test_TC_FLW_2_1", + ]; - const GeneralCommissioning = ["Test_TC_CGEN_1_1", "Test_TC_CGEN_2_1"]; + const GeneralCommissioning = [ + "Test_TC_CGEN_1_1", + "Test_TC_CGEN_2_1", + ]; - const GeneralDiagnostics = ["Test_TC_DGGEN_1_1", "Test_TC_DGGEN_2_1"]; + const GeneralDiagnostics = [ + "Test_TC_DGGEN_1_1", + "Test_TC_DGGEN_2_1", + ]; const Identify = [ "Test_TC_I_1_1", @@ -546,9 +611,15 @@ function getTests() { "Test_TC_I_2_3", ]; - const IlluminanceMeasurement = ["Test_TC_ILL_1_1", "Test_TC_ILL_2_1"]; + const IlluminanceMeasurement = [ + "Test_TC_ILL_1_1", + "Test_TC_ILL_2_1", + ]; - const OccupancySensing = ["Test_TC_OCC_1_1", "Test_TC_OCC_2_1"]; + const OccupancySensing = [ + "Test_TC_OCC_1_1", + "Test_TC_OCC_2_1", + ]; const LevelControl = [ "Test_TC_LVL_1_1", @@ -607,11 +678,18 @@ function getTests() { "Test_TC_CONTENTLAUNCHER_10_1", ]; - const ModeSelect = ["Test_TC_MOD_1_1"]; + const ModeSelect = [ + "Test_TC_MOD_1_1", + ]; - const MultipleFabrics = ["Test_TC_CADMIN_1_3", "Test_TC_CADMIN_1_4"]; + const MultipleFabrics = [ + "Test_TC_CADMIN_1_3", + "Test_TC_CADMIN_1_4", + ]; - const OTASoftwareUpdate = ["OTA_SuccessfulTransfer"]; + const OTASoftwareUpdate = [ + "OTA_SuccessfulTransfer", + ]; const OnOff = [ "Test_TC_OO_1_1", @@ -620,9 +698,15 @@ function getTests() { "Test_TC_OO_2_4", ]; - const PowerSource = ["Test_TC_PS_1_1", "Test_TC_PS_2_1"]; + const PowerSource = [ + "Test_TC_PS_1_1", + "Test_TC_PS_2_1", + ]; - const PressureMeasurement = ["Test_TC_PRS_1_1", "Test_TC_PRS_2_1"]; + const PressureMeasurement = [ + "Test_TC_PRS_1_1", + "Test_TC_PRS_2_1", + ]; const PumpConfigurationControl = [ "Test_TC_PCC_1_1", @@ -632,15 +716,27 @@ function getTests() { "Test_TC_PCC_2_4", ]; - const PowerSourceConfiguration = ["Test_TC_PSCFG_1_1"]; + const PowerSourceConfiguration = [ + "Test_TC_PSCFG_1_1", + ]; - const RelativeHumidityMeasurement = ["Test_TC_RH_1_1", "Test_TC_RH_2_1"]; + const RelativeHumidityMeasurement = [ + "Test_TC_RH_1_1", + "Test_TC_RH_2_1", + ]; - const SecureChannel = ["Test_TC_SC_4_2"]; + const SecureChannel = [ + "Test_TC_SC_4_2", + ]; - const Switch = ["Test_TC_SWTCH_2_1"]; + const Switch = [ + "Test_TC_SWTCH_2_1", + ]; - const TemperatureMeasurement = ["Test_TC_TMP_1_1", "Test_TC_TMP_2_1"]; + const TemperatureMeasurement = [ + "Test_TC_TMP_1_1", + "Test_TC_TMP_2_1", + ]; const Thermostat = [ "Test_TC_TSTAT_1_1", @@ -661,7 +757,10 @@ function getTests() { "Test_TC_DGTHREAD_2_4", ]; - const WiFiNetworkDiagnostics = ["Test_TC_DGWIFI_2_1", "Test_TC_DGWIFI_2_3"]; + const WiFiNetworkDiagnostics = [ + "Test_TC_DGWIFI_2_1", + "Test_TC_DGWIFI_2_3", + ]; const WindowCovering = [ "Test_TC_WNCV_1_1", @@ -709,6 +808,7 @@ function getTests() { "TestConfigVariables", "TestDescriptorCluster", "TestBasicInformation", + "TestFabricRemovalWhileSubscribed", "TestGeneralCommissioning", "TestIdentifyCluster", "TestOperationalCredentialsCluster", @@ -722,7 +822,9 @@ function getTests() { "TestFanControl", ]; - const MultiAdmin = ["TestMultiAdmin"]; + const MultiAdmin = [ + "TestMultiAdmin", + ]; const SoftwareDiagnostics = [ "Test_TC_DGSW_2_1", @@ -730,7 +832,9 @@ function getTests() { "Test_TC_DGSW_2_3", ]; - const Subscriptions = ["TestSubscribe_OnOff"]; + const Subscriptions = [ + "TestSubscribe_OnOff", + ]; const DoorLock = [ "DL_UsersAndCredentials", diff --git a/src/app/util/MatterCallbacks.h b/src/app/util/MatterCallbacks.h index 3150f8796cafba..c18ddaed0014aa 100644 --- a/src/app/util/MatterCallbacks.h +++ b/src/app/util/MatterCallbacks.h @@ -29,11 +29,13 @@ void MatterPostAttributeWriteCallback(const chip::app::ConcreteAttributePath & a * This callback is called once the message has been determined to be a command, and * before the command is dispatched to the receiver. */ -CHIP_ERROR MatterPreCommandReceivedCallback(const chip::app::ConcreteCommandPath & commandPath); +CHIP_ERROR MatterPreCommandReceivedCallback(const chip::app::ConcreteCommandPath & commandPath, + const chip::Access::SubjectDescriptor & subjectDescriptor); /** @brief Matter Post Command Received * * This callback is called once the message has been determined to be a command, but * after it being dispatched to the receiver. */ -void MatterPostCommandReceivedCallback(const chip::app::ConcreteCommandPath & commandPath); +void MatterPostCommandReceivedCallback(const chip::app::ConcreteCommandPath & commandPath, + const chip::Access::SubjectDescriptor & subjectDescriptor); diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index 3d04681d82210f..2b65111c415c43 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -62,7 +62,6 @@ - diff --git a/src/app/zap-templates/zcl/data-model/chip/identify-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/identify-cluster.xml index f088af73d06263..8a24bd7c617811 100644 --- a/src/app/zap-templates/zcl/data-model/chip/identify-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/identify-cluster.xml @@ -50,7 +50,7 @@ limitations under the License. IDENTIFY_CLUSTER true true - + identify time identify type diff --git a/src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml index 9b63a13c31d7ef..ff0a51361f114c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml @@ -25,7 +25,7 @@ limitations under the License. ILLUMINANCE_MEASUREMENT_CLUSTER true true - + MeasuredValue MinMeasuredValue MaxMeasuredValue diff --git a/src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml index b1b874bb9f3a53..e7d4ad0ce95140 100644 --- a/src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml @@ -24,7 +24,7 @@ limitations under the License. PRESSURE_MEASUREMENT_CLUSTER true true - + MeasuredValue MinMeasuredValue MaxMeasuredValue diff --git a/src/app/zap-templates/zcl/data-model/silabs/ami.xml b/src/app/zap-templates/zcl/data-model/silabs/ami.xml deleted file mode 100644 index 0205b3f70755dc..00000000000000 --- a/src/app/zap-templates/zcl/data-model/silabs/ami.xml +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Messaging - SE - This cluster provides an interface for passing text messages between SE devices. - 0x0703 - MESSAGING_CLUSTER - true - true - - - - - - - Command description for DisplayMessage - - - - - - - - - - - The CancelMessage command provides the ability to cancel the sending or acceptance of previously sent messages. - - - - - - - The DisplayProtected Message command is for use with messages that are protected by a password or PIN. - - - - - - - - - - - The CancelAllMessages command indicates to a client device that it should cancel all display messages currently held by it. - - - - - - - Command description for GetLastMessage - - - - - The Message Confirmation command provides an indication that a Utility Customer has acknowledged and/or accepted the contents of a previously sent message. Enhanced Message Confirmation commands shall contain an answer of 'NO', 'YES' and/or a message confirmation string. - - - - - - - - - This command initiates the return of the first (and maybe only) Cancel All Messages command held on the associated server, and which has an implementation time equal to or later than the value indicated in the payload. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/silabs/ha.xml b/src/app/zap-templates/zcl/data-model/silabs/ha.xml index 2555a29c8ec10e..58fe67cbca289a 100644 --- a/src/app/zap-templates/zcl/data-model/silabs/ha.xml +++ b/src/app/zap-templates/zcl/data-model/silabs/ha.xml @@ -406,23 +406,21 @@ limitations under the License. BALLAST_CONFIGURATION_CLUSTER true true - - physical min level - physical max level - ballast status - min level - max level - power on level - power on fade time - intrinsic ballast factor - ballast factor adjustment - lamp quality - lamp type - lamp manufacturer - lamp rated hours - lamp burn hours - lamp alarm mode - lamp burn hours trip point + + PhysicalMinLevel + PhysicalMaxLevel + BallastStatus + MinLevel + MaxLevel + IntrinsicBalanceFactor + BallastFactorAdjustment + LampQuantity + LampType + LampManufacturer + LampRatedHours + LampBurnHours + LampAlarmMode + LampBurnHoursTripPoint Occupancy Sensing diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index d99dcd82e89bab..afa5947f3e742b 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -72,7 +72,6 @@ "wifi-network-diagnostics-cluster.xml", "window-covering.xml", "matter-devices.xml", - "ami.xml", "general.xml", "ha-devices.xml", "ha.xml", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index e0c451a858b09d..44abfb526e17ad 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -66,7 +66,6 @@ "wifi-network-diagnostics-cluster.xml", "window-covering.xml", "matter-devices.xml", - "ami.xml", "general.xml", "ha-devices.xml", "ha.xml", diff --git a/src/app/zap_cluster_list.py b/src/app/zap_cluster_list.py index 1adf32c657f8ef..ce89b6f150fc4e 100755 --- a/src/app/zap_cluster_list.py +++ b/src/app/zap_cluster_list.py @@ -16,6 +16,7 @@ 'APPLICATION_BASIC_CLUSTER': ['application-basic-server'], 'APPLICATION_LAUNCHER_CLUSTER': ['application-launcher-server'], 'AUDIO_OUTPUT_CLUSTER': ['audio-output-server'], + 'BALLAST_CONFIGURATION_CLUSTER': [], 'BARRIER_CONTROL_CLUSTER': ['barrier-control-server'], 'BASIC_CLUSTER': ['basic'], 'BINARY_INPUT_BASIC_CLUSTER': [], @@ -99,6 +100,7 @@ 'APPLICATION_BASIC_CLUSTER': [], 'APPLICATION_LAUNCHER_CLUSTER': [], 'AUDIO_OUTPUT_CLUSTER': [], + 'BALLAST_CONFIGURATION_CLUSTER': [], 'BARRIER_CONTROL_CLUSTER': [], 'BASIC_CLUSTER': [], 'BINARY_INPUT_BASIC_CLUSTER': [], diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 8422f5508d4bf3..8466dc5723a423 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -466,6 +466,8 @@ void DeviceCommissioner::Shutdown() ChipLogDetail(Controller, "Shutting down the commissioner"); + mSetUpCodePairer.CommissionerShuttingDown(); + // Check to see if pairing in progress before shutting down CommissioneeDeviceProxy * device = mDeviceInPASEEstablishment; if (device != nullptr && device->IsSessionSetupInProgress()) diff --git a/src/controller/CommissioningWindowOpener.cpp b/src/controller/CommissioningWindowOpener.cpp index 6b67a2efbfee29..c0761cac49e111 100644 --- a/src/controller/CommissioningWindowOpener.cpp +++ b/src/controller/CommissioningWindowOpener.cpp @@ -72,6 +72,11 @@ CHIP_ERROR CommissioningWindowOpener::OpenCommissioningWindow(NodeId deviceId, S if (setupPIN.HasValue()) { + if (!SetupPayload::IsValidSetupPIN(setupPIN.Value())) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + mCommissioningWindowOption = CommissioningWindowOption::kTokenWithProvidedPIN; mSetupPayload.setUpPINCode = setupPIN.Value(); } diff --git a/src/controller/SetUpCodePairer.cpp b/src/controller/SetUpCodePairer.cpp index 5457687e6bb2b4..98af2e86ea4ad1 100644 --- a/src/controller/SetUpCodePairer.cpp +++ b/src/controller/SetUpCodePairer.cpp @@ -308,6 +308,11 @@ void SetUpCodePairer::NotifyCommissionableDeviceDiscovered(const Dnssd::Discover ConnectToDiscoveredDevice(); } +void SetUpCodePairer::CommissionerShuttingDown() +{ + ResetDiscoveryState(); +} + bool SetUpCodePairer::TryNextRendezvousParameters() { if (ConnectToDiscoveredDevice()) diff --git a/src/controller/SetUpCodePairer.h b/src/controller/SetUpCodePairer.h index 8a47b6a69364d4..fdf54dbc10be09 100644 --- a/src/controller/SetUpCodePairer.h +++ b/src/controller/SetUpCodePairer.h @@ -72,6 +72,10 @@ class DLL_EXPORT SetUpCodePairer : public DevicePairingDelegate void SetBleLayer(Ble::BleLayer * bleLayer) { mBleLayer = bleLayer; }; #endif // CONFIG_NETWORK_LAYER_BLE + // Called to notify us that the DeviceCommissioner is shutting down and we + // should not try to do any more new work. + void CommissionerShuttingDown(); + private: // DevicePairingDelegate implementation. void OnStatusUpdate(DevicePairingDelegate::Status status) override; diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index e1fd7276fbd94c..d9665b4aaecafe 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -33,24 +33,25 @@ if (current_os == "android") { script = "${chip_root}/scripts/codegen.py" _idl_file = "controller-clusters.matter" - _output_files = exec_script("${chip_root}/scripts/codegen.py", - [ - "--generator", - "java", - "--log-level", - "fatal", - "--name-only", - rebase_path("controller-clusters.matter"), - ], - "list lines", - [ "controller-clusters.matter" ]) + _output_files = + exec_script("${chip_root}/scripts/codegen.py", + [ + "--generator", + "java", + "--log-level", + "fatal", + "--name-only", + rebase_path("controller-clusters.matter", root_build_dir), + ], + "list lines", + [ "controller-clusters.matter" ]) args = [ "--generator", "java", "--output-dir", - rebase_path(target_gen_dir), - rebase_path(_idl_file), + rebase_path(target_gen_dir, root_build_dir), + rebase_path(_idl_file, root_build_dir), ] deps = [ "${chip_root}/scripts/idl" ] diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 95eb8b0fb1c16b..7ca5b0106df4fd 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3336,6 +3336,28 @@ client cluster ColorControl = 768 { command StepColorTemperature(StepColorTemperatureRequest): DefaultSuccess = 76; } +client cluster BallastConfiguration = 769 { + readonly attribute int8u physicalMinLevel = 0; + readonly attribute int8u physicalMaxLevel = 1; + readonly attribute bitmap8 ballastStatus = 2; + attribute int8u minLevel = 16; + attribute int8u maxLevel = 17; + attribute nullable int8u intrinsicBalanceFactor = 20; + attribute nullable int8u ballastFactorAdjustment = 21; + readonly attribute int8u lampQuantity = 32; + attribute char_string<16> lampType = 48; + attribute char_string<16> lampManufacturer = 49; + attribute nullable int24u lampRatedHours = 50; + attribute nullable int24u lampBurnHours = 51; + attribute bitmap8 lampAlarmMode = 52; + attribute nullable int24u lampBurnHoursTripPoint = 53; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + client cluster IlluminanceMeasurement = 1024 { enum LightSensorType : ENUM8 { kPhotodiode = 0; @@ -4393,6 +4415,7 @@ endpoint 1 { binding cluster FanControl; binding cluster ThermostatUserInterfaceConfiguration; binding cluster ColorControl; + binding cluster BallastConfiguration; binding cluster IlluminanceMeasurement; binding cluster TemperatureMeasurement; binding cluster PressureMeasurement; diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 7e3e1f0c5080ad..6439260f235608 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -1,5 +1,5 @@ { - "featureLevel": 72, + "featureLevel": 75, "creator": "zap", "keyValuePairs": [ { @@ -19,14 +19,14 @@ { "pathRelativity": "relativeToZap", "path": "../../app/zap-templates/zcl/zcl.json", - "version": "ZCL Test Data", - "type": "zcl-properties" + "type": "zcl-properties", + "version": "ZCL Test Data" }, { "pathRelativity": "relativeToZap", "path": "../../app/zap-templates/app-templates.json", - "version": "chip-v1", - "type": "gen-templates-json" + "type": "gen-templates-json", + "version": "chip-v1" } ], "endpointTypes": [ @@ -13561,6 +13561,364 @@ } ] }, + { + "name": "Ballast Configuration", + "code": 769, + "mfgCode": null, + "define": "BALLAST_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Ballast Configuration", + "code": 769, + "mfgCode": null, + "define": "BALLAST_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "PhysicalMinLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PhysicalMaxLevel", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFE", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BallastStatus", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinLevel", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxLevel", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFE", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "IntrinsicBalanceFactor", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BallastFactorAdjustment", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFE", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LampQuantity", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LampType", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LampManufacturer", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LampRatedHours", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int24u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFFFFF", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LampBurnHours", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int24u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LampAlarmMode", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LampBurnHoursTripPoint", + "code": 53, + "mfgCode": null, + "side": "server", + "type": "int24u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFFFFF", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Illuminance Measurement", "code": 1024, diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index bcfb522f306a5c..af18e87a079d4f 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -12963,6 +12963,357 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::BallastConfiguration::Id: { + using namespace app::Clusters::BallastConfiguration; + switch (aPath.mAttributeId) + { + case Attributes::PhysicalMinLevel::Id: { + using TypeInfo = Attributes::PhysicalMinLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::PhysicalMaxLevel::Id: { + using TypeInfo = Attributes::PhysicalMaxLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::BallastStatus::Id: { + using TypeInfo = Attributes::BallastStatus::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::MinLevel::Id: { + using TypeInfo = Attributes::MinLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::MaxLevel::Id: { + using TypeInfo = Attributes::MaxLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::IntrinsicBalanceFactor::Id: { + using TypeInfo = Attributes::IntrinsicBalanceFactor::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::BallastFactorAdjustment::Id: { + using TypeInfo = Attributes::BallastFactorAdjustment::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::LampQuantity::Id: { + using TypeInfo = Attributes::LampQuantity::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::LampType::Id: { + using TypeInfo = Attributes::LampType::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + return value; + } + case Attributes::LampManufacturer::Id: { + using TypeInfo = Attributes::LampManufacturer::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + return value; + } + case Attributes::LampRatedHours::Id: { + using TypeInfo = Attributes::LampRatedHours::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::LampBurnHours::Id: { + using TypeInfo = Attributes::LampBurnHours::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::LampAlarmMode::Id: { + using TypeInfo = Attributes::LampAlarmMode::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::LampBurnHoursTripPoint::Id: { + using TypeInfo = Attributes::LampBurnHoursTripPoint::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::IlluminanceMeasurement::Id: { using namespace app::Clusters::IlluminanceMeasurement; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index 87ce0b4174277c..a4a6ec83cc7b51 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -1383,6 +1383,45 @@ typedef void (*CHIPColorControlClusterFeatureMapAttributeCallbackType)( typedef void (*CHIPColorControlClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::ColorControl::Attributes::ClusterRevision::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterPhysicalMinLevelAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::PhysicalMinLevel::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterPhysicalMaxLevelAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::PhysicalMaxLevel::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterBallastStatusAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::BallastStatus::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterMinLevelAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::MinLevel::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterMaxLevelAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::MaxLevel::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterIntrinsicBalanceFactorAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::IntrinsicBalanceFactor::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterBallastFactorAdjustmentAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::BallastFactorAdjustment::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterLampQuantityAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::LampQuantity::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterLampTypeAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::LampType::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterLampManufacturerAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::LampManufacturer::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterLampRatedHoursAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::LampRatedHours::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterLampBurnHoursAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::LampBurnHours::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterLampAlarmModeAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::LampAlarmMode::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterLampBurnHoursTripPointAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::LampBurnHoursTripPoint::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterGeneratedCommandListAttributeCallbackType)( + void *, const chip::app::Clusters::BallastConfiguration::Attributes::GeneratedCommandList::TypeInfo::DecodableType &); +typedef void (*CHIPBallastConfigurationClusterAcceptedCommandListAttributeCallbackType)( + void *, const chip::app::Clusters::BallastConfiguration::Attributes::AcceptedCommandList::TypeInfo::DecodableType &); +typedef void (*CHIPBallastConfigurationClusterAttributeListAttributeCallbackType)( + void *, const chip::app::Clusters::BallastConfiguration::Attributes::AttributeList::TypeInfo::DecodableType &); +typedef void (*CHIPBallastConfigurationClusterFeatureMapAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::FeatureMap::TypeInfo::DecodableArgType); +typedef void (*CHIPBallastConfigurationClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::BallastConfiguration::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + typedef void (*CHIPIlluminanceMeasurementClusterMeasuredValueAttributeCallbackType)( void *, chip::app::Clusters::IlluminanceMeasurement::Attributes::MeasuredValue::TypeInfo::DecodableArgType); typedef void (*CHIPIlluminanceMeasurementClusterMinMeasuredValueAttributeCallbackType)( diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index a8c3724dea95d4..4612f4b7b96bae 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -4529,6 +4529,566 @@ JNI_METHOD(void, ColorControlCluster, writeStartUpColorTemperatureMiredsAttribut onFailure.release(); } +JNI_METHOD(void, BallastConfigurationCluster, writeMinLevelAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::MinLevel::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + 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; + BallastConfigurationCluster * 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()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, BallastConfigurationCluster, writeMaxLevelAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::MaxLevel::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + 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; + BallastConfigurationCluster * 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()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, BallastConfigurationCluster, writeIntrinsicBalanceFactorAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::IntrinsicBalanceFactor::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = 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; + BallastConfigurationCluster * 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()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, BallastConfigurationCluster, writeBallastFactorAdjustmentAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::BallastFactorAdjustment::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = 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; + BallastConfigurationCluster * 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()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, BallastConfigurationCluster, writeLampTypeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::LampType::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cleanupStrings.push_back(chip::Platform::MakeUnique(env, static_cast(value))); + cppValue = cleanupStrings.back()->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; + BallastConfigurationCluster * 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()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, BallastConfigurationCluster, writeLampManufacturerAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::LampManufacturer::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cleanupStrings.push_back(chip::Platform::MakeUnique(env, static_cast(value))); + cppValue = cleanupStrings.back()->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; + BallastConfigurationCluster * 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()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, BallastConfigurationCluster, writeLampRatedHoursAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::LampRatedHours::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = 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; + BallastConfigurationCluster * 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()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, BallastConfigurationCluster, writeLampBurnHoursAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::LampBurnHours::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = 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; + BallastConfigurationCluster * 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()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, BallastConfigurationCluster, writeLampAlarmModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::LampAlarmMode::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + 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; + BallastConfigurationCluster * 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()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, BallastConfigurationCluster, writeLampBurnHoursTripPointAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::BallastConfiguration::Attributes::LampBurnHoursTripPoint::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + if (value == nullptr) + { + cppValue.SetNull(); + } + else + { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = 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; + BallastConfigurationCluster * 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()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, ContentLauncherCluster, writeSupportedStreamingProtocolsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index ba9dfaefd0fb23..de6775d3df51d3 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -2988,6 +2988,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::BallastConfiguration::Id: { + using namespace app::Clusters::BallastConfiguration; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::IlluminanceMeasurement::Id: { using namespace app::Clusters::IlluminanceMeasurement; switch (aPath.mEventId) diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 3048a83c7e358a..c9bbe64cc955f9 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -18556,6 +18556,555 @@ void CHIPColorControlAttributeListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback::CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback( + 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"); + } +} + +CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback::~CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback::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; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + 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); +} + +CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback::CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback( + 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"); + } +} + +CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback:: + ~CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback::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; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + 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); +} + +CHIPBallastConfigurationLampRatedHoursAttributeCallback::CHIPBallastConfigurationLampRatedHoursAttributeCallback( + 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"); + } +} + +CHIPBallastConfigurationLampRatedHoursAttributeCallback::~CHIPBallastConfigurationLampRatedHoursAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBallastConfigurationLampRatedHoursAttributeCallback::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/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPBallastConfigurationLampBurnHoursAttributeCallback::CHIPBallastConfigurationLampBurnHoursAttributeCallback(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"); + } +} + +CHIPBallastConfigurationLampBurnHoursAttributeCallback::~CHIPBallastConfigurationLampBurnHoursAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBallastConfigurationLampBurnHoursAttributeCallback::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/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback::CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback( + 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"); + } +} + +CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback::~CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback::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/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPBallastConfigurationGeneratedCommandListAttributeCallback::CHIPBallastConfigurationGeneratedCommandListAttributeCallback( + 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"); + } +} + +CHIPBallastConfigurationGeneratedCommandListAttributeCallback::~CHIPBallastConfigurationGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBallastConfigurationGeneratedCommandListAttributeCallback::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")); + + 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")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPBallastConfigurationAcceptedCommandListAttributeCallback::CHIPBallastConfigurationAcceptedCommandListAttributeCallback( + 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"); + } +} + +CHIPBallastConfigurationAcceptedCommandListAttributeCallback::~CHIPBallastConfigurationAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBallastConfigurationAcceptedCommandListAttributeCallback::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")); + + 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")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPBallastConfigurationAttributeListAttributeCallback::CHIPBallastConfigurationAttributeListAttributeCallback(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"); + } +} + +CHIPBallastConfigurationAttributeListAttributeCallback::~CHIPBallastConfigurationAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPBallastConfigurationAttributeListAttributeCallback::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")); + + 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")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPIlluminanceMeasurementMeasuredValueAttributeCallback::CHIPIlluminanceMeasurementMeasuredValueAttributeCallback( 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 9c05b560d1fd9b..ebce0164633adc 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -7735,6 +7735,246 @@ class CHIPColorControlAttributeListAttributeCallback bool keepAlive; }; +class CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback(); + + static void maybeDestroy(CHIPBallastConfigurationIntrinsicBalanceFactorAttributeCallback * 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 CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback(); + + static void maybeDestroy(CHIPBallastConfigurationBallastFactorAdjustmentAttributeCallback * 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 CHIPBallastConfigurationLampRatedHoursAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPBallastConfigurationLampRatedHoursAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBallastConfigurationLampRatedHoursAttributeCallback(); + + static void maybeDestroy(CHIPBallastConfigurationLampRatedHoursAttributeCallback * 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 CHIPBallastConfigurationLampBurnHoursAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPBallastConfigurationLampBurnHoursAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBallastConfigurationLampBurnHoursAttributeCallback(); + + static void maybeDestroy(CHIPBallastConfigurationLampBurnHoursAttributeCallback * 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 CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback(); + + static void maybeDestroy(CHIPBallastConfigurationLampBurnHoursTripPointAttributeCallback * 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 CHIPBallastConfigurationGeneratedCommandListAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPBallastConfigurationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBallastConfigurationGeneratedCommandListAttributeCallback(); + + static void maybeDestroy(CHIPBallastConfigurationGeneratedCommandListAttributeCallback * 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 CHIPBallastConfigurationAcceptedCommandListAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPBallastConfigurationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBallastConfigurationAcceptedCommandListAttributeCallback(); + + static void maybeDestroy(CHIPBallastConfigurationAcceptedCommandListAttributeCallback * 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 CHIPBallastConfigurationAttributeListAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPBallastConfigurationAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPBallastConfigurationAttributeListAttributeCallback(); + + static void maybeDestroy(CHIPBallastConfigurationAttributeListAttributeCallback * 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 CHIPIlluminanceMeasurementMeasuredValueAttributeCallback : public chip::Callback::Callback { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 33453cc8a4e5ec..fd4f7047d05ed6 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -17149,6 +17149,551 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } + public static class BallastConfigurationCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 769L; + + public BallastConfigurationCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public interface IntrinsicBalanceFactorAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface BallastFactorAdjustmentAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface LampRatedHoursAttributeCallback { + void onSuccess(@Nullable Long value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface LampBurnHoursAttributeCallback { + void onSuccess(@Nullable Long value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface LampBurnHoursTripPointAttributeCallback { + void onSuccess(@Nullable Long value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface AcceptedCommandListAttributeCallback { + 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 readPhysicalMinLevelAttribute(IntegerAttributeCallback callback) { + readPhysicalMinLevelAttribute(chipClusterPtr, callback); + } + + public void subscribePhysicalMinLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribePhysicalMinLevelAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readPhysicalMaxLevelAttribute(IntegerAttributeCallback callback) { + readPhysicalMaxLevelAttribute(chipClusterPtr, callback); + } + + public void subscribePhysicalMaxLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribePhysicalMaxLevelAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readBallastStatusAttribute(IntegerAttributeCallback callback) { + readBallastStatusAttribute(chipClusterPtr, callback); + } + + public void subscribeBallastStatusAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBallastStatusAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readMinLevelAttribute(IntegerAttributeCallback callback) { + readMinLevelAttribute(chipClusterPtr, callback); + } + + public void writeMinLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeMinLevelAttribute(chipClusterPtr, callback, value, null); + } + + public void writeMinLevelAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeMinLevelAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeMinLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeMinLevelAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readMaxLevelAttribute(IntegerAttributeCallback callback) { + readMaxLevelAttribute(chipClusterPtr, callback); + } + + public void writeMaxLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeMaxLevelAttribute(chipClusterPtr, callback, value, null); + } + + public void writeMaxLevelAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeMaxLevelAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeMaxLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeMaxLevelAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readIntrinsicBalanceFactorAttribute( + IntrinsicBalanceFactorAttributeCallback callback) { + readIntrinsicBalanceFactorAttribute(chipClusterPtr, callback); + } + + public void writeIntrinsicBalanceFactorAttribute( + DefaultClusterCallback callback, Integer value) { + writeIntrinsicBalanceFactorAttribute(chipClusterPtr, callback, value, null); + } + + public void writeIntrinsicBalanceFactorAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeIntrinsicBalanceFactorAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeIntrinsicBalanceFactorAttribute( + IntrinsicBalanceFactorAttributeCallback callback, int minInterval, int maxInterval) { + subscribeIntrinsicBalanceFactorAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readBallastFactorAdjustmentAttribute( + BallastFactorAdjustmentAttributeCallback callback) { + readBallastFactorAdjustmentAttribute(chipClusterPtr, callback); + } + + public void writeBallastFactorAdjustmentAttribute( + DefaultClusterCallback callback, Integer value) { + writeBallastFactorAdjustmentAttribute(chipClusterPtr, callback, value, null); + } + + public void writeBallastFactorAdjustmentAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeBallastFactorAdjustmentAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeBallastFactorAdjustmentAttribute( + BallastFactorAdjustmentAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBallastFactorAdjustmentAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readLampQuantityAttribute(IntegerAttributeCallback callback) { + readLampQuantityAttribute(chipClusterPtr, callback); + } + + public void subscribeLampQuantityAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLampQuantityAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readLampTypeAttribute(CharStringAttributeCallback callback) { + readLampTypeAttribute(chipClusterPtr, callback); + } + + public void writeLampTypeAttribute(DefaultClusterCallback callback, String value) { + writeLampTypeAttribute(chipClusterPtr, callback, value, null); + } + + public void writeLampTypeAttribute( + DefaultClusterCallback callback, String value, int timedWriteTimeoutMs) { + writeLampTypeAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeLampTypeAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLampTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readLampManufacturerAttribute(CharStringAttributeCallback callback) { + readLampManufacturerAttribute(chipClusterPtr, callback); + } + + public void writeLampManufacturerAttribute(DefaultClusterCallback callback, String value) { + writeLampManufacturerAttribute(chipClusterPtr, callback, value, null); + } + + public void writeLampManufacturerAttribute( + DefaultClusterCallback callback, String value, int timedWriteTimeoutMs) { + writeLampManufacturerAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeLampManufacturerAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLampManufacturerAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readLampRatedHoursAttribute(LampRatedHoursAttributeCallback callback) { + readLampRatedHoursAttribute(chipClusterPtr, callback); + } + + public void writeLampRatedHoursAttribute(DefaultClusterCallback callback, Long value) { + writeLampRatedHoursAttribute(chipClusterPtr, callback, value, null); + } + + public void writeLampRatedHoursAttribute( + DefaultClusterCallback callback, Long value, int timedWriteTimeoutMs) { + writeLampRatedHoursAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeLampRatedHoursAttribute( + LampRatedHoursAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLampRatedHoursAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readLampBurnHoursAttribute(LampBurnHoursAttributeCallback callback) { + readLampBurnHoursAttribute(chipClusterPtr, callback); + } + + public void writeLampBurnHoursAttribute(DefaultClusterCallback callback, Long value) { + writeLampBurnHoursAttribute(chipClusterPtr, callback, value, null); + } + + public void writeLampBurnHoursAttribute( + DefaultClusterCallback callback, Long value, int timedWriteTimeoutMs) { + writeLampBurnHoursAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeLampBurnHoursAttribute( + LampBurnHoursAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLampBurnHoursAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readLampAlarmModeAttribute(IntegerAttributeCallback callback) { + readLampAlarmModeAttribute(chipClusterPtr, callback); + } + + public void writeLampAlarmModeAttribute(DefaultClusterCallback callback, Integer value) { + writeLampAlarmModeAttribute(chipClusterPtr, callback, value, null); + } + + public void writeLampAlarmModeAttribute( + DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + writeLampAlarmModeAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeLampAlarmModeAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLampAlarmModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readLampBurnHoursTripPointAttribute( + LampBurnHoursTripPointAttributeCallback callback) { + readLampBurnHoursTripPointAttribute(chipClusterPtr, callback); + } + + public void writeLampBurnHoursTripPointAttribute(DefaultClusterCallback callback, Long value) { + writeLampBurnHoursTripPointAttribute(chipClusterPtr, callback, value, null); + } + + public void writeLampBurnHoursTripPointAttribute( + DefaultClusterCallback callback, Long value, int timedWriteTimeoutMs) { + writeLampBurnHoursTripPointAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeLampBurnHoursTripPointAttribute( + LampBurnHoursTripPointAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLampBurnHoursTripPointAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + 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 readPhysicalMinLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribePhysicalMinLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readPhysicalMaxLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribePhysicalMaxLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readBallastStatusAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeBallastStatusAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readMinLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeMinLevelAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeMinLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readMaxLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeMaxLevelAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeMaxLevelAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readIntrinsicBalanceFactorAttribute( + long chipClusterPtr, IntrinsicBalanceFactorAttributeCallback callback); + + private native void writeIntrinsicBalanceFactorAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeIntrinsicBalanceFactorAttribute( + long chipClusterPtr, + IntrinsicBalanceFactorAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readBallastFactorAdjustmentAttribute( + long chipClusterPtr, BallastFactorAdjustmentAttributeCallback callback); + + private native void writeBallastFactorAdjustmentAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeBallastFactorAdjustmentAttribute( + long chipClusterPtr, + BallastFactorAdjustmentAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readLampQuantityAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeLampQuantityAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readLampTypeAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void writeLampTypeAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + String value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeLampTypeAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readLampManufacturerAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void writeLampManufacturerAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + String value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeLampManufacturerAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readLampRatedHoursAttribute( + long chipClusterPtr, LampRatedHoursAttributeCallback callback); + + private native void writeLampRatedHoursAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Long value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeLampRatedHoursAttribute( + long chipClusterPtr, + LampRatedHoursAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readLampBurnHoursAttribute( + long chipClusterPtr, LampBurnHoursAttributeCallback callback); + + private native void writeLampBurnHoursAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Long value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeLampBurnHoursAttribute( + long chipClusterPtr, + LampBurnHoursAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readLampAlarmModeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeLampAlarmModeAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Integer value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeLampAlarmModeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readLampBurnHoursTripPointAttribute( + long chipClusterPtr, LampBurnHoursTripPointAttributeCallback callback); + + private native void writeLampBurnHoursTripPointAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + Long value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeLampBurnHoursTripPointAttribute( + long chipClusterPtr, + LampBurnHoursTripPointAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readGeneratedCommandListAttribute( + long chipClusterPtr, GeneratedCommandListAttributeCallback callback); + + private native void subscribeGeneratedCommandListAttribute( + long chipClusterPtr, + GeneratedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAcceptedCommandListAttribute( + long chipClusterPtr, AcceptedCommandListAttributeCallback callback); + + private native void subscribeAcceptedCommandListAttribute( + long chipClusterPtr, + AcceptedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void subscribeAttributeListAttribute( + long chipClusterPtr, + AttributeListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } + public static class IlluminanceMeasurementCluster extends BaseChipCluster { public static final long CLUSTER_ID = 1024L; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index 702b0e30941cd5..aebfd42cdb56f9 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -157,6 +157,9 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 768L) { return "ColorControl"; } + if (clusterId == 769L) { + return "BallastConfiguration"; + } if (clusterId == 1024L) { return "IlluminanceMeasurement"; } @@ -2226,6 +2229,66 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 769L) { + if (attributeId == 0L) { + return "PhysicalMinLevel"; + } + if (attributeId == 1L) { + return "PhysicalMaxLevel"; + } + if (attributeId == 2L) { + return "BallastStatus"; + } + if (attributeId == 16L) { + return "MinLevel"; + } + if (attributeId == 17L) { + return "MaxLevel"; + } + if (attributeId == 20L) { + return "IntrinsicBalanceFactor"; + } + if (attributeId == 21L) { + return "BallastFactorAdjustment"; + } + if (attributeId == 32L) { + return "LampQuantity"; + } + if (attributeId == 48L) { + return "LampType"; + } + if (attributeId == 49L) { + return "LampManufacturer"; + } + if (attributeId == 50L) { + return "LampRatedHours"; + } + if (attributeId == 51L) { + return "LampBurnHours"; + } + if (attributeId == 52L) { + return "LampAlarmMode"; + } + if (attributeId == 53L) { + return "LampBurnHoursTripPoint"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } if (clusterId == 1024L) { if (attributeId == 0L) { return "MeasuredValue"; @@ -3326,6 +3389,9 @@ public static String eventIdToName(long clusterId, long eventId) { if (clusterId == 768L) { return ""; } + if (clusterId == 769L) { + return ""; + } if (clusterId == 1024L) { return ""; } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 4c98bba511db70..7c587859ab2e0f 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -4997,6 +4997,78 @@ public void onError(Exception ex) { } } + public static class DelegatedBallastConfigurationClusterGeneratedCommandListAttributeCallback + implements ChipClusters.BallastConfigurationCluster.GeneratedCommandListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedBallastConfigurationClusterAcceptedCommandListAttributeCallback + implements ChipClusters.BallastConfigurationCluster.AcceptedCommandListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedBallastConfigurationClusterAttributeListAttributeCallback + implements ChipClusters.BallastConfigurationCluster.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 DelegatedIlluminanceMeasurementClusterGeneratedCommandListAttributeCallback implements ChipClusters.IlluminanceMeasurementCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { @@ -7296,6 +7368,11 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.ColorControlCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("colorControl", colorControlClusterInfo); + ClusterInfo ballastConfigurationClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.BallastConfigurationCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("ballastConfiguration", ballastConfigurationClusterInfo); ClusterInfo illuminanceMeasurementClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.IlluminanceMeasurementCluster(ptr, endpointId), @@ -7465,6 +7542,7 @@ public void combineCommand( .get("thermostatUserInterfaceConfiguration") .combineCommands(source.get("thermostatUserInterfaceConfiguration")); destination.get("colorControl").combineCommands(source.get("colorControl")); + destination.get("ballastConfiguration").combineCommands(source.get("ballastConfiguration")); destination.get("illuminanceMeasurement").combineCommands(source.get("illuminanceMeasurement")); destination.get("temperatureMeasurement").combineCommands(source.get("temperatureMeasurement")); destination.get("pressureMeasurement").combineCommands(source.get("pressureMeasurement")); @@ -11005,6 +11083,9 @@ public Map> getCommandMap() { colorControlClusterInteractionInfoMap.put( "stepColorTemperature", colorControlstepColorTemperatureInteractionInfo); commandMap.put("colorControl", colorControlClusterInteractionInfoMap); + Map ballastConfigurationClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put("ballastConfiguration", ballastConfigurationClusterInteractionInfoMap); Map illuminanceMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("illuminanceMeasurement", illuminanceMeasurementClusterInteractionInfoMap); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index 78e10642d375c0..6ad1a6f0886652 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -8782,6 +8782,278 @@ public Map> getReadAttributeMap() { readColorControlInteractionInfo.put( "readClusterRevisionAttribute", readColorControlClusterRevisionAttributeInteractionInfo); readAttributeMap.put("colorControl", readColorControlInteractionInfo); + Map readBallastConfigurationInteractionInfo = new LinkedHashMap<>(); + Map readBallastConfigurationPhysicalMinLevelCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationPhysicalMinLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readPhysicalMinLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationPhysicalMinLevelCommandParams); + readBallastConfigurationInteractionInfo.put( + "readPhysicalMinLevelAttribute", + readBallastConfigurationPhysicalMinLevelAttributeInteractionInfo); + Map readBallastConfigurationPhysicalMaxLevelCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationPhysicalMaxLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readPhysicalMaxLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationPhysicalMaxLevelCommandParams); + readBallastConfigurationInteractionInfo.put( + "readPhysicalMaxLevelAttribute", + readBallastConfigurationPhysicalMaxLevelAttributeInteractionInfo); + Map readBallastConfigurationBallastStatusCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationBallastStatusAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readBallastStatusAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationBallastStatusCommandParams); + readBallastConfigurationInteractionInfo.put( + "readBallastStatusAttribute", + readBallastConfigurationBallastStatusAttributeInteractionInfo); + Map readBallastConfigurationMinLevelCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationMinLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readMinLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationMinLevelCommandParams); + readBallastConfigurationInteractionInfo.put( + "readMinLevelAttribute", readBallastConfigurationMinLevelAttributeInteractionInfo); + Map readBallastConfigurationMaxLevelCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationMaxLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readMaxLevelAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationMaxLevelCommandParams); + readBallastConfigurationInteractionInfo.put( + "readMaxLevelAttribute", readBallastConfigurationMaxLevelAttributeInteractionInfo); + Map readBallastConfigurationIntrinsicBalanceFactorCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationIntrinsicBalanceFactorAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readIntrinsicBalanceFactorAttribute( + (ChipClusters.BallastConfigurationCluster + .IntrinsicBalanceFactorAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationIntrinsicBalanceFactorCommandParams); + readBallastConfigurationInteractionInfo.put( + "readIntrinsicBalanceFactorAttribute", + readBallastConfigurationIntrinsicBalanceFactorAttributeInteractionInfo); + Map readBallastConfigurationBallastFactorAdjustmentCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationBallastFactorAdjustmentAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readBallastFactorAdjustmentAttribute( + (ChipClusters.BallastConfigurationCluster + .BallastFactorAdjustmentAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationBallastFactorAdjustmentCommandParams); + readBallastConfigurationInteractionInfo.put( + "readBallastFactorAdjustmentAttribute", + readBallastConfigurationBallastFactorAdjustmentAttributeInteractionInfo); + Map readBallastConfigurationLampQuantityCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationLampQuantityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readLampQuantityAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationLampQuantityCommandParams); + readBallastConfigurationInteractionInfo.put( + "readLampQuantityAttribute", readBallastConfigurationLampQuantityAttributeInteractionInfo); + Map readBallastConfigurationLampTypeCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationLampTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readLampTypeAttribute((ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBallastConfigurationLampTypeCommandParams); + readBallastConfigurationInteractionInfo.put( + "readLampTypeAttribute", readBallastConfigurationLampTypeAttributeInteractionInfo); + Map readBallastConfigurationLampManufacturerCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationLampManufacturerAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readLampManufacturerAttribute( + (ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readBallastConfigurationLampManufacturerCommandParams); + readBallastConfigurationInteractionInfo.put( + "readLampManufacturerAttribute", + readBallastConfigurationLampManufacturerAttributeInteractionInfo); + Map readBallastConfigurationLampRatedHoursCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationLampRatedHoursAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readLampRatedHoursAttribute( + (ChipClusters.BallastConfigurationCluster.LampRatedHoursAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readBallastConfigurationLampRatedHoursCommandParams); + readBallastConfigurationInteractionInfo.put( + "readLampRatedHoursAttribute", + readBallastConfigurationLampRatedHoursAttributeInteractionInfo); + Map readBallastConfigurationLampBurnHoursCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationLampBurnHoursAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readLampBurnHoursAttribute( + (ChipClusters.BallastConfigurationCluster.LampBurnHoursAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readBallastConfigurationLampBurnHoursCommandParams); + readBallastConfigurationInteractionInfo.put( + "readLampBurnHoursAttribute", + readBallastConfigurationLampBurnHoursAttributeInteractionInfo); + Map readBallastConfigurationLampAlarmModeCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationLampAlarmModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readLampAlarmModeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationLampAlarmModeCommandParams); + readBallastConfigurationInteractionInfo.put( + "readLampAlarmModeAttribute", + readBallastConfigurationLampAlarmModeAttributeInteractionInfo); + Map readBallastConfigurationLampBurnHoursTripPointCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationLampBurnHoursTripPointAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readLampBurnHoursTripPointAttribute( + (ChipClusters.BallastConfigurationCluster + .LampBurnHoursTripPointAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readBallastConfigurationLampBurnHoursTripPointCommandParams); + readBallastConfigurationInteractionInfo.put( + "readLampBurnHoursTripPointAttribute", + readBallastConfigurationLampBurnHoursTripPointAttributeInteractionInfo); + Map readBallastConfigurationGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.BallastConfigurationCluster + .GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedBallastConfigurationClusterGeneratedCommandListAttributeCallback(), + readBallastConfigurationGeneratedCommandListCommandParams); + readBallastConfigurationInteractionInfo.put( + "readGeneratedCommandListAttribute", + readBallastConfigurationGeneratedCommandListAttributeInteractionInfo); + Map readBallastConfigurationAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.BallastConfigurationCluster + .AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedBallastConfigurationClusterAcceptedCommandListAttributeCallback(), + readBallastConfigurationAcceptedCommandListCommandParams); + readBallastConfigurationInteractionInfo.put( + "readAcceptedCommandListAttribute", + readBallastConfigurationAcceptedCommandListAttributeInteractionInfo); + Map readBallastConfigurationAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.BallastConfigurationCluster.AttributeListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedBallastConfigurationClusterAttributeListAttributeCallback(), + readBallastConfigurationAttributeListCommandParams); + readBallastConfigurationInteractionInfo.put( + "readAttributeListAttribute", + readBallastConfigurationAttributeListAttributeInteractionInfo); + Map readBallastConfigurationFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readBallastConfigurationFeatureMapCommandParams); + readBallastConfigurationInteractionInfo.put( + "readFeatureMapAttribute", readBallastConfigurationFeatureMapAttributeInteractionInfo); + Map readBallastConfigurationClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readBallastConfigurationClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBallastConfigurationClusterRevisionCommandParams); + readBallastConfigurationInteractionInfo.put( + "readClusterRevisionAttribute", + readBallastConfigurationClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("ballastConfiguration", readBallastConfigurationInteractionInfo); Map readIlluminanceMeasurementInteractionInfo = new LinkedHashMap<>(); Map readIlluminanceMeasurementMeasuredValueCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java index 36d9b225034c92..1d69c6981408e2 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java @@ -1367,6 +1367,186 @@ public Map> getWriteAttributeMap() { "writeStartUpColorTemperatureMiredsAttribute", writeColorControlStartUpColorTemperatureMiredsAttributeInteractionInfo); writeAttributeMap.put("colorControl", writeColorControlInteractionInfo); + Map writeBallastConfigurationInteractionInfo = new LinkedHashMap<>(); + Map writeBallastConfigurationMinLevelCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationminLevelCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeBallastConfigurationMinLevelCommandParams.put( + "value", ballastConfigurationminLevelCommandParameterInfo); + InteractionInfo writeBallastConfigurationMinLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeMinLevelAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationMinLevelCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeMinLevelAttribute", writeBallastConfigurationMinLevelAttributeInteractionInfo); + Map writeBallastConfigurationMaxLevelCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationmaxLevelCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeBallastConfigurationMaxLevelCommandParams.put( + "value", ballastConfigurationmaxLevelCommandParameterInfo); + InteractionInfo writeBallastConfigurationMaxLevelAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeMaxLevelAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationMaxLevelCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeMaxLevelAttribute", writeBallastConfigurationMaxLevelAttributeInteractionInfo); + Map writeBallastConfigurationIntrinsicBalanceFactorCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationintrinsicBalanceFactorCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeBallastConfigurationIntrinsicBalanceFactorCommandParams.put( + "value", ballastConfigurationintrinsicBalanceFactorCommandParameterInfo); + InteractionInfo writeBallastConfigurationIntrinsicBalanceFactorAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeIntrinsicBalanceFactorAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationIntrinsicBalanceFactorCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeIntrinsicBalanceFactorAttribute", + writeBallastConfigurationIntrinsicBalanceFactorAttributeInteractionInfo); + Map + writeBallastConfigurationBallastFactorAdjustmentCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationballastFactorAdjustmentCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeBallastConfigurationBallastFactorAdjustmentCommandParams.put( + "value", ballastConfigurationballastFactorAdjustmentCommandParameterInfo); + InteractionInfo writeBallastConfigurationBallastFactorAdjustmentAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeBallastFactorAdjustmentAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationBallastFactorAdjustmentCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeBallastFactorAdjustmentAttribute", + writeBallastConfigurationBallastFactorAdjustmentAttributeInteractionInfo); + Map writeBallastConfigurationLampTypeCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationlampTypeCommandParameterInfo = + new CommandParameterInfo("value", String.class, String.class); + writeBallastConfigurationLampTypeCommandParams.put( + "value", ballastConfigurationlampTypeCommandParameterInfo); + InteractionInfo writeBallastConfigurationLampTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeLampTypeAttribute( + (DefaultClusterCallback) callback, (String) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationLampTypeCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeLampTypeAttribute", writeBallastConfigurationLampTypeAttributeInteractionInfo); + Map writeBallastConfigurationLampManufacturerCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationlampManufacturerCommandParameterInfo = + new CommandParameterInfo("value", String.class, String.class); + writeBallastConfigurationLampManufacturerCommandParams.put( + "value", ballastConfigurationlampManufacturerCommandParameterInfo); + InteractionInfo writeBallastConfigurationLampManufacturerAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeLampManufacturerAttribute( + (DefaultClusterCallback) callback, (String) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationLampManufacturerCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeLampManufacturerAttribute", + writeBallastConfigurationLampManufacturerAttributeInteractionInfo); + Map writeBallastConfigurationLampRatedHoursCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationlampRatedHoursCommandParameterInfo = + new CommandParameterInfo("value", Long.class, Long.class); + writeBallastConfigurationLampRatedHoursCommandParams.put( + "value", ballastConfigurationlampRatedHoursCommandParameterInfo); + InteractionInfo writeBallastConfigurationLampRatedHoursAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeLampRatedHoursAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationLampRatedHoursCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeLampRatedHoursAttribute", + writeBallastConfigurationLampRatedHoursAttributeInteractionInfo); + Map writeBallastConfigurationLampBurnHoursCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationlampBurnHoursCommandParameterInfo = + new CommandParameterInfo("value", Long.class, Long.class); + writeBallastConfigurationLampBurnHoursCommandParams.put( + "value", ballastConfigurationlampBurnHoursCommandParameterInfo); + InteractionInfo writeBallastConfigurationLampBurnHoursAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeLampBurnHoursAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationLampBurnHoursCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeLampBurnHoursAttribute", + writeBallastConfigurationLampBurnHoursAttributeInteractionInfo); + Map writeBallastConfigurationLampAlarmModeCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationlampAlarmModeCommandParameterInfo = + new CommandParameterInfo("value", Integer.class, Integer.class); + writeBallastConfigurationLampAlarmModeCommandParams.put( + "value", ballastConfigurationlampAlarmModeCommandParameterInfo); + InteractionInfo writeBallastConfigurationLampAlarmModeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeLampAlarmModeAttribute( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationLampAlarmModeCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeLampAlarmModeAttribute", + writeBallastConfigurationLampAlarmModeAttributeInteractionInfo); + Map writeBallastConfigurationLampBurnHoursTripPointCommandParams = + new LinkedHashMap(); + CommandParameterInfo ballastConfigurationlampBurnHoursTripPointCommandParameterInfo = + new CommandParameterInfo("value", Long.class, Long.class); + writeBallastConfigurationLampBurnHoursTripPointCommandParams.put( + "value", ballastConfigurationlampBurnHoursTripPointCommandParameterInfo); + InteractionInfo writeBallastConfigurationLampBurnHoursTripPointAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BallastConfigurationCluster) cluster) + .writeLampBurnHoursTripPointAttribute( + (DefaultClusterCallback) callback, (Long) commandArguments.get("value")); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeBallastConfigurationLampBurnHoursTripPointCommandParams); + writeBallastConfigurationInteractionInfo.put( + "writeLampBurnHoursTripPointAttribute", + writeBallastConfigurationLampBurnHoursTripPointAttributeInteractionInfo); + writeAttributeMap.put("ballastConfiguration", writeBallastConfigurationInteractionInfo); Map writeIlluminanceMeasurementInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("illuminanceMeasurement", writeIlluminanceMeasurementInteractionInfo); Map writeTemperatureMeasurementInteractionInfo = new LinkedHashMap<>(); diff --git a/src/controller/python/BUILD.gn b/src/controller/python/BUILD.gn index b6322f59236ab7..5297f0d2fba9c8 100644 --- a/src/controller/python/BUILD.gn +++ b/src/controller/python/BUILD.gn @@ -30,6 +30,8 @@ config("controller_wno_deprecate") { cflags = [ "-Wno-deprecated-declarations" ] } +chip_python_version = "0.0" + shared_library("ChipDeviceCtrl") { if (chip_controller) { output_name = "_ChipDeviceCtrl" @@ -112,23 +114,80 @@ shared_library("ChipDeviceCtrl") { configs += [ ":controller_wno_deprecate" ] } -pw_python_action("python") { - script = "build-chip-wheel.py" +template("chip_python_wheel_action") { + _dist_dir = "${root_out_dir}/controller/python" + + _py_manifest_file = "${target_gen_dir}/${target_name}.py_manifest.json" + + pw_python_action(target_name) { + script = "build-chip-wheel.py" + forward_variables_from(invoker, "*") + + _py_manifest_files_rebased = [] + foreach(_manifest_entry, py_manifest_files) { + inputs += _manifest_entry.sources + _py_manifest_files_rebased += [ + { + src_dir = rebase_path(_manifest_entry.src_dir, + get_path_info(_py_manifest_file, "dir")) + sources = + rebase_path(_manifest_entry.sources, _manifest_entry.src_dir) + }, + ] + } + + if (defined(invoker.py_scripts)) { + _py_scripts = invoker.py_scripts + } else { + _py_scripts = [] + } + + _py_manifest = { + files = _py_manifest_files_rebased + packages = py_packages + scripts = _py_scripts + package_reqs = py_package_reqs + } - _py_manifest_files = [ + write_file(_py_manifest_file, _py_manifest, "json") + + args = [ + "--package_name", + py_package_name, + "--build_number", + chip_python_version, + "--build_dir", + rebase_path("${target_gen_dir}/${target_name}.py_build", root_build_dir), + "--dist_dir", + rebase_path(_dist_dir, root_build_dir), + "--manifest", + rebase_path(_py_manifest_file, root_build_dir), + "--plat-name", + py_platform_tag, + ] + + if (defined(invoker.lib_name)) { + args += [ + "--lib-name", + lib_name, + ] + } + + outputs = [ "${_dist_dir}/$output_name" ] + } +} + +chip_python_wheel_action("chip-core") { + py_manifest_files = [ { src_dir = "." sources = [ - "chip-device-ctrl.py", - "chip-repl.py", "chip/ChipBleBase.py", "chip/ChipBleUtility.py", "chip/ChipBluezMgr.py", "chip/ChipCommissionableNodeCtrl.py", "chip/ChipCoreBluetoothMgr.py", - "chip/ChipReplStartup.py", "chip/ChipStack.py", - "chip/ChipUtility.py", "chip/FabricAdmin.py", "chip/__init__.py", "chip/ble/__init__.py", @@ -138,12 +197,7 @@ pw_python_action("python") { "chip/ble/scan_devices.py", "chip/ble/types.py", "chip/clusters/Attribute.py", - "chip/clusters/CHIPClusters.py", - "chip/clusters/ClusterObjects.py", "chip/clusters/Command.py", - "chip/clusters/Objects.py", - "chip/clusters/TestObjects.py", - "chip/clusters/Types.py", "chip/clusters/__init__.py", "chip/configuration/__init__.py", "chip/discovery/__init__.py", @@ -163,13 +217,16 @@ pw_python_action("python") { "chip/setup_payload/__init__.py", "chip/setup_payload/setup_payload.py", "chip/storage/__init__.py", - "chip/tlv/__init__.py", "chip/utils/CommissioningBuildingBlocks.py", "chip/utils/__init__.py", ] if (chip_controller) { - sources += [ "chip/ChipDeviceCtrl.py" ] + sources += [ + "chip-device-ctrl.py", + "chip-repl.py", + "chip/ChipDeviceCtrl.py", + ] } else { sources += [ "chip/server/__init__.py", @@ -191,28 +248,48 @@ pw_python_action("python") { }, ] - _py_manifest_file = "${target_gen_dir}/${target_name}.py_manifest.json" - inputs = [] - _py_manifest_files_rebased = [] - foreach(_manifest_entry, _py_manifest_files) { - inputs += _manifest_entry.sources - _py_manifest_files_rebased += [ - { - src_dir = rebase_path(_manifest_entry.src_dir, - get_path_info(_py_manifest_file, "dir")) - sources = rebase_path(_manifest_entry.sources, _manifest_entry.src_dir) - }, - ] - } - _py_manifest = { - files = _py_manifest_files_rebased + py_packages = [ + "chip", + "chip.ble", + "chip.ble.commissioning", + "chip.configuration", + "chip.clusters", + "chip.utils", + "chip.discovery", + "chip.exceptions", + "chip.internal", + "chip.interaction_model", + "chip.logging", + "chip.native", + "chip.clusters", + "chip.setup_payload", + "chip.storage", + ] + + if (!chip_controller) { + py_packages += [ "chip.server" ] } - write_file(_py_manifest_file, _py_manifest, "json") + py_package_reqs = [ + "coloredlogs", + "construct", + "dacite", + "rich", + "pyyaml", + "ipdb", + "deprecation", + ] - _dist_dir = "${root_out_dir}/controller/python" + if (current_os == "mac") { + py_package_reqs += [ "pyobjc-framework-corebluetooth" ] + } else if (current_os == "linux") { + py_package_reqs += [ + "dbus-python", + "pygobject", + ] + } if (current_cpu == "x64") { cpu_tag = "x86_64" @@ -225,40 +302,109 @@ pw_python_action("python") { } if (current_os == "mac") { - platform_tag = "macosx_" + string_replace(mac_deployment_target, ".", "_") + py_platform_tag = + "macosx_" + string_replace(mac_deployment_target, ".", "_") } else { - platform_tag = current_os + py_platform_tag = current_os } - platform_tag = platform_tag + "_" + cpu_tag + py_platform_tag = py_platform_tag + "_" + cpu_tag - tags = "cp37-abi3-" + platform_tag - - args = [ - "--package_name", - "chip", - "--build_number", - "0.0", - "--build_dir", - rebase_path("${target_gen_dir}/${target_name}.py_build", root_build_dir), - "--dist_dir", - rebase_path(_dist_dir, root_build_dir), - "--manifest", - rebase_path(_py_manifest_file, root_build_dir), - "--plat-name", - platform_tag, - ] + tags = "cp37-abi3-" + py_platform_tag if (chip_controller) { + lib_name = "_ChipDeviceCtrl.so" } else { - args += [ - "--server", - "True", - ] + lib_name = "_ChipServer.so" } + py_package_name = "chip-core" + public_deps = [ ":ChipDeviceCtrl" ] - output_name = "chip-0.0-${tags}.whl" - outputs = [ "${_dist_dir}/$output_name" ] + output_name = "chip_core-${chip_python_version}-${tags}.whl" +} + +chip_python_wheel_action("chip-clusters") { + py_manifest_files = [ + { + src_dir = "." + sources = [ + "chip/ChipUtility.py", + "chip/clusters/CHIPClusters.py", + "chip/clusters/ClusterObjects.py", + "chip/clusters/Objects.py", + "chip/clusters/TestObjects.py", + "chip/clusters/Types.py", + "chip/tlv/__init__.py", + ] + }, + { + src_dir = "//" + sources = [ "//LICENSE" ] + }, + ] + + inputs = [] + + py_packages = [ + "chip", + "chip.clusters", + "chip.tlv", + ] + + py_package_reqs = [ "dacite" ] + + py_package_name = "chip-clusters" + py_platform_tag = "any" + + output_name = "chip_clusters-${chip_python_version}-py3-any.whl" +} + +chip_python_wheel_action("chip-repl") { + py_scripts = [ + "chip-device-ctrl.py", + "chip-repl.py", + ] + + py_manifest_files = [ + { + src_dir = "." + sources = [ "chip/ChipReplStartup.py" ] + sources += py_scripts + }, + { + src_dir = "//" + sources = [ "//LICENSE" ] + }, + ] + + inputs = [] + + py_packages = [ "chip" ] + + py_package_reqs = [ + "coloredlogs", + + # + # IPython 7.30.0 has a bug which results in the use of await ... failing on some platforms (see https://github.com/ipython/ipython/pull/13269) + # For now, let's just avoid that version. + # + # IPython 8.1.0 has a bug which causes issues: https://github.com/ipython/ipython/issues/13554 + # + # + "ipython!=8.1.0", + "rich", + "ipykernel", + ] + + py_package_name = "chip-repl" + py_platform_tag = "any" + + data_deps = [ + ":chip-clusters", + ":chip-core", + ] + + output_name = "chip_repl-${chip_python_version}-py3-any.whl" } diff --git a/src/controller/python/build-chip-wheel.py b/src/controller/python/build-chip-wheel.py index 169cf655374208..e3ab5312cadc16 100644 --- a/src/controller/python/build-chip-wheel.py +++ b/src/controller/python/build-chip-wheel.py @@ -29,7 +29,6 @@ import argparse import json import os -import platform import shutil @@ -45,7 +44,7 @@ parser.add_argument( '--plat-name', help='platform name to embed in generated filenames') parser.add_argument( - '--server', help='build the server variant', default=False, type=bool) + '--lib-name', help='the native library to include (if any)', default=None) args = parser.parse_args() @@ -58,21 +57,10 @@ def __init__(self, name): self.installName = os.path.splitext(name)[0] -if args.server: - chipDLLName = "_ChipServer.so" -else: - chipDLLName = "_ChipDeviceCtrl.so" packageName = args.package_name +libName = args.lib_name chipPackageVer = args.build_number -if args.server: - installScripts = [] -else: - installScripts = [ - InstalledScriptInfo("chip-device-ctrl.py"), - InstalledScriptInfo("chip-repl.py"), - ] - # Record the current directory at the start of execution. curDir = os.curdir @@ -110,6 +98,7 @@ def __init__(self, name): os.makedirs(os.path.dirname(dstFile), exist_ok=True) shutil.copyfile(srcFile, dstFile) + installScripts = [InstalledScriptInfo(script) for script in manifest['scripts']] for script in installScripts: os.rename(os.path.join(tmpDir, script.name), os.path.join(tmpDir, script.installName)) @@ -121,63 +110,15 @@ def finalize_options(self): bdist_wheel.finalize_options(self) self.root_is_pure = False - requiredPackages = [ - "coloredlogs", - 'construct', - - # - # IPython 7.30.0 has a bug which results in the use of await ... failing on some platforms (see https://github.com/ipython/ipython/pull/13269) - # For now, let's just avoid that version. - # - # IPython 8.1.0 has a bug which causes issues: https://github.com/ipython/ipython/issues/13554 - # - # - 'ipython!=8.1.0', - 'dacite', - 'rich', - 'stringcase', - 'pyyaml', - 'ipdb', - 'ipykernel', - 'deprecation' - ] - - if platform.system() == "Darwin": - requiredPackages.append("pyobjc-framework-corebluetooth") - - if platform.system() == "Linux": - requiredPackages.append("dbus-python") - requiredPackages.append("pygobject") + requiredPackages = manifest['package_reqs'] # # Build the chip package... # - packages = [ - 'chip', - 'chip.ble', - 'chip.ble.commissioning', - 'chip.configuration', - 'chip.clusters', - 'chip.utils', - 'chip.discovery', - 'chip.exceptions', - 'chip.internal', - 'chip.interaction_model', - 'chip.logging', - 'chip.native', - 'chip.clusters', - 'chip.tlv', - 'chip.setup_payload', - 'chip.storage', - ] - #print ("Server: {}".format(args.server)) - if args.server: - packages.append('chip.server') - - #print("packages: {}".format(packages)) + packages = manifest['packages'] print("packageName: {}".format(packageName)) - print("chipDLLName: {}".format(chipDLLName)) + print("libName: {}".format(libName)) # Invoke the setuptools 'bdist_wheel' command to generate a wheel containing # the CHIP python packages, shared libraries and scripts. @@ -201,11 +142,10 @@ def finalize_options(self): '': tmpDir, }, package_data={ - packageName: [ - # Include the wrapper DLL as package data in the "chip" package. - chipDLLName + packages[0]: [ + libName ] - }, + } if libName else {}, scripts=[name for name in map( lambda script: os.path.join(tmpDir, script.installName), installScripts @@ -226,7 +166,7 @@ def finalize_options(self): }, cmdclass={ 'bdist_wheel': bdist_wheel_override - }, + } if libName else {}, script_args=['clean', '--all', 'bdist_wheel'] ) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 27c6c60dcd2fab..b729e83bbc1284 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -20,8 +20,6 @@ ''' import ctypes -from chip.ChipStack import * -from chip.exceptions import * __all__ = ["ChipClusters"] @@ -5262,6 +5260,138 @@ class ChipClusters: }, }, } + _BALLAST_CONFIGURATION_CLUSTER_INFO = { + "clusterName": "BallastConfiguration", + "clusterId": 0x00000301, + "commands": { + }, + "attributes": { + 0x00000000: { + "attributeName": "PhysicalMinLevel", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, + 0x00000001: { + "attributeName": "PhysicalMaxLevel", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "BallastStatus", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + }, + 0x00000010: { + "attributeName": "MinLevel", + "attributeId": 0x00000010, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000011: { + "attributeName": "MaxLevel", + "attributeId": 0x00000011, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000014: { + "attributeName": "IntrinsicBalanceFactor", + "attributeId": 0x00000014, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000015: { + "attributeName": "BallastFactorAdjustment", + "attributeId": 0x00000015, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000020: { + "attributeName": "LampQuantity", + "attributeId": 0x00000020, + "type": "int", + "reportable": True, + }, + 0x00000030: { + "attributeName": "LampType", + "attributeId": 0x00000030, + "type": "str", + "reportable": True, + "writable": True, + }, + 0x00000031: { + "attributeName": "LampManufacturer", + "attributeId": 0x00000031, + "type": "str", + "reportable": True, + "writable": True, + }, + 0x00000032: { + "attributeName": "LampRatedHours", + "attributeId": 0x00000032, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000033: { + "attributeName": "LampBurnHours", + "attributeId": 0x00000033, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000034: { + "attributeName": "LampAlarmMode", + "attributeId": 0x00000034, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000035: { + "attributeName": "LampBurnHoursTripPoint", + "attributeId": 0x00000035, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _ILLUMINANCE_MEASUREMENT_CLUSTER_INFO = { "clusterName": "IlluminanceMeasurement", "clusterId": 0x00000400, @@ -7410,6 +7540,7 @@ class ChipClusters: 0x00000202: _FAN_CONTROL_CLUSTER_INFO, 0x00000204: _THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER_INFO, 0x00000300: _COLOR_CONTROL_CLUSTER_INFO, + 0x00000301: _BALLAST_CONFIGURATION_CLUSTER_INFO, 0x00000400: _ILLUMINANCE_MEASUREMENT_CLUSTER_INFO, 0x00000402: _TEMPERATURE_MEASUREMENT_CLUSTER_INFO, 0x00000403: _PRESSURE_MEASUREMENT_CLUSTER_INFO, @@ -7477,6 +7608,7 @@ class ChipClusters: "FanControl": _FAN_CONTROL_CLUSTER_INFO, "ThermostatUserInterfaceConfiguration": _THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER_INFO, "ColorControl": _COLOR_CONTROL_CLUSTER_INFO, + "BallastConfiguration": _BALLAST_CONFIGURATION_CLUSTER_INFO, "IlluminanceMeasurement": _ILLUMINANCE_MEASUREMENT_CLUSTER_INFO, "TemperatureMeasurement": _TEMPERATURE_MEASUREMENT_CLUSTER_INFO, "PressureMeasurement": _PRESSURE_MEASUREMENT_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 13b596cc1e7df4..d2a7397f0e7262 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -22910,22 +22910,20 @@ class BallastConfiguration(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="physicalMinLevel", Tag=0x00000000, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="physicalMaxLevel", Tag=0x00000001, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="ballastStatus", Tag=0x00000002, Type=uint), - ClusterObjectFieldDescriptor(Label="minLevel", Tag=0x00000010, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="maxLevel", Tag=0x00000011, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="powerOnLevel", Tag=0x00000012, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="powerOnFadeTime", Tag=0x00000013, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="intrinsicBallastFactor", Tag=0x00000014, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="ballastFactorAdjustment", Tag=0x00000015, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="lampQuality", Tag=0x00000020, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="physicalMinLevel", Tag=0x00000000, Type=uint), + ClusterObjectFieldDescriptor(Label="physicalMaxLevel", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="ballastStatus", Tag=0x00000002, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="minLevel", Tag=0x00000010, Type=uint), + ClusterObjectFieldDescriptor(Label="maxLevel", Tag=0x00000011, Type=uint), + ClusterObjectFieldDescriptor(Label="intrinsicBalanceFactor", Tag=0x00000014, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="ballastFactorAdjustment", Tag=0x00000015, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="lampQuantity", Tag=0x00000020, Type=uint), ClusterObjectFieldDescriptor(Label="lampType", Tag=0x00000030, Type=typing.Optional[str]), ClusterObjectFieldDescriptor(Label="lampManufacturer", Tag=0x00000031, Type=typing.Optional[str]), - ClusterObjectFieldDescriptor(Label="lampRatedHours", Tag=0x00000032, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="lampBurnHours", Tag=0x00000033, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="lampRatedHours", Tag=0x00000032, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="lampBurnHours", Tag=0x00000033, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="lampAlarmMode", Tag=0x00000034, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="lampBurnHoursTripPoint", Tag=0x00000035, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="lampBurnHoursTripPoint", Tag=0x00000035, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), @@ -22933,22 +22931,20 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - physicalMinLevel: 'typing.Optional[uint]' = None - physicalMaxLevel: 'typing.Optional[uint]' = None - ballastStatus: 'uint' = None - minLevel: 'typing.Optional[uint]' = None - maxLevel: 'typing.Optional[uint]' = None - powerOnLevel: 'typing.Optional[uint]' = None - powerOnFadeTime: 'typing.Optional[uint]' = None - intrinsicBallastFactor: 'typing.Optional[uint]' = None - ballastFactorAdjustment: 'typing.Optional[uint]' = None - lampQuality: 'typing.Optional[uint]' = None + physicalMinLevel: 'uint' = None + physicalMaxLevel: 'uint' = None + ballastStatus: 'typing.Optional[uint]' = None + minLevel: 'uint' = None + maxLevel: 'uint' = None + intrinsicBalanceFactor: 'typing.Union[None, Nullable, uint]' = None + ballastFactorAdjustment: 'typing.Union[None, Nullable, uint]' = None + lampQuantity: 'uint' = None lampType: 'typing.Optional[str]' = None lampManufacturer: 'typing.Optional[str]' = None - lampRatedHours: 'typing.Optional[uint]' = None - lampBurnHours: 'typing.Optional[uint]' = None + lampRatedHours: 'typing.Union[None, Nullable, uint]' = None + lampBurnHours: 'typing.Union[None, Nullable, uint]' = None lampAlarmMode: 'typing.Optional[uint]' = None - lampBurnHoursTripPoint: 'typing.Optional[uint]' = None + lampBurnHoursTripPoint: 'typing.Union[None, Nullable, uint]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None attributeList: 'typing.List[uint]' = None @@ -22971,9 +22967,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=uint) - value: 'typing.Optional[uint]' = None + value: 'uint' = 0 @dataclass class PhysicalMaxLevel(ClusterAttributeDescriptor): @@ -22987,9 +22983,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=uint) - value: 'typing.Optional[uint]' = None + value: 'uint' = 0 @dataclass class BallastStatus(ClusterAttributeDescriptor): @@ -23003,9 +22999,9 @@ def attribute_id(cls) -> int: @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 MinLevel(ClusterAttributeDescriptor): @@ -23019,9 +23015,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=uint) - value: 'typing.Optional[uint]' = None + value: 'uint' = 0 @dataclass class MaxLevel(ClusterAttributeDescriptor): @@ -23035,44 +23031,12 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class PowerOnLevel(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0301 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000012 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class PowerOnFadeTime(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0301 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000013 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=uint) - value: 'typing.Optional[uint]' = None + value: 'uint' = 0 @dataclass - class IntrinsicBallastFactor(ClusterAttributeDescriptor): + class IntrinsicBalanceFactor(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x0301 @@ -23083,9 +23047,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 BallastFactorAdjustment(ClusterAttributeDescriptor): @@ -23099,12 +23063,12 @@ 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 LampQuality(ClusterAttributeDescriptor): + class LampQuantity(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x0301 @@ -23115,9 +23079,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=uint) - value: 'typing.Optional[uint]' = None + value: 'uint' = 0 @dataclass class LampType(ClusterAttributeDescriptor): @@ -23163,9 +23127,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 LampBurnHours(ClusterAttributeDescriptor): @@ -23179,9 +23143,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 LampAlarmMode(ClusterAttributeDescriptor): @@ -23211,9 +23175,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 GeneratedCommandList(ClusterAttributeDescriptor): @@ -32827,349 +32791,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: -@dataclass -class Messaging(Cluster): - id: typing.ClassVar[int] = 0x0703 - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), - ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), - ]) - - generatedCommandList: 'typing.List[uint]' = None - acceptedCommandList: 'typing.List[uint]' = None - attributeList: 'typing.List[uint]' = None - featureMap: 'uint' = None - clusterRevision: 'uint' = None - - class Enums: - class EventId(IntEnum): - kMeterCoverRemoved = 0x00 - kMeterCoverClosed = 0x01 - kStrongMagneticField = 0x02 - kNoStrongMagneticField = 0x03 - kBatteryFailure = 0x04 - kLowBattery = 0x05 - kProgramMemoryError = 0x06 - kRamError = 0x07 - kNvMemoryError = 0x08 - kMeasurementSystemError = 0x09 - kWatchdogError = 0x0A - kSupplyDisconnectFailure = 0x0B - kSupplyConnectFailure = 0x0C - kMeasurmentSoftwareChanged = 0x0D - kDstEnabled = 0x0E - kDstDisabled = 0x0F - kClockAdjBackward = 0x10 - kClockAdjForward = 0x11 - kClockInvalid = 0x12 - kCommsErrorHan = 0x13 - kCommsOkHan = 0x14 - kFraudAttempt = 0x15 - kPowerLoss = 0x16 - kIncorrectProtocol = 0x17 - kUnusualHanTraffic = 0x18 - kUnexpectedClockChange = 0x19 - kCommsUsingUnauthenticatedComponent = 0x1A - kErrorRegClear = 0x1B - kAlarmRegClear = 0x1C - kUnexpectedHwReset = 0x1D - kUnexpectedProgramExecution = 0x1E - kEventLogCleared = 0x1F - kManualDisconnect = 0x20 - kManualConnect = 0x21 - kRemoteDisconnection = 0x22 - kLocalDisconnection = 0x23 - kLimitThresholdExceeded = 0x24 - kLimitThresholdOk = 0x25 - kLimitThresholdChanged = 0x26 - kMaximumDemandExceeded = 0x27 - kProfileCleared = 0x28 - kFirmwareReadyForActivation = 0x29 - kFirmwareActivated = 0x2A - kPatchFailure = 0x2B - kTouTariffActivation = 0x2C - k8x8Tariffactivated = 0x2D - kSingleTariffRateActivated = 0x2E - kAsynchronousBillingOccurred = 0x2F - kSynchronousBillingOccurred = 0x30 - kIncorrectPolarity = 0x80 - kCurrentNoVoltage = 0x81 - kUnderVoltage = 0x82 - kOverVoltage = 0x83 - kNormalVoltage = 0x84 - kPfBelowThreshold = 0x85 - kPfAboveThreshold = 0x86 - kTerminalCoverRemoved = 0x87 - kTerminalCoverClosed = 0x88 - kReverseFlow = 0xA0 - kTiltTamper = 0xA1 - kBatteryCoverRemoved = 0xA2 - kBatteryCoverClosed = 0xA3 - kExcessFlow = 0xA4 - kCreditOk = 0xC0 - kLowCredit = 0xC1 - kEmergencyCreditInUse = 0xC0 - kEmergencyCreditExhausted = 0xC1 - kZeroCreditEcNotSelected = 0xC2 - kSupplyOn = 0xC3 - kSupplyOffAarmed = 0xC4 - kSupplyOff = 0xC5 - kDiscountApplied = 0xC6 - kManufacturerSpecificA = 0xE0 - kManufacturerSpecificB = 0xE1 - kManufacturerSpecificC = 0xE2 - kManufacturerSpecificD = 0xE3 - kManufacturerSpecificE = 0xE4 - kManufacturerSpecificF = 0xE5 - kManufacturerSpecificG = 0xE6 - kManufacturerSpecificH = 0xE7 - kManufacturerSpecificI = 0xE8 - - class MessagingControlConfirmation(IntEnum): - kNotRequired = 0x00 - kRequired = 0x80 - - class MessagingControlEnhancedConfirmation(IntEnum): - kNotRequired = 0x00 - kRequired = 0x20 - - class MessagingControlImportance(IntEnum): - kLow = 0x00 - kMedium = 0x04 - kHigh = 0x08 - kCritical = 0x0C - - class MessagingControlTransmission(IntEnum): - kNormal = 0x00 - kNormalAndAnonymous = 0x01 - kAnonymous = 0x02 - kReserved = 0x03 - - - - class Commands: - @dataclass - class DisplayMessage(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0703 - command_id: typing.ClassVar[int] = 0x0000 - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="messageId", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="messageControl", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="startTime", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="durationInMinutes", Tag=3, Type=uint), - ClusterObjectFieldDescriptor(Label="message", Tag=4, Type=str), - ClusterObjectFieldDescriptor(Label="optionalExtendedMessageControl", Tag=5, Type=uint), - ]) - - messageId: 'uint' = 0 - messageControl: 'uint' = 0 - startTime: 'uint' = 0 - durationInMinutes: 'uint' = 0 - message: 'str' = "" - optionalExtendedMessageControl: 'uint' = 0 - - @dataclass - class GetLastMessage(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0703 - command_id: typing.ClassVar[int] = 0x0000 - is_client: typing.ClassVar[bool] = True - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ]) - - - @dataclass - class CancelMessage(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0703 - command_id: typing.ClassVar[int] = 0x0001 - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="messageId", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="messageControl", Tag=1, Type=uint), - ]) - - messageId: 'uint' = 0 - messageControl: 'uint' = 0 - - @dataclass - class MessageConfirmation(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0703 - command_id: typing.ClassVar[int] = 0x0001 - is_client: typing.ClassVar[bool] = True - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="messageId", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="confirmationTime", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="messageConfirmationControl", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="messageResponse", Tag=3, Type=bytes), - ]) - - messageId: 'uint' = 0 - confirmationTime: 'uint' = 0 - messageConfirmationControl: 'uint' = 0 - messageResponse: 'bytes' = b"" - - @dataclass - class DisplayProtectedMessage(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0703 - command_id: typing.ClassVar[int] = 0x0002 - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="messageId", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="messageControl", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="startTime", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="durationInMinutes", Tag=3, Type=uint), - ClusterObjectFieldDescriptor(Label="message", Tag=4, Type=str), - ClusterObjectFieldDescriptor(Label="optionalExtendedMessageControl", Tag=5, Type=uint), - ]) - - messageId: 'uint' = 0 - messageControl: 'uint' = 0 - startTime: 'uint' = 0 - durationInMinutes: 'uint' = 0 - message: 'str' = "" - optionalExtendedMessageControl: 'uint' = 0 - - @dataclass - class GetMessageCancellation(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0703 - command_id: typing.ClassVar[int] = 0x0002 - is_client: typing.ClassVar[bool] = True - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="earliestImplementationTime", Tag=0, Type=uint), - ]) - - earliestImplementationTime: 'uint' = 0 - - @dataclass - class CancelAllMessages(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0703 - command_id: typing.ClassVar[int] = 0x0003 - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="implementationDateTime", Tag=0, Type=uint), - ]) - - implementationDateTime: 'uint' = 0 - - - class Attributes: - @dataclass - class GeneratedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0703 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF8 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AcceptedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0703 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF9 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AttributeList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0703 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFB - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class FeatureMap(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0703 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFC - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class ClusterRevision(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0703 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFD - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - - @dataclass class ApplianceIdentification(Cluster): id: typing.ClassVar[int] = 0x0B00 diff --git a/src/controller/python/templates/python-CHIPClusters-py.zapt b/src/controller/python/templates/python-CHIPClusters-py.zapt index baf1a695e92962..79dabca16eca69 100644 --- a/src/controller/python/templates/python-CHIPClusters-py.zapt +++ b/src/controller/python/templates/python-CHIPClusters-py.zapt @@ -3,8 +3,6 @@ ''' import ctypes -from chip.ChipStack import * -from chip.exceptions import * __all__ = ["ChipClusters"] diff --git a/src/credentials/CHIPCert.cpp b/src/credentials/CHIPCert.cpp index 7f11430cd2a634..8dd1a9797d13ed 100644 --- a/src/credentials/CHIPCert.cpp +++ b/src/credentials/CHIPCert.cpp @@ -384,11 +384,15 @@ CHIP_ERROR ChipCertificateSet::ValidateCert(const ChipCertificateData * cert, Va { if (context.mEffectiveTime.Get().count() < cert->mNotBeforeTime) { + ChipLogDetail(SecureChannel, "Certificate's mNotBeforeTime (%" PRIu32 ") is after current time (%" PRIu32 ")", + cert->mNotBeforeTime, context.mEffectiveTime.Get().count()); validityResult = CertificateValidityResult::kNotYetValid; } else if (cert->mNotAfterTime != kNullCertTime && context.mEffectiveTime.Get().count() > cert->mNotAfterTime) { + ChipLogDetail(SecureChannel, "Certificate's mNotAfterTime (%" PRIu32 ") is before current time (%" PRIu32 ")", + cert->mNotAfterTime, context.mEffectiveTime.Get().count()); validityResult = CertificateValidityResult::kExpired; } else @@ -407,6 +411,8 @@ CHIP_ERROR ChipCertificateSet::ValidateCert(const ChipCertificateData * cert, Va // certificate in question is expired. Check for this. if (cert->mNotAfterTime != 0 && context.mEffectiveTime.Get().count() > cert->mNotAfterTime) { + ChipLogDetail(SecureChannel, "Certificate's mNotAfterTime (%" PRIu32 ") is before last known good time (%" PRIu32 ")", + cert->mNotAfterTime, context.mEffectiveTime.Get().count()); validityResult = CertificateValidityResult::kExpiredAtLastKnownGoodTime; } else diff --git a/src/credentials/FabricTable.cpp b/src/credentials/FabricTable.cpp index f854956f067a64..bf380af1a74136 100644 --- a/src/credentials/FabricTable.cpp +++ b/src/credentials/FabricTable.cpp @@ -226,8 +226,18 @@ CHIP_ERROR FabricTable::DeleteMetadataFromStorage(FabricIndex fabricIndex) if (deleteErr != CHIP_NO_ERROR) { - ChipLogError(FabricProvisioning, "Error deleting part of fabric %d: %" CHIP_ERROR_FORMAT, fabricIndex, deleteErr.Format()); + if (deleteErr == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND) + { + ChipLogError(FabricProvisioning, "Warning: metadata not found during delete of fabric 0x%x", + static_cast(fabricIndex)); + } + else + { + ChipLogError(FabricProvisioning, "Error deleting metadata for fabric fabric 0x%x: %" CHIP_ERROR_FORMAT, + static_cast(fabricIndex), deleteErr.Format()); + } } + return deleteErr; } @@ -1733,6 +1743,7 @@ CHIP_ERROR FabricTable::CommitPendingFabricData() bool isAdding = mStateFlags.Has(StateFlags::kIsAddPending); bool isUpdating = mStateFlags.Has(StateFlags::kIsUpdatePending); bool hasPending = mStateFlags.Has(StateFlags::kIsPendingFabricDataPresent); + bool onlyHaveNewTrustedRoot = hasPending && haveNewTrustedRoot && !(isAdding || isUpdating); bool hasInvalidInternalState = hasPending && (!IsValidFabricIndex(mFabricIndexWithPendingState) || !(isAdding || isUpdating)); FabricIndex fabricIndexBeingCommitted = mFabricIndexWithPendingState; @@ -1783,20 +1794,20 @@ CHIP_ERROR FabricTable::CommitPendingFabricData() // If there was nothing pending, we are either in a completely OK state, or weird internally inconsistent // state. In either case, let's clear all pending state anyway, in case it was partially stale! - if (!hasPending || hasInvalidInternalState) + if (!hasPending || onlyHaveNewTrustedRoot || hasInvalidInternalState) { CHIP_ERROR err = CHIP_NO_ERROR; - if (hasInvalidInternalState) - { - ChipLogError(FabricProvisioning, "Failed to commit: internally inconsistent state!"); - err = CHIP_ERROR_INTERNAL; - } - else if (haveNewTrustedRoot) + + if (onlyHaveNewTrustedRoot) { ChipLogError(FabricProvisioning, "Failed to commit: tried to commit with only a new trusted root cert. No data committed."); - hasInvalidInternalState = true; - err = CHIP_ERROR_INCORRECT_STATE; + err = CHIP_ERROR_INCORRECT_STATE; + } + else if (hasInvalidInternalState) + { + ChipLogError(FabricProvisioning, "Failed to commit: internally inconsistent state!"); + err = CHIP_ERROR_INTERNAL; } else { @@ -2005,13 +2016,13 @@ void FabricTable::RevertPendingOpCertsExceptRoot() CHIP_ERROR FabricTable::SetFabricLabel(FabricIndex fabricIndex, const CharSpan & fabricLabel) { VerifyOrReturnError(mStorage != nullptr, CHIP_ERROR_INCORRECT_STATE); - VerifyOrReturnError(IsValidFabricIndex(fabricIndex), CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(IsValidFabricIndex(fabricIndex), CHIP_ERROR_INVALID_FABRIC_INDEX); ReturnErrorCodeIf(fabricLabel.size() > kFabricLabelMaxLengthInBytes, CHIP_ERROR_INVALID_ARGUMENT); FabricInfo * fabricInfo = GetMutableFabricByIndex(fabricIndex); bool fabricIsInitialized = (fabricInfo != nullptr) && fabricInfo->IsInitialized(); - VerifyOrReturnError(fabricIsInitialized, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(fabricIsInitialized, CHIP_ERROR_INVALID_FABRIC_INDEX); // Update fabric table current in-memory entry, whether pending or not ReturnErrorOnFailure(fabricInfo->SetFabricLabel(fabricLabel)); @@ -2025,4 +2036,13 @@ CHIP_ERROR FabricTable::SetFabricLabel(FabricIndex fabricIndex, const CharSpan & return CHIP_NO_ERROR; } +CHIP_ERROR FabricTable::GetFabricLabel(FabricIndex fabricIndex, CharSpan & outFabricLabel) +{ + const FabricInfo * fabricInfo = FindFabricWithIndex(fabricIndex); + VerifyOrReturnError(fabricInfo != nullptr, CHIP_ERROR_INVALID_FABRIC_INDEX); + + outFabricLabel = fabricInfo->GetFabricLabel(); + return CHIP_NO_ERROR; +} + } // namespace chip diff --git a/src/credentials/FabricTable.h b/src/credentials/FabricTable.h index 0336dcc1a88d19..68f9f9c8e132a1 100644 --- a/src/credentials/FabricTable.h +++ b/src/credentials/FabricTable.h @@ -435,12 +435,37 @@ class DLL_EXPORT FabricTable CHIP_ERROR AddFabricDelegate(FabricTable::Delegate * delegate); void RemoveFabricDelegate(FabricTable::Delegate * delegate); - // Set the Fabric Label for the given fabricIndex. If a fabric add/update is pending, - // only the pending version will be updated, so that on fail-safe expiry, you would - // actually see the only fabric label if Update fails. If the fabric label is - // set before UpdateNOC, then the change is immediate. + /** + * @brief Set the Fabric Label for the fabric referred by `fabricIndex`. + * + * If a fabric add/update is pending, only the pending version will be updated, + * so that on fail-safe expiry, you would actually see the only fabric label if + * Update fails. If the fabric label is set before UpdateNOC, then the change is immediate. + * + * @param fabricIndex - Fabric Index for which to set the label + * @param fabricLabel - Label to set on the fabric + * @retval CHIP_NO_ERROR on success + * @retval CHIP_ERROR_INVALID_FABRIC_INDEX if fabricIndex does not refer to an fabric in the table + * @retval CHIP_ERROR_INVALID_ARGUMENT on fabric label error (e.g. too large) + * @retval other CHIP_ERROR on internal errors + */ CHIP_ERROR SetFabricLabel(FabricIndex fabricIndex, const CharSpan & fabricLabel); + /** + * @brief Get the Fabric Label for a given fabric + * + * NOTE: The outFabricLabel argument points to internal memory of the fabric info. + * It may become invalid on the next FabricTable API call due to shadow + * storage of data. + * + * @param fabricIndex - Fabric index for which to get the label + * @param outFabricLabel - char span that will be set to the label value + * @retval CHIP_NO_ERROR on success + * @retval CHIP_ERROR_INVALID_FABRIC_INDEX on error + * @retval other CHIP_ERROR on internal errors + */ + CHIP_ERROR GetFabricLabel(FabricIndex fabricIndex, CharSpan & outFabricLabel); + /** * Get the current Last Known Good Time. * @@ -692,10 +717,11 @@ class DLL_EXPORT FabricTable * @param vendorId - VendorID to use for the new fabric * @param outNewFabricIndex - Pointer where the new fabric index for the fabric just added will be set. Cannot be nullptr. * - * @retval CHIP_NO_ERROR on success - * @retval CHIP_ERROR_INCORRECT_STATE if this is called in an inconsistent order - * @retval CHIP_ERROR_NO_MEMORY if there is insufficient memory to make the fabric pending + * @retval CHIP_NO_ERROR on success. + * @retval CHIP_ERROR_INCORRECT_STATE if this is called in an inconsistent order. + * @retval CHIP_ERROR_NO_MEMORY if there is insufficient memory to make the fabric pending. * @retval CHIP_ERROR_INVALID_ARGUMENT if any of the arguments are invalid such as too large or out of bounds. + * @retval CHIP_ERROR_FABRIC_EXISTS if operational identity collides with one already present. * @retval other CHIP_ERROR_* on internal errors or certificate validation errors. */ CHIP_ERROR AddNewPendingFabricWithOperationalKeystore(const ByteSpan & noc, const ByteSpan & icac, uint16_t vendorId, @@ -725,10 +751,11 @@ class DLL_EXPORT FabricTable * copied using P256Keypair::Serialize/Deserialize and owned in heap of a FabricInfo. * @param outNewFabricIndex - Pointer where the new fabric index for the fabric just added will be set. Cannot be nullptr. * - * @retval CHIP_NO_ERROR on success - * @retval CHIP_ERROR_INCORRECT_STATE if this is called in an inconsistent order - * @retval CHIP_ERROR_NO_MEMORY if there is insufficient memory to make the fabric pending + * @retval CHIP_NO_ERROR on success. + * @retval CHIP_ERROR_INCORRECT_STATE if this is called in an inconsistent order. + * @retval CHIP_ERROR_NO_MEMORY if there is insufficient memory to make the fabric pending. * @retval CHIP_ERROR_INVALID_ARGUMENT if any of the arguments are invalid such as too large or out of bounds. + * @retval CHIP_ERROR_FABRIC_EXISTS if operational identity collides with one already present. * @retval other CHIP_ERROR_* on internal errors or certificate validation errors. */ CHIP_ERROR AddNewPendingFabricWithProvidedOpKey(const ByteSpan & noc, const ByteSpan & icac, uint16_t vendorId, diff --git a/src/credentials/tests/TestFabricTable.cpp b/src/credentials/tests/TestFabricTable.cpp index 400c5820e5bfba..2b8debafffa37d 100644 --- a/src/credentials/tests/TestFabricTable.cpp +++ b/src/credentials/tests/TestFabricTable.cpp @@ -1757,7 +1757,140 @@ void TestSequenceErrors(nlTestSuite * inSuite, void * inContext) void TestFabricLabelChange(nlTestSuite * inSuite, void * inContext) { - // TODO: Write test + Credentials::TestOnlyLocalCertificateAuthority fabricCertAuthority; + + chip::TestPersistentStorageDelegate storage; + NL_TEST_ASSERT(inSuite, fabricCertAuthority.Init().IsSuccess()); + + constexpr uint16_t kVendorId = 0xFFF1u; + + // Initialize a fabric table. + ScopedFabricTable fabricTableHolder; + NL_TEST_ASSERT(inSuite, fabricTableHolder.Init(&storage) == CHIP_NO_ERROR); + FabricTable & fabricTable = fabricTableHolder.GetFabricTable(); + + NL_TEST_ASSERT_EQUALS(inSuite, fabricTable.FabricCount(), 0); + + // First scope: add FabricID 1111, node ID 55 + { + FabricId fabricId = 1111; + NodeId nodeId = 55; + + uint8_t csrBuf[chip::Crypto::kMAX_CSR_Length]; + MutableByteSpan csrSpan{ csrBuf }; + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.AllocatePendingOperationalKey(chip::NullOptional, csrSpan)); + + NL_TEST_ASSERT_SUCCESS(inSuite, + fabricCertAuthority.SetIncludeIcac(true).GenerateNocChain(fabricId, nodeId, csrSpan).GetStatus()); + ByteSpan rcac = fabricCertAuthority.GetRcac(); + ByteSpan icac = fabricCertAuthority.GetIcac(); + ByteSpan noc = fabricCertAuthority.GetNoc(); + + NL_TEST_ASSERT_EQUALS(inSuite, fabricTable.FabricCount(), 0); + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.AddNewPendingTrustedRootCert(rcac)); + FabricIndex newFabricIndex = kUndefinedFabricIndex; + NL_TEST_ASSERT_SUCCESS(inSuite, + fabricTable.AddNewPendingFabricWithOperationalKeystore(noc, icac, kVendorId, &newFabricIndex)); + NL_TEST_ASSERT_EQUALS(inSuite, fabricTable.FabricCount(), 1); + NL_TEST_ASSERT(inSuite, newFabricIndex == 1); + + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.CommitPendingFabricData()); + + // Validate contents + const auto * fabricInfo = fabricTable.FindFabricWithIndex(1); + NL_TEST_ASSERT(inSuite, fabricInfo != nullptr); + if (fabricInfo != nullptr) + { + NL_TEST_ASSERT(inSuite, fabricInfo->GetFabricIndex() == 1); + NL_TEST_ASSERT(inSuite, fabricInfo->GetNodeId() == 55); + NL_TEST_ASSERT(inSuite, fabricInfo->GetFabricId() == 1111); + NL_TEST_ASSERT(inSuite, fabricInfo->GetVendorId() == kVendorId); + NL_TEST_ASSERT(inSuite, fabricInfo->GetFabricLabel().size() == 0); + } + } + size_t numStorageKeysAfterFirstAdd = storage.GetNumKeys(); + NL_TEST_ASSERT(inSuite, numStorageKeysAfterFirstAdd == 7); // Metadata, index, 3 certs, 1 opkey, last known good time + + // Second scope: set FabricLabel to "acme fabric", make sure it cannot be reverted + { + // Fabric label starts unset from prior scope + CharSpan fabricLabel = CharSpan::fromCharString("placeholder"); + + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.GetFabricLabel(1, fabricLabel)); + NL_TEST_ASSERT(inSuite, fabricLabel.size() == 0); + + // Set a valid name + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.SetFabricLabel(1, CharSpan::fromCharString("acme fabric"))); + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.GetFabricLabel(1, fabricLabel)); + NL_TEST_ASSERT(inSuite, fabricLabel.data_equal(CharSpan::fromCharString("acme fabric")) == true); + + // Revert pending fabric data. Should not revert name since nothing pending. + fabricTable.RevertPendingFabricData(); + + fabricLabel = CharSpan::fromCharString("placeholder"); + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.GetFabricLabel(1, fabricLabel)); + NL_TEST_ASSERT(inSuite, fabricLabel.data_equal(CharSpan::fromCharString("acme fabric")) == true); + + // Verify we fail to set too large a label (> kFabricLabelMaxLengthInBytes) + CharSpan fabricLabelTooBig = CharSpan::fromCharString("012345678901234567890123456789123456"); + NL_TEST_ASSERT(inSuite, fabricLabelTooBig.size() > chip::kFabricLabelMaxLengthInBytes); + + NL_TEST_ASSERT(inSuite, fabricTable.SetFabricLabel(1, fabricLabelTooBig) == CHIP_ERROR_INVALID_ARGUMENT); + + fabricLabel = CharSpan::fromCharString("placeholder"); + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.GetFabricLabel(1, fabricLabel)); + NL_TEST_ASSERT(inSuite, fabricLabel.data_equal(CharSpan::fromCharString("acme fabric")) == true); + } + + // Third scope: set fabric label after an update, it sticks, but then goes back after revert + { + FabricId fabricId = 1111; + NodeId nodeId = 66; // Update node ID from 55 to 66 + + uint8_t csrBuf[chip::Crypto::kMAX_CSR_Length]; + MutableByteSpan csrSpan{ csrBuf }; + NL_TEST_ASSERT_SUCCESS(inSuite, + fabricTable.AllocatePendingOperationalKey(chip::MakeOptional(static_cast(1)), csrSpan)); + + NL_TEST_ASSERT_SUCCESS(inSuite, + fabricCertAuthority.SetIncludeIcac(true).GenerateNocChain(fabricId, nodeId, csrSpan).GetStatus()); + ByteSpan icac = fabricCertAuthority.GetIcac(); + ByteSpan noc = fabricCertAuthority.GetNoc(); + + NL_TEST_ASSERT_EQUALS(inSuite, fabricTable.FabricCount(), 1); + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.UpdatePendingFabricWithOperationalKeystore(1, noc, icac)); + NL_TEST_ASSERT_EQUALS(inSuite, fabricTable.FabricCount(), 1); + + // Validate contents prior to change/revert + const auto * fabricInfo = fabricTable.FindFabricWithIndex(1); + NL_TEST_ASSERT(inSuite, fabricInfo != nullptr); + + if (fabricInfo != nullptr) + { + NL_TEST_ASSERT(inSuite, fabricInfo->GetFabricIndex() == 1); + NL_TEST_ASSERT(inSuite, fabricInfo->GetNodeId() == 66); + NL_TEST_ASSERT(inSuite, fabricInfo->GetFabricId() == 1111); + NL_TEST_ASSERT(inSuite, fabricInfo->GetVendorId() == kVendorId); + + CharSpan fabricLabel = fabricInfo->GetFabricLabel(); + NL_TEST_ASSERT(inSuite, fabricLabel.data_equal(CharSpan::fromCharString("acme fabric")) == true); + } + + // Update fabric label + CharSpan fabricLabel = CharSpan::fromCharString("placeholder"); + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.SetFabricLabel(1, CharSpan::fromCharString("roboto fabric"))); + + fabricLabel = CharSpan::fromCharString("placeholder"); + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.GetFabricLabel(1, fabricLabel)); + NL_TEST_ASSERT(inSuite, fabricLabel.data_equal(CharSpan::fromCharString("roboto fabric")) == true); + + // Revert pending fabric data. Should revert name to "acme fabric" + fabricTable.RevertPendingFabricData(); + + fabricLabel = CharSpan::fromCharString("placeholder"); + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.GetFabricLabel(1, fabricLabel)); + NL_TEST_ASSERT(inSuite, fabricLabel.data_equal(CharSpan::fromCharString("acme fabric")) == true); + } } void TestCompressedFabricId(nlTestSuite * inSuite, void * inContext) @@ -1841,9 +1974,177 @@ void TestFetchCATs(nlTestSuite * inSuite, void * inContext) // TODO(#20335): Add test cases for NOCs that actually embed CATs } +// Validate that adding the same fabric twice fails (same root, same FabricId) void TestAddNocRootCollision(nlTestSuite * inSuite, void * inContext) { - // TODO: Write test + Credentials::TestOnlyLocalCertificateAuthority fabricCertAuthority; + + chip::TestPersistentStorageDelegate storage; + NL_TEST_ASSERT(inSuite, fabricCertAuthority.Init().IsSuccess()); + + constexpr uint16_t kVendorId = 0xFFF1u; + + // Initialize a fabric table. + ScopedFabricTable fabricTableHolder; + NL_TEST_ASSERT(inSuite, fabricTableHolder.Init(&storage) == CHIP_NO_ERROR); + FabricTable & fabricTable = fabricTableHolder.GetFabricTable(); + + NL_TEST_ASSERT_EQUALS(inSuite, fabricTable.FabricCount(), 0); + + // First scope: add FabricID 1111, node ID 55 + { + FabricId fabricId = 1111; + NodeId nodeId = 55; + + uint8_t csrBuf[chip::Crypto::kMAX_CSR_Length]; + MutableByteSpan csrSpan{ csrBuf }; + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.AllocatePendingOperationalKey(chip::NullOptional, csrSpan)); + + NL_TEST_ASSERT_SUCCESS(inSuite, + fabricCertAuthority.SetIncludeIcac(true).GenerateNocChain(fabricId, nodeId, csrSpan).GetStatus()); + ByteSpan rcac = fabricCertAuthority.GetRcac(); + ByteSpan icac = fabricCertAuthority.GetIcac(); + ByteSpan noc = fabricCertAuthority.GetNoc(); + + NL_TEST_ASSERT_EQUALS(inSuite, fabricTable.FabricCount(), 0); + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.AddNewPendingTrustedRootCert(rcac)); + FabricIndex newFabricIndex = kUndefinedFabricIndex; + NL_TEST_ASSERT_SUCCESS(inSuite, + fabricTable.AddNewPendingFabricWithOperationalKeystore(noc, icac, kVendorId, &newFabricIndex)); + NL_TEST_ASSERT_EQUALS(inSuite, fabricTable.FabricCount(), 1); + NL_TEST_ASSERT(inSuite, newFabricIndex == 1); + + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.CommitPendingFabricData()); + + // Validate contents + const auto * fabricInfo = fabricTable.FindFabricWithIndex(1); + NL_TEST_ASSERT(inSuite, fabricInfo != nullptr); + if (fabricInfo != nullptr) + { + Credentials::ChipCertificateSet certificates; + NL_TEST_ASSERT_SUCCESS(inSuite, certificates.Init(1)); + NL_TEST_ASSERT_SUCCESS(inSuite, + certificates.LoadCert(rcac, BitFlags(CertDecodeFlags::kIsTrustAnchor))); + Crypto::P256PublicKey rcacPublicKey(certificates.GetCertSet()[0].mPublicKey); + + NL_TEST_ASSERT(inSuite, fabricInfo->GetFabricIndex() == 1); + NL_TEST_ASSERT(inSuite, fabricInfo->GetNodeId() == 55); + NL_TEST_ASSERT(inSuite, fabricInfo->GetFabricId() == 1111); + NL_TEST_ASSERT(inSuite, fabricInfo->GetVendorId() == kVendorId); + NL_TEST_ASSERT(inSuite, fabricInfo->GetFabricLabel().size() == 0); + + Crypto::P256PublicKey rootPublicKeyOfFabric; + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.FetchRootPubkey(newFabricIndex, rootPublicKeyOfFabric)); + NL_TEST_ASSERT(inSuite, rootPublicKeyOfFabric.Matches(rcacPublicKey)); + } + } + size_t numStorageKeysAfterFirstAdd = storage.GetNumKeys(); + NL_TEST_ASSERT(inSuite, numStorageKeysAfterFirstAdd == 7); // Metadata, index, 3 certs, 1 opkey, last known good time + + // Second scope: add FabricID 1111, node ID 55 *again* --> Collision of Root/FabricID with existing + { + FabricId fabricId = 1111; + NodeId nodeId = 55; + + uint8_t csrBuf[chip::Crypto::kMAX_CSR_Length]; + MutableByteSpan csrSpan{ csrBuf }; + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.AllocatePendingOperationalKey(chip::NullOptional, csrSpan)); + + NL_TEST_ASSERT_SUCCESS(inSuite, + fabricCertAuthority.SetIncludeIcac(true).GenerateNocChain(fabricId, nodeId, csrSpan).GetStatus()); + ByteSpan rcac = fabricCertAuthority.GetRcac(); + ByteSpan icac = fabricCertAuthority.GetIcac(); + ByteSpan noc = fabricCertAuthority.GetNoc(); + + NL_TEST_ASSERT_EQUALS(inSuite, fabricTable.FabricCount(), 1); + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.AddNewPendingTrustedRootCert(rcac)); + FabricIndex newFabricIndex = kUndefinedFabricIndex; + NL_TEST_ASSERT(inSuite, + fabricTable.AddNewPendingFabricWithOperationalKeystore(noc, icac, kVendorId, &newFabricIndex) == + CHIP_ERROR_FABRIC_EXISTS); + NL_TEST_ASSERT_EQUALS(inSuite, fabricTable.FabricCount(), 1); + + CHIP_ERROR err = fabricTable.CommitPendingFabricData(); + printf("err = %" CHIP_ERROR_FORMAT "\n", err.Format()); + NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INCORRECT_STATE); + + // Validate contents of Fabric index 1 still valid + const auto * fabricInfo = fabricTable.FindFabricWithIndex(1); + NL_TEST_ASSERT(inSuite, fabricInfo != nullptr); + if (fabricInfo != nullptr) + { + Credentials::ChipCertificateSet certificates; + NL_TEST_ASSERT_SUCCESS(inSuite, certificates.Init(1)); + NL_TEST_ASSERT_SUCCESS(inSuite, + certificates.LoadCert(rcac, BitFlags(CertDecodeFlags::kIsTrustAnchor))); + Crypto::P256PublicKey rcacPublicKey(certificates.GetCertSet()[0].mPublicKey); + + NL_TEST_ASSERT(inSuite, fabricInfo->GetFabricIndex() == 1); + NL_TEST_ASSERT(inSuite, fabricInfo->GetNodeId() == 55); + NL_TEST_ASSERT(inSuite, fabricInfo->GetFabricId() == 1111); + NL_TEST_ASSERT(inSuite, fabricInfo->GetVendorId() == kVendorId); + NL_TEST_ASSERT(inSuite, fabricInfo->GetFabricLabel().size() == 0); + + Crypto::P256PublicKey rootPublicKeyOfFabric; + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.FetchRootPubkey(1, rootPublicKeyOfFabric)); + NL_TEST_ASSERT(inSuite, rootPublicKeyOfFabric.Matches(rcacPublicKey)); + } + } + + // Ensure no new persisted keys after failed colliding add + NL_TEST_ASSERT(inSuite, storage.GetNumKeys() == numStorageKeysAfterFirstAdd); + + // Third scope: add FabricID 2222, node ID 55 --> Not colliding, should work. The failing commit above] + // should have been enough of a revert that this scope succeeds without any additional revert. + { + FabricId fabricId = 2222; + NodeId nodeId = 55; + + uint8_t csrBuf[chip::Crypto::kMAX_CSR_Length]; + MutableByteSpan csrSpan{ csrBuf }; + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.AllocatePendingOperationalKey(chip::NullOptional, csrSpan)); + + NL_TEST_ASSERT_SUCCESS(inSuite, + fabricCertAuthority.SetIncludeIcac(true).GenerateNocChain(fabricId, nodeId, csrSpan).GetStatus()); + ByteSpan rcac = fabricCertAuthority.GetRcac(); + ByteSpan icac = fabricCertAuthority.GetIcac(); + ByteSpan noc = fabricCertAuthority.GetNoc(); + + NL_TEST_ASSERT_EQUALS(inSuite, fabricTable.FabricCount(), 1); + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.AddNewPendingTrustedRootCert(rcac)); + FabricIndex newFabricIndex = kUndefinedFabricIndex; + NL_TEST_ASSERT_SUCCESS(inSuite, + fabricTable.AddNewPendingFabricWithOperationalKeystore(noc, icac, kVendorId, &newFabricIndex)); + NL_TEST_ASSERT_EQUALS(inSuite, fabricTable.FabricCount(), 2); + NL_TEST_ASSERT(inSuite, newFabricIndex == 2); + + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.CommitPendingFabricData()); + + // Validate contents + const auto * fabricInfo = fabricTable.FindFabricWithIndex(2); + NL_TEST_ASSERT(inSuite, fabricInfo != nullptr); + if (fabricInfo != nullptr) + { + Credentials::ChipCertificateSet certificates; + NL_TEST_ASSERT_SUCCESS(inSuite, certificates.Init(1)); + NL_TEST_ASSERT_SUCCESS(inSuite, + certificates.LoadCert(rcac, BitFlags(CertDecodeFlags::kIsTrustAnchor))); + Crypto::P256PublicKey rcacPublicKey(certificates.GetCertSet()[0].mPublicKey); + + NL_TEST_ASSERT(inSuite, fabricInfo->GetFabricIndex() == 2); + NL_TEST_ASSERT(inSuite, fabricInfo->GetNodeId() == 55); + NL_TEST_ASSERT(inSuite, fabricInfo->GetFabricId() == 2222); + NL_TEST_ASSERT(inSuite, fabricInfo->GetVendorId() == kVendorId); + NL_TEST_ASSERT(inSuite, fabricInfo->GetFabricLabel().size() == 0); + + Crypto::P256PublicKey rootPublicKeyOfFabric; + NL_TEST_ASSERT_SUCCESS(inSuite, fabricTable.FetchRootPubkey(newFabricIndex, rootPublicKeyOfFabric)); + NL_TEST_ASSERT(inSuite, rootPublicKeyOfFabric.Matches(rcacPublicKey)); + } + } + size_t numStorageKeysAfterSecondAdd = storage.GetNumKeys(); + + NL_TEST_ASSERT(inSuite, numStorageKeysAfterSecondAdd == (numStorageKeysAfterFirstAdd + 5)); // Metadata, 3 certs, 1 opkey } void TestInvalidChaining(nlTestSuite * inSuite, void * inContext) diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/MultiAdmin/MultiAdminViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/MultiAdmin/MultiAdminViewController.m index 34932ad2dd2126..1a4524faa0f481 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/MultiAdmin/MultiAdminViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/MultiAdmin/MultiAdminViewController.m @@ -199,7 +199,7 @@ - (IBAction)overrideControls:(id)sender - (IBAction)openPairingWindow:(id)sender { - uint32_t setupPIN = arc4random(); + NSUInteger setupPIN = [MTRSetupPayload generateRandomPIN]; [_deviceSelector forSelectedDevices:^(uint64_t deviceId) { if (MTRGetConnectedDeviceWithID(deviceId, ^(MTRBaseDevice * _Nullable chipDevice, NSError * _Nullable error) { if (chipDevice) { diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 2a8f6dcac23d9a..a5c9565e4d8222 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -583,7 +583,13 @@ - (NSString *)openPairingWindowWithPIN:(uint64_t)deviceID return rv; } - setupPIN &= ((1 << chip::kSetupPINCodeFieldLengthInBits) - 1); + if (!chip::CanCastTo(setupPIN) || !chip::SetupPayload::IsValidSetupPIN(static_cast(setupPIN))) { + MTR_LOG_ERROR("Error: Setup pin %lu is not valid", setupPIN); + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_INTEGER_VALUE]; + } + return rv; + } dispatch_sync(_chipWorkQueue, ^{ VerifyOrReturn([self checkIsRunning:error]); diff --git a/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm b/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm index b5675ca4f79bbe..c4ca0caf0238bf 100644 --- a/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm +++ b/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm @@ -18,6 +18,7 @@ #import "MTROTAProviderDelegateBridge.h" #include +#include static NSInteger const kOtaProviderEndpoint = 0; @@ -30,13 +31,8 @@ void MTROTAProviderDelegateBridge::setDelegate(id delegate, dispatch_queue_t queue) { - if (delegate && queue) { - mDelegate = delegate; - mQueue = queue; - } else { - mDelegate = nil; - mQueue = nil; - } + mDelegate = delegate ?: nil; + mQueue = queue ?: nil; chip::app::Clusters::OTAProvider::SetDelegate(kOtaProviderEndpoint, this); } @@ -60,14 +56,16 @@ [strongDelegate handleQueryImage:commandParams completionHandler:^(MTROtaSoftwareUpdateProviderClusterQueryImageResponseParams * _Nullable data, NSError * _Nullable error) { - chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::Type response; - ConvertFromQueryImageResponseParms(data, response); - - chip::app::CommandHandler * handler = handle.Get(); - if (handler) { - handler->AddResponse(cachedCommandPath, response); - handle.Release(); - } + dispatch_async(chip::DeviceLayer::PlatformMgrImpl().GetWorkQueue(), ^{ + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::Type response; + ConvertFromQueryImageResponseParms(data, response); + + chip::app::CommandHandler * handler = handle.Get(); + if (handler) { + handler->AddResponse(cachedCommandPath, response); + handle.Release(); + } + }); }]; }); } @@ -94,14 +92,16 @@ handleApplyUpdateRequest:commandParams completionHandler:^(MTROtaSoftwareUpdateProviderClusterApplyUpdateResponseParams * _Nullable data, NSError * _Nullable error) { - chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::Type response; - ConvertFromApplyUpdateRequestResponseParms(data, response); - - chip::app::CommandHandler * handler = handle.Get(); - if (handler) { - handler->AddResponse(cachedCommandPath, response); - handle.Release(); - } + dispatch_async(chip::DeviceLayer::PlatformMgrImpl().GetWorkQueue(), ^{ + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::Type response; + ConvertFromApplyUpdateRequestResponseParms(data, response); + + chip::app::CommandHandler * handler = handle.Get(); + if (handler) { + handler->AddResponse(cachedCommandPath, response); + handle.Release(); + } + }); }]; }); } @@ -127,11 +127,13 @@ [strongDelegate handleNotifyUpdateApplied:commandParams completionHandler:^(NSError * _Nullable error) { - chip::app::CommandHandler * handler = handle.Get(); - if (handler) { - handler->AddStatus(cachedCommandPath, chip::Protocols::InteractionModel::Status::Success); - handle.Release(); - } + dispatch_async(chip::DeviceLayer::PlatformMgrImpl().GetWorkQueue(), ^{ + chip::app::CommandHandler * handler = handle.Get(); + if (handler) { + handler->AddStatus(cachedCommandPath, chip::Protocols::InteractionModel::Status::Success); + handle.Release(); + } + }); }]; }); } @@ -158,7 +160,9 @@ } if (commandData.location.HasValue()) { - commandParams.location = [NSString stringWithUTF8String:commandData.location.Value().data()]; + commandParams.location = [[NSString alloc] initWithBytes:commandData.location.Value().data() + length:commandData.location.Value().size() + encoding:NSUTF8StringEncoding]; } if (commandData.requestorCanConsent.HasValue()) { diff --git a/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.mm b/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.mm index 8b703e4b317b9b..3688c9a08f7433 100644 --- a/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.mm +++ b/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.mm @@ -172,10 +172,8 @@ bool MTROperationalCredentialsDelegate::ToChipEpochTime(uint32_t offset, uint32_t & epoch) { NSDate * date = [NSDate dateWithTimeIntervalSinceNow:offset]; - unsigned units = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute - | NSCalendarUnitSecond; NSCalendar * calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; - NSDateComponents * components = [calendar components:units fromDate:date]; + NSDateComponents * components = [calendar componentsInTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0] fromDate:date]; uint16_t year = static_cast([components year]); uint8_t month = static_cast([components month]); diff --git a/src/darwin/Framework/CHIP/MTRSetupPayload.h b/src/darwin/Framework/CHIP/MTRSetupPayload.h index 8b93980e57be41..61f98ca9c23920 100644 --- a/src/darwin/Framework/CHIP/MTRSetupPayload.h +++ b/src/darwin/Framework/CHIP/MTRSetupPayload.h @@ -62,6 +62,10 @@ typedef NS_ENUM(NSUInteger, MTROptionalQRCodeInfoType) { @property (nonatomic, strong) NSString * serialNumber; - (nullable NSArray *)getAllOptionalVendorData:(NSError * __autoreleasing *)error; +/** + * Generate a random Matter-valid setup PIN. + */ ++ (NSUInteger)generateRandomPIN; @end NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRSetupPayload.mm b/src/darwin/Framework/CHIP/MTRSetupPayload.mm index 8aaa5458cc8368..9e202b2f915094 100644 --- a/src/darwin/Framework/CHIP/MTRSetupPayload.mm +++ b/src/darwin/Framework/CHIP/MTRSetupPayload.mm @@ -108,6 +108,25 @@ - (void)getSerialNumber:(chip::SetupPayload)setupPayload return allOptionalData; } ++ (NSUInteger)generateRandomPIN +{ + do { + // Make sure the thing we generate is in the right range. + uint32_t setupPIN = arc4random_uniform(chip::kSetupPINCodeMaximumValue) + 1; + if (chip::SetupPayload::IsValidSetupPIN(setupPIN)) { + return setupPIN; + } + + // We got pretty unlikely with our random number generation. Just try + // again. The chance that this loop does not terminate in a reasonable + // amount of time is astronomically low, assuming arc4random_uniform is not + // broken. + } while (1); + + // Not reached. + return chip::kSetupPINCodeUndefinedValue; +} + #pragma mark - NSSecureCoding static NSString * const MTRSetupPayloadCodingKeyVersion = @"MTRSP.ck.version"; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 254177c4f9335a..4b61ec50ed0351 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -11221,6 +11221,289 @@ id MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & } break; } + case Clusters::BallastConfiguration::Id: { + using namespace Clusters::BallastConfiguration; + switch (aPath.mAttributeId) { + case Attributes::PhysicalMinLevel::Id: { + using TypeInfo = Attributes::PhysicalMinLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::PhysicalMaxLevel::Id: { + using TypeInfo = Attributes::PhysicalMaxLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::BallastStatus::Id: { + using TypeInfo = Attributes::BallastStatus::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::MinLevel::Id: { + using TypeInfo = Attributes::MinLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::MaxLevel::Id: { + using TypeInfo = Attributes::MaxLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::IntrinsicBalanceFactor::Id: { + using TypeInfo = Attributes::IntrinsicBalanceFactor::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::BallastFactorAdjustment::Id: { + using TypeInfo = Attributes::BallastFactorAdjustment::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::LampQuantity::Id: { + using TypeInfo = Attributes::LampQuantity::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::LampType::Id: { + using TypeInfo = Attributes::LampType::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = [[NSString alloc] initWithBytes:cppValue.data() length:cppValue.size() encoding:NSUTF8StringEncoding]; + return value; + } + case Attributes::LampManufacturer::Id: { + using TypeInfo = Attributes::LampManufacturer::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = [[NSString alloc] initWithBytes:cppValue.data() length:cppValue.size() encoding:NSUTF8StringEncoding]; + return value; + } + case Attributes::LampRatedHours::Id: { + using TypeInfo = Attributes::LampRatedHours::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 numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::LampBurnHours::Id: { + using TypeInfo = Attributes::LampBurnHours::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 numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::LampAlarmMode::Id: { + using TypeInfo = Attributes::LampAlarmMode::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::LampBurnHoursTripPoint::Id: { + using TypeInfo = Attributes::LampBurnHoursTripPoint::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 numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::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; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::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_IB; + break; + } + break; + } case Clusters::IlluminanceMeasurement::Id: { using namespace Clusters::IlluminanceMeasurement; switch (aPath.mAttributeId) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 9987040a7b9512..467e4eb284e3d0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -13917,6 +13917,404 @@ NS_ASSUME_NONNULL_BEGIN @end +/** + * Cluster Ballast Configuration + * + */ +@interface MTRBaseClusterBallastConfiguration : MTRCluster + +- (nullable instancetype)initWithDevice:(MTRBaseDevice *)device + endpoint:(uint16_t)endpoint + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER; + +- (void)readAttributePhysicalMinLevelWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributePhysicalMinLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributePhysicalMinLevelWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributePhysicalMaxLevelWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributePhysicalMaxLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributePhysicalMaxLevelWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeBallastStatusWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeBallastStatusWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeBallastStatusWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeMinLevelWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributeMinLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMinLevelWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeMinLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeMinLevelWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeMaxLevelWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeMaxLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeMaxLevelWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeIntrinsicBalanceFactorWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeIntrinsicBalanceFactorWithValue:(NSNumber * _Nullable)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeIntrinsicBalanceFactorWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeIntrinsicBalanceFactorWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeIntrinsicBalanceFactorWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeBallastFactorAdjustmentWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeBallastFactorAdjustmentWithValue:(NSNumber * _Nullable)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeBallastFactorAdjustmentWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeBallastFactorAdjustmentWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeBallastFactorAdjustmentWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeLampQuantityWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeLampQuantityWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeLampQuantityWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeLampTypeWithCompletionHandler:(void (^)( + NSString * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributeLampTypeWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeLampTypeWithValue:(NSString * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeLampTypeWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeLampTypeWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeLampManufacturerWithCompletionHandler:(void (^)(NSString * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeLampManufacturerWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeLampManufacturerWithValue:(NSString * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeLampManufacturerWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeLampManufacturerWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeLampRatedHoursWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeLampRatedHoursWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeLampRatedHoursWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeLampRatedHoursWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeLampRatedHoursWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeLampBurnHoursWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeLampBurnHoursWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeLampBurnHoursWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeLampBurnHoursWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeLampBurnHoursWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeLampAlarmModeWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeLampAlarmModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeLampAlarmModeWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeLampAlarmModeWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeLampAlarmModeWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeLampBurnHoursTripPointWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeLampBurnHoursTripPointWithValue:(NSNumber * _Nullable)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeLampBurnHoursTripPointWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeLampBurnHoursTripPointWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeLampBurnHoursTripPointWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeGeneratedCommandListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeAcceptedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeAcceptedCommandListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeAttributeListWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeAttributeListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeFeatureMapWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeFeatureMapWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeFeatureMapWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * MTRSubscribeParams. + */ +- (void)subscribeAttributeClusterRevisionWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeClusterRevisionWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + /** * Cluster Illuminance Measurement * @@ -22997,130 +23395,6 @@ typedef NS_ENUM(uint8_t, MTRApplicationBasicApplicationStatus) { MTRApplicationBasicApplicationStatusActiveVisibleNotFocus = 0x03, }; -typedef NS_ENUM(uint8_t, MTRMessagingEventId) { - MTRMessagingEventIdMeterCoverRemoved = 0x00, - MTRMessagingEventIdMeterCoverClosed = 0x01, - MTRMessagingEventIdStrongMagneticField = 0x02, - MTRMessagingEventIdNoStrongMagneticField = 0x03, - MTRMessagingEventIdBatteryFailure = 0x04, - MTRMessagingEventIdLowBattery = 0x05, - MTRMessagingEventIdProgramMemoryError = 0x06, - MTRMessagingEventIdRamError = 0x07, - MTRMessagingEventIdNvMemoryError = 0x08, - MTRMessagingEventIdMeasurementSystemError = 0x09, - MTRMessagingEventIdWatchdogError = 0x0A, - MTRMessagingEventIdSupplyDisconnectFailure = 0x0B, - MTRMessagingEventIdSupplyConnectFailure = 0x0C, - MTRMessagingEventIdMeasurmentSoftwareChanged = 0x0D, - MTRMessagingEventIdDstEnabled = 0x0E, - MTRMessagingEventIdDstDisabled = 0x0F, - MTRMessagingEventIdClockAdjBackward = 0x10, - MTRMessagingEventIdClockAdjForward = 0x11, - MTRMessagingEventIdClockInvalid = 0x12, - MTRMessagingEventIdCommsErrorHan = 0x13, - MTRMessagingEventIdCommsOkHan = 0x14, - MTRMessagingEventIdFraudAttempt = 0x15, - MTRMessagingEventIdPowerLoss = 0x16, - MTRMessagingEventIdIncorrectProtocol = 0x17, - MTRMessagingEventIdUnusualHanTraffic = 0x18, - MTRMessagingEventIdUnexpectedClockChange = 0x19, - MTRMessagingEventIdCommsUsingUnauthenticatedComponent = 0x1A, - MTRMessagingEventIdErrorRegClear = 0x1B, - MTRMessagingEventIdAlarmRegClear = 0x1C, - MTRMessagingEventIdUnexpectedHwReset = 0x1D, - MTRMessagingEventIdUnexpectedProgramExecution = 0x1E, - MTRMessagingEventIdEventLogCleared = 0x1F, - MTRMessagingEventIdManualDisconnect = 0x20, - MTRMessagingEventIdManualConnect = 0x21, - MTRMessagingEventIdRemoteDisconnection = 0x22, - MTRMessagingEventIdLocalDisconnection = 0x23, - MTRMessagingEventIdLimitThresholdExceeded = 0x24, - MTRMessagingEventIdLimitThresholdOk = 0x25, - MTRMessagingEventIdLimitThresholdChanged = 0x26, - MTRMessagingEventIdMaximumDemandExceeded = 0x27, - MTRMessagingEventIdProfileCleared = 0x28, - MTRMessagingEventIdFirmwareReadyForActivation = 0x29, - MTRMessagingEventIdFirmwareActivated = 0x2A, - MTRMessagingEventIdPatchFailure = 0x2B, - MTRMessagingEventIdTouTariffActivation = 0x2C, - MTRMessagingEventId8x8Tariffactivated = 0x2D, - MTRMessagingEventIdSingleTariffRateActivated = 0x2E, - MTRMessagingEventIdAsynchronousBillingOccurred = 0x2F, - MTRMessagingEventIdSynchronousBillingOccurred = 0x30, - MTRMessagingEventIdIncorrectPolarity = 0x80, - MTRMessagingEventIdCurrentNoVoltage = 0x81, - MTRMessagingEventIdUnderVoltage = 0x82, - MTRMessagingEventIdOverVoltage = 0x83, - MTRMessagingEventIdNormalVoltage = 0x84, - MTRMessagingEventIdPfBelowThreshold = 0x85, - MTRMessagingEventIdPfAboveThreshold = 0x86, - MTRMessagingEventIdTerminalCoverRemoved = 0x87, - MTRMessagingEventIdTerminalCoverClosed = 0x88, - MTRMessagingEventIdReverseFlow = 0xA0, - MTRMessagingEventIdTiltTamper = 0xA1, - MTRMessagingEventIdBatteryCoverRemoved = 0xA2, - MTRMessagingEventIdBatteryCoverClosed = 0xA3, - MTRMessagingEventIdExcessFlow = 0xA4, - MTRMessagingEventIdCreditOk = 0xC0, - MTRMessagingEventIdLowCredit = 0xC1, - MTRMessagingEventIdEmergencyCreditInUse = 0xC0, - MTRMessagingEventIdEmergencyCreditExhausted = 0xC1, - MTRMessagingEventIdZeroCreditEcNotSelected = 0xC2, - MTRMessagingEventIdSupplyOn = 0xC3, - MTRMessagingEventIdSupplyOffAarmed = 0xC4, - MTRMessagingEventIdSupplyOff = 0xC5, - MTRMessagingEventIdDiscountApplied = 0xC6, - MTRMessagingEventIdManufacturerSpecificA = 0xE0, - MTRMessagingEventIdManufacturerSpecificB = 0xE1, - MTRMessagingEventIdManufacturerSpecificC = 0xE2, - MTRMessagingEventIdManufacturerSpecificD = 0xE3, - MTRMessagingEventIdManufacturerSpecificE = 0xE4, - MTRMessagingEventIdManufacturerSpecificF = 0xE5, - MTRMessagingEventIdManufacturerSpecificG = 0xE6, - MTRMessagingEventIdManufacturerSpecificH = 0xE7, - MTRMessagingEventIdManufacturerSpecificI = 0xE8, -}; - -typedef NS_ENUM(uint8_t, MTRMessagingControlConfirmation) { - MTRMessagingControlConfirmationNotRequired = 0x00, - MTRMessagingControlConfirmationRequired = 0x80, -}; - -typedef NS_ENUM(uint8_t, MTRMessagingControlEnhancedConfirmation) { - MTRMessagingControlEnhancedConfirmationNotRequired = 0x00, - MTRMessagingControlEnhancedConfirmationRequired = 0x20, -}; - -typedef NS_ENUM(uint8_t, MTRMessagingControlImportance) { - MTRMessagingControlImportanceLow = 0x00, - MTRMessagingControlImportanceMedium = 0x04, - MTRMessagingControlImportanceHigh = 0x08, - MTRMessagingControlImportanceCritical = 0x0C, -}; - -typedef NS_ENUM(uint8_t, MTRMessagingControlTransmission) { - MTRMessagingControlTransmissionNormal = 0x00, - MTRMessagingControlTransmissionNormalAndAnonymous = 0x01, - MTRMessagingControlTransmissionAnonymous = 0x02, - MTRMessagingControlTransmissionReserved = 0x03, -}; - -typedef NS_OPTIONS(uint8_t, MTRMessagingConfirmationControl) { - MTRMessagingConfirmationControlNoReturned = 0x1, - MTRMessagingConfirmationControlYesReturned = 0x2, -}; - -typedef NS_OPTIONS(uint8_t, MTRMessagingControlMask) { - MTRMessagingControlMaskTransMechanism = 0x3, - MTRMessagingControlMaskMessageUrgency = 0xC, - MTRMessagingControlMaskEnhancedConfirmationRequest = 0x20, - MTRMessagingControlMaskMessageConfirmation = 0x80, -}; - -typedef NS_OPTIONS(uint8_t, MTRMessagingExtendedControlMask) { - MTRMessagingExtendedControlMaskMessageConfirmationStatus = 0x1, -}; - typedef NS_ENUM(uint8_t, MTRApplianceEventsAndAlertEventIdentification) { MTRApplianceEventsAndAlertEventIdentificationEndOfCycle = 0x01, MTRApplianceEventsAndAlertEventIdentificationTemperatureReached = 0x04, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index a90cdb0d88e814..0a987741f0fb1a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -52961,6 +52961,1582 @@ - (void)dealloc @end +@implementation MTRBaseClusterBallastConfiguration + +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + // Must allocate cppCluster on the Matter queue. + dispatch_sync(chip::DeviceLayer::PlatformMgrImpl().GetWorkQueue(), ^{ + *[self cppClusterSlot] = new chip::Controller::BallastConfigurationCluster( + *[device internalDevice]->GetExchangeManager(), [device internalDevice]->GetSecureSession().Value(), endpoint); + }); + if (self.cppCluster == nullptr) { + return nil; + } + } + return self; +} + +- (chip::Controller::BallastConfigurationCluster **)cppClusterSlot +{ + return &_cppCluster; +} + +- (void)readAttributePhysicalMinLevelWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::PhysicalMinLevel::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributePhysicalMinLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::PhysicalMinLevel::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributePhysicalMinLevelWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::PhysicalMinLevel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributePhysicalMaxLevelWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::PhysicalMaxLevel::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributePhysicalMaxLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::PhysicalMaxLevel::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributePhysicalMaxLevelWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::PhysicalMaxLevel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBallastStatusWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::BallastStatus::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBallastStatusWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::BallastStatus::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBallastStatusWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::BallastStatus::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeMinLevelWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::MinLevel::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeMinLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeMinLevelWithValue:(NSNumber * _Nonnull) value params:nil completionHandler:completionHandler]; +} +- (void)writeAttributeMinLevelWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::MinLevel::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->WriteAttribute( + cppValue, successFn->mContext, successFn->mCall, failureFn->mCall, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeMinLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::MinLevel::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeMinLevelWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::MinLevel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeMaxLevelWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::MaxLevel::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull) value params:nil completionHandler:completionHandler]; +} +- (void)writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::MaxLevel::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->WriteAttribute( + cppValue, successFn->mContext, successFn->mCall, failureFn->mCall, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeMaxLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::MaxLevel::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeMaxLevelWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::MaxLevel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeIntrinsicBalanceFactorWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRNullableInt8uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::IntrinsicBalanceFactor::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeIntrinsicBalanceFactorWithValue:(NSNumber * _Nullable)value + completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeIntrinsicBalanceFactorWithValue:(NSNumber * _Nullable) value + params:nil + completionHandler:completionHandler]; +} +- (void)writeAttributeIntrinsicBalanceFactorWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::IntrinsicBalanceFactor::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, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeIntrinsicBalanceFactorWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRNullableInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::IntrinsicBalanceFactor::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRNullableInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeIntrinsicBalanceFactorWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRNullableInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::IntrinsicBalanceFactor::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBallastFactorAdjustmentWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRNullableInt8uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::BallastFactorAdjustment::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeBallastFactorAdjustmentWithValue:(NSNumber * _Nullable)value + completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeBallastFactorAdjustmentWithValue:(NSNumber * _Nullable) value + params:nil + completionHandler:completionHandler]; +} +- (void)writeAttributeBallastFactorAdjustmentWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::BallastFactorAdjustment::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, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeBallastFactorAdjustmentWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new MTRNullableInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::BallastFactorAdjustment::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRNullableInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBallastFactorAdjustmentWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRNullableInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::BallastFactorAdjustment::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeLampQuantityWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::LampQuantity::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeLampQuantityWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::LampQuantity::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeLampQuantityWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampQuantity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeLampTypeWithCompletionHandler:(void (^)( + NSString * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRCharStringAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::LampType::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeLampTypeWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeLampTypeWithValue:(NSString * _Nonnull) value params:nil completionHandler:completionHandler]; +} +- (void)writeAttributeLampTypeWithValue:(NSString * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::LampType::TypeInfo; + TypeInfo::Type cppValue; + cppValue = [self asCharSpan:value]; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->WriteAttribute( + cppValue, successFn->mContext, successFn->mCall, failureFn->mCall, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeLampTypeWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRCharStringAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::LampType::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRCharStringAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeLampTypeWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRCharStringAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampType::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeLampManufacturerWithCompletionHandler:(void (^)(NSString * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRCharStringAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::LampManufacturer::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeLampManufacturerWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeLampManufacturerWithValue:(NSString * _Nonnull) value params:nil completionHandler:completionHandler]; +} +- (void)writeAttributeLampManufacturerWithValue:(NSString * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::LampManufacturer::TypeInfo; + TypeInfo::Type cppValue; + cppValue = [self asCharSpan:value]; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->WriteAttribute( + cppValue, successFn->mContext, successFn->mCall, failureFn->mCall, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeLampManufacturerWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRCharStringAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::LampManufacturer::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRCharStringAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeLampManufacturerWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRCharStringAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampManufacturer::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeLampRatedHoursWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRNullableInt32uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::LampRatedHours::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeLampRatedHoursWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeLampRatedHoursWithValue:(NSNumber * _Nullable) value params:nil completionHandler:completionHandler]; +} +- (void)writeAttributeLampRatedHoursWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::LampRatedHours::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedIntValue; + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->WriteAttribute( + cppValue, successFn->mContext, successFn->mCall, failureFn->mCall, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeLampRatedHoursWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRNullableInt32uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::LampRatedHours::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRNullableInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeLampRatedHoursWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRNullableInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampRatedHours::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeLampBurnHoursWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRNullableInt32uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::LampBurnHours::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeLampBurnHoursWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeLampBurnHoursWithValue:(NSNumber * _Nullable) value params:nil completionHandler:completionHandler]; +} +- (void)writeAttributeLampBurnHoursWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::LampBurnHours::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedIntValue; + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->WriteAttribute( + cppValue, successFn->mContext, successFn->mCall, failureFn->mCall, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeLampBurnHoursWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRNullableInt32uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::LampBurnHours::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRNullableInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeLampBurnHoursWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRNullableInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampBurnHours::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeLampAlarmModeWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::LampAlarmMode::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeLampAlarmModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeLampAlarmModeWithValue:(NSNumber * _Nonnull) value params:nil completionHandler:completionHandler]; +} +- (void)writeAttributeLampAlarmModeWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::LampAlarmMode::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->WriteAttribute( + cppValue, successFn->mContext, successFn->mCall, failureFn->mCall, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeLampAlarmModeWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::LampAlarmMode::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeLampAlarmModeWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampAlarmMode::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeLampBurnHoursTripPointWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRNullableInt32uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::LampBurnHoursTripPoint::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeLampBurnHoursTripPointWithValue:(NSNumber * _Nullable)value + completionHandler:(StatusCompletion)completionHandler +{ + [self writeAttributeLampBurnHoursTripPointWithValue:(NSNumber * _Nullable) value + params:nil + completionHandler:completionHandler]; +} +- (void)writeAttributeLampBurnHoursTripPointWithValue:(NSNumber * _Nullable)value + params:(MTRWriteParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = BallastConfiguration::Attributes::LampBurnHoursTripPoint::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedIntValue; + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->WriteAttribute( + cppValue, successFn->mContext, successFn->mCall, failureFn->mCall, timedWriteTimeout); + }); +} + +- (void)subscribeAttributeLampBurnHoursTripPointWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRNullableInt32uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::LampBurnHoursTripPoint::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRNullableInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeLampBurnHoursTripPointWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRNullableInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampBurnHoursTripPoint::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::GeneratedCommandList::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRBallastConfigurationGeneratedCommandListListAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::GeneratedCommandList::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRBallastConfigurationGeneratedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeGeneratedCommandListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge( + queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::GeneratedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeAcceptedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRBallastConfigurationAcceptedCommandListListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::AcceptedCommandList::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeAcceptedCommandListWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRBallastConfigurationAcceptedCommandListListAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::AcceptedCommandList::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRBallastConfigurationAcceptedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeAcceptedCommandListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRBallastConfigurationAcceptedCommandListListAttributeCallbackBridge( + queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::AcceptedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeAttributeListWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRBallastConfigurationAttributeListListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::Attributes::AttributeList::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeAttributeListWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRBallastConfigurationAttributeListListAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::AttributeList::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRBallastConfigurationAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeAttributeListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRBallastConfigurationAttributeListListAttributeCallbackBridge( + queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeFeatureMapWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::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:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt32uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::FeatureMap::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeFeatureMapWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new MTRInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = BallastConfiguration::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:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(MTRSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new MTRInt16uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = BallastConfiguration::Attributes::ClusterRevision::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster->SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + MTRInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, nil, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeClusterRevisionWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new MTRInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)dealloc +{ + // Must delete cppCluster on the Matter queue. + dispatch_sync(chip::DeviceLayer::PlatformMgrImpl().GetWorkQueue(), ^{ + if (self.cppCluster != nullptr) { + delete self.cppCluster; + } + }); +} + +@end + @implementation MTRBaseClusterIlluminanceMeasurement - (instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16_t)endpoint queue:(dispatch_queue_t)queue diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h index d918ac6284b7ef..00d3b6a5d98626 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_internal.h @@ -288,6 +288,12 @@ - (chip::Controller::ColorControlCluster **)cppClusterSlot; @end +@interface MTRBaseClusterBallastConfiguration () +// Must only touch cppCluster on the Matter queue. +@property (readonly) chip::Controller::BallastConfigurationCluster * cppCluster; +- (chip::Controller::BallastConfigurationCluster **)cppClusterSlot; +@end + @interface MTRBaseClusterIlluminanceMeasurement () // Must only touch cppCluster on the Matter queue. @property (readonly) chip::Controller::IlluminanceMeasurementCluster * cppCluster; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index b3ca2f70b1af7d..1e7229a75fad35 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -7851,6 +7851,123 @@ } } +void MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + 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]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRBallastConfigurationGeneratedCommandListListAttributeCallbackSubscriptionBridge::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 MTRBallastConfigurationAcceptedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + 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]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRBallastConfigurationAcceptedCommandListListAttributeCallbackSubscriptionBridge::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 MTRBallastConfigurationAttributeListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + 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]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRBallastConfigurationAttributeListListAttributeCallbackSubscriptionBridge::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 MTRIlluminanceMeasurementGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { @@ -19225,274 +19342,6 @@ } } -void MTRMessagingClusterEventIdAttributeCallbackBridge::OnSuccessFn(void * context, chip::app::Clusters::Messaging::EventId value) -{ - NSNumber * _Nonnull objCValue; - objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; - DispatchSuccess(context, objCValue); -}; - -void MTRMessagingClusterEventIdAttributeCallbackSubscriptionBridge::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 MTRNullableMessagingClusterEventIdAttributeCallbackBridge::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 MTRNullableMessagingClusterEventIdAttributeCallbackSubscriptionBridge::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 MTRMessagingClusterMessagingControlConfirmationAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::Messaging::MessagingControlConfirmation value) -{ - NSNumber * _Nonnull objCValue; - objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; - DispatchSuccess(context, objCValue); -}; - -void MTRMessagingClusterMessagingControlConfirmationAttributeCallbackSubscriptionBridge::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 MTRNullableMessagingClusterMessagingControlConfirmationAttributeCallbackBridge::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 MTRNullableMessagingClusterMessagingControlConfirmationAttributeCallbackSubscriptionBridge::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 MTRMessagingClusterMessagingControlEnhancedConfirmationAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::Messaging::MessagingControlEnhancedConfirmation value) -{ - NSNumber * _Nonnull objCValue; - objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; - DispatchSuccess(context, objCValue); -}; - -void MTRMessagingClusterMessagingControlEnhancedConfirmationAttributeCallbackSubscriptionBridge::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 MTRNullableMessagingClusterMessagingControlEnhancedConfirmationAttributeCallbackBridge::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 MTRNullableMessagingClusterMessagingControlEnhancedConfirmationAttributeCallbackSubscriptionBridge::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 MTRMessagingClusterMessagingControlImportanceAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::Messaging::MessagingControlImportance value) -{ - NSNumber * _Nonnull objCValue; - objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; - DispatchSuccess(context, objCValue); -}; - -void MTRMessagingClusterMessagingControlImportanceAttributeCallbackSubscriptionBridge::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 MTRNullableMessagingClusterMessagingControlImportanceAttributeCallbackBridge::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 MTRNullableMessagingClusterMessagingControlImportanceAttributeCallbackSubscriptionBridge::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 MTRMessagingClusterMessagingControlTransmissionAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::Messaging::MessagingControlTransmission value) -{ - NSNumber * _Nonnull objCValue; - objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; - DispatchSuccess(context, objCValue); -}; - -void MTRMessagingClusterMessagingControlTransmissionAttributeCallbackSubscriptionBridge::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 MTRNullableMessagingClusterMessagingControlTransmissionAttributeCallbackBridge::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 MTRNullableMessagingClusterMessagingControlTransmissionAttributeCallbackSubscriptionBridge::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 MTRApplianceEventsAndAlertClusterEventIdentificationAttributeCallbackBridge::OnSuccessFn( void * context, chip::app::Clusters::ApplianceEventsAndAlert::EventIdentification value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h index c8bd645d352679..3e2b87500de6cb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge_internal.h @@ -533,25 +533,6 @@ typedef void (*ApplicationBasicClusterApplicationStatusEnumAttributeCallback)( void *, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum); typedef void (*NullableApplicationBasicClusterApplicationStatusEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); -typedef void (*MessagingClusterEventIdAttributeCallback)(void *, chip::app::Clusters::Messaging::EventId); -typedef void (*NullableMessagingClusterEventIdAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*MessagingClusterMessagingControlConfirmationAttributeCallback)( - void *, chip::app::Clusters::Messaging::MessagingControlConfirmation); -typedef void (*NullableMessagingClusterMessagingControlConfirmationAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*MessagingClusterMessagingControlEnhancedConfirmationAttributeCallback)( - void *, chip::app::Clusters::Messaging::MessagingControlEnhancedConfirmation); -typedef void (*NullableMessagingClusterMessagingControlEnhancedConfirmationAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*MessagingClusterMessagingControlImportanceAttributeCallback)( - void *, chip::app::Clusters::Messaging::MessagingControlImportance); -typedef void (*NullableMessagingClusterMessagingControlImportanceAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*MessagingClusterMessagingControlTransmissionAttributeCallback)( - void *, chip::app::Clusters::Messaging::MessagingControlTransmission); -typedef void (*NullableMessagingClusterMessagingControlTransmissionAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); typedef void (*ApplianceEventsAndAlertClusterEventIdentificationAttributeCallback)( void *, chip::app::Clusters::ApplianceEventsAndAlert::EventIdentification); typedef void (*NullableApplianceEventsAndAlertClusterEventIdentificationAttributeCallback)( @@ -949,6 +930,12 @@ typedef void (*ColorControlAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ColorControlAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*BallastConfigurationGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*BallastConfigurationAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*BallastConfigurationAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*IlluminanceMeasurementGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*IlluminanceMeasurementAcceptedCommandListListAttributeCallback)( @@ -6854,6 +6841,90 @@ class MTRColorControlAttributeListListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; +class MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, bool keepAlive = false) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRBallastConfigurationGeneratedCommandListListAttributeCallbackSubscriptionBridge + : public MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge +{ +public: + MTRBallastConfigurationGeneratedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, SubscriptionEstablishedHandler establishedHandler) : + MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRBallastConfigurationAcceptedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRBallastConfigurationAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, bool keepAlive = false) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRBallastConfigurationAcceptedCommandListListAttributeCallbackSubscriptionBridge + : public MTRBallastConfigurationAcceptedCommandListListAttributeCallbackBridge +{ +public: + MTRBallastConfigurationAcceptedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, SubscriptionEstablishedHandler establishedHandler) : + MTRBallastConfigurationAcceptedCommandListListAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRBallastConfigurationAttributeListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRBallastConfigurationAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, bool keepAlive = false) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRBallastConfigurationAttributeListListAttributeCallbackSubscriptionBridge + : public MTRBallastConfigurationAttributeListListAttributeCallbackBridge +{ +public: + MTRBallastConfigurationAttributeListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + MTRBallastConfigurationAttributeListListAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class MTRIlluminanceMeasurementGeneratedCommandListListAttributeCallbackBridge : public MTRCallbackBridge { @@ -16481,294 +16552,6 @@ class MTRNullableApplicationBasicClusterApplicationStatusEnumAttributeCallbackSu SubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRMessagingClusterEventIdAttributeCallbackBridge : public MTRCallbackBridge -{ -public: - MTRMessagingClusterEventIdAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, - bool keepAlive = false) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - - static void OnSuccessFn(void * context, chip::app::Clusters::Messaging::EventId value); -}; - -class MTRMessagingClusterEventIdAttributeCallbackSubscriptionBridge : public MTRMessagingClusterEventIdAttributeCallbackBridge -{ -public: - MTRMessagingClusterEventIdAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - MTRMessagingClusterEventIdAttributeCallbackBridge(queue, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRNullableMessagingClusterEventIdAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRNullableMessagingClusterEventIdAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, bool keepAlive = false) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - - static void OnSuccessFn(void * context, const chip::app::DataModel::Nullable & value); -}; - -class MTRNullableMessagingClusterEventIdAttributeCallbackSubscriptionBridge - : public MTRNullableMessagingClusterEventIdAttributeCallbackBridge -{ -public: - MTRNullableMessagingClusterEventIdAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - MTRNullableMessagingClusterEventIdAttributeCallbackBridge(queue, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRMessagingClusterMessagingControlConfirmationAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRMessagingClusterMessagingControlConfirmationAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, bool keepAlive = false) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, chip::app::Clusters::Messaging::MessagingControlConfirmation value); -}; - -class MTRMessagingClusterMessagingControlConfirmationAttributeCallbackSubscriptionBridge - : public MTRMessagingClusterMessagingControlConfirmationAttributeCallbackBridge -{ -public: - MTRMessagingClusterMessagingControlConfirmationAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - MTRMessagingClusterMessagingControlConfirmationAttributeCallbackBridge(queue, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRNullableMessagingClusterMessagingControlConfirmationAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRNullableMessagingClusterMessagingControlConfirmationAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, bool keepAlive = false) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn, keepAlive){}; - - static void - OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); -}; - -class MTRNullableMessagingClusterMessagingControlConfirmationAttributeCallbackSubscriptionBridge - : public MTRNullableMessagingClusterMessagingControlConfirmationAttributeCallbackBridge -{ -public: - MTRNullableMessagingClusterMessagingControlConfirmationAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - MTRNullableMessagingClusterMessagingControlConfirmationAttributeCallbackBridge(queue, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRMessagingClusterMessagingControlEnhancedConfirmationAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRMessagingClusterMessagingControlEnhancedConfirmationAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, bool keepAlive = false) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn, keepAlive){}; - - static void OnSuccessFn(void * context, chip::app::Clusters::Messaging::MessagingControlEnhancedConfirmation value); -}; - -class MTRMessagingClusterMessagingControlEnhancedConfirmationAttributeCallbackSubscriptionBridge - : public MTRMessagingClusterMessagingControlEnhancedConfirmationAttributeCallbackBridge -{ -public: - MTRMessagingClusterMessagingControlEnhancedConfirmationAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - MTRMessagingClusterMessagingControlEnhancedConfirmationAttributeCallbackBridge(queue, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRNullableMessagingClusterMessagingControlEnhancedConfirmationAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRNullableMessagingClusterMessagingControlEnhancedConfirmationAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler, - MTRActionBlock action, - bool keepAlive = false) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn, keepAlive){}; - - static void - OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); -}; - -class MTRNullableMessagingClusterMessagingControlEnhancedConfirmationAttributeCallbackSubscriptionBridge - : public MTRNullableMessagingClusterMessagingControlEnhancedConfirmationAttributeCallbackBridge -{ -public: - MTRNullableMessagingClusterMessagingControlEnhancedConfirmationAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - MTRNullableMessagingClusterMessagingControlEnhancedConfirmationAttributeCallbackBridge(queue, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRMessagingClusterMessagingControlImportanceAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRMessagingClusterMessagingControlImportanceAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, bool keepAlive = false) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, chip::app::Clusters::Messaging::MessagingControlImportance value); -}; - -class MTRMessagingClusterMessagingControlImportanceAttributeCallbackSubscriptionBridge - : public MTRMessagingClusterMessagingControlImportanceAttributeCallbackBridge -{ -public: - MTRMessagingClusterMessagingControlImportanceAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - MTRMessagingClusterMessagingControlImportanceAttributeCallbackBridge(queue, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRNullableMessagingClusterMessagingControlImportanceAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRNullableMessagingClusterMessagingControlImportanceAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, bool keepAlive = false) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; - - static void - OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); -}; - -class MTRNullableMessagingClusterMessagingControlImportanceAttributeCallbackSubscriptionBridge - : public MTRNullableMessagingClusterMessagingControlImportanceAttributeCallbackBridge -{ -public: - MTRNullableMessagingClusterMessagingControlImportanceAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - MTRNullableMessagingClusterMessagingControlImportanceAttributeCallbackBridge(queue, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRMessagingClusterMessagingControlTransmissionAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRMessagingClusterMessagingControlTransmissionAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, bool keepAlive = false) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, chip::app::Clusters::Messaging::MessagingControlTransmission value); -}; - -class MTRMessagingClusterMessagingControlTransmissionAttributeCallbackSubscriptionBridge - : public MTRMessagingClusterMessagingControlTransmissionAttributeCallbackBridge -{ -public: - MTRMessagingClusterMessagingControlTransmissionAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - MTRMessagingClusterMessagingControlTransmissionAttributeCallbackBridge(queue, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRNullableMessagingClusterMessagingControlTransmissionAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRNullableMessagingClusterMessagingControlTransmissionAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, bool keepAlive = false) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn, keepAlive){}; - - static void - OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); -}; - -class MTRNullableMessagingClusterMessagingControlTransmissionAttributeCallbackSubscriptionBridge - : public MTRNullableMessagingClusterMessagingControlTransmissionAttributeCallbackBridge -{ -public: - MTRNullableMessagingClusterMessagingControlTransmissionAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - MTRNullableMessagingClusterMessagingControlTransmissionAttributeCallbackBridge(queue, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - class MTRApplianceEventsAndAlertClusterEventIdentificationAttributeCallbackBridge : public MTRCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index e271b9c90af14b..880545c1cc509e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -130,7 +130,6 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterApplicationLauncherID = 0x0000050C, MTRClusterApplicationBasicID = 0x0000050D, MTRClusterAccountLoginID = 0x0000050E, - MTRClusterMessagingID = 0x00000703, MTRClusterApplianceIdentificationID = 0x00000B00, MTRClusterMeterIdentificationID = 0x00000B01, MTRClusterApplianceEventsAndAlertID = 0x00000B02, @@ -1137,11 +1136,9 @@ typedef NS_ENUM(uint32_t, MTRClusterAttributeIDType) { MTRClusterBallastConfigurationAttributeBallastStatusID = 0x00000002, MTRClusterBallastConfigurationAttributeMinLevelID = 0x00000010, MTRClusterBallastConfigurationAttributeMaxLevelID = 0x00000011, - MTRClusterBallastConfigurationAttributePowerOnLevelID = 0x00000012, - MTRClusterBallastConfigurationAttributePowerOnFadeTimeID = 0x00000013, - MTRClusterBallastConfigurationAttributeIntrinsicBallastFactorID = 0x00000014, + MTRClusterBallastConfigurationAttributeIntrinsicBalanceFactorID = 0x00000014, MTRClusterBallastConfigurationAttributeBallastFactorAdjustmentID = 0x00000015, - MTRClusterBallastConfigurationAttributeLampQualityID = 0x00000020, + MTRClusterBallastConfigurationAttributeLampQuantityID = 0x00000020, MTRClusterBallastConfigurationAttributeLampTypeID = 0x00000030, MTRClusterBallastConfigurationAttributeLampManufacturerID = 0x00000031, MTRClusterBallastConfigurationAttributeLampRatedHoursID = 0x00000032, @@ -1699,13 +1696,6 @@ typedef NS_ENUM(uint32_t, MTRClusterAttributeIDType) { MTRClusterAccountLoginAttributeFeatureMapID = MTRClusterGlobalAttributeFeatureMapID, MTRClusterAccountLoginAttributeClusterRevisionID = MTRClusterGlobalAttributeClusterRevisionID, - // Cluster Messaging attributes - MTRClusterMessagingAttributeGeneratedCommandListID = MTRClusterGlobalAttributeGeneratedCommandListID, - MTRClusterMessagingAttributeAcceptedCommandListID = MTRClusterGlobalAttributeAcceptedCommandListID, - MTRClusterMessagingAttributeAttributeListID = MTRClusterGlobalAttributeAttributeListID, - MTRClusterMessagingAttributeFeatureMapID = MTRClusterGlobalAttributeFeatureMapID, - MTRClusterMessagingAttributeClusterRevisionID = MTRClusterGlobalAttributeClusterRevisionID, - // Cluster ApplianceIdentification attributes MTRClusterApplianceIdentificationAttributeBasicIdentificationID = 0x00000000, MTRClusterApplianceIdentificationAttributeCompanyNameID = 0x00000010, @@ -2312,15 +2302,6 @@ typedef NS_ENUM(uint32_t, MTRClusterCommandIDType) { MTRClusterAccountLoginCommandLoginID = 0x00000002, MTRClusterAccountLoginCommandLogoutID = 0x00000003, - // Cluster Messaging commands - MTRClusterMessagingCommandDisplayMessageID = 0x00000000, - MTRClusterMessagingCommandGetLastMessageID = 0x00000000, - MTRClusterMessagingCommandCancelMessageID = 0x00000001, - MTRClusterMessagingCommandMessageConfirmationID = 0x00000001, - MTRClusterMessagingCommandDisplayProtectedMessageID = 0x00000002, - MTRClusterMessagingCommandGetMessageCancellationID = 0x00000002, - MTRClusterMessagingCommandCancelAllMessagesID = 0x00000003, - // Cluster ApplianceEventsAndAlert commands MTRClusterApplianceEventsAndAlertCommandGetAlertsID = 0x00000000, MTRClusterApplianceEventsAndAlertCommandGetAlertsResponseID = 0x00000000, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 0f01197c6230f4..7458c40cd83b99 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -5993,186 +5993,6 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; -@end -@interface MTRMessagingClusterDisplayMessageParams : NSObject - -@property (strong, nonatomic) NSNumber * _Nonnull messageId; - -@property (strong, nonatomic) NSNumber * _Nonnull messageControl; - -@property (strong, nonatomic) NSNumber * _Nonnull startTime; - -@property (strong, nonatomic) NSNumber * _Nonnull durationInMinutes; - -@property (strong, nonatomic) NSString * _Nonnull message; - -@property (strong, nonatomic) NSNumber * _Nonnull optionalExtendedMessageControl; -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (strong, nonatomic, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; - -@end -@interface MTRMessagingClusterGetLastMessageParams : NSObject -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (strong, nonatomic, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; - -@end -@interface MTRMessagingClusterCancelMessageParams : NSObject - -@property (strong, nonatomic) NSNumber * _Nonnull messageId; - -@property (strong, nonatomic) NSNumber * _Nonnull messageControl; -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (strong, nonatomic, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; - -@end -@interface MTRMessagingClusterMessageConfirmationParams : NSObject - -@property (strong, nonatomic) NSNumber * _Nonnull messageId; - -@property (strong, nonatomic) NSNumber * _Nonnull confirmationTime; - -@property (strong, nonatomic) NSNumber * _Nonnull messageConfirmationControl; - -@property (strong, nonatomic) NSData * _Nonnull messageResponse; -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (strong, nonatomic, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; - -@end -@interface MTRMessagingClusterDisplayProtectedMessageParams : NSObject - -@property (strong, nonatomic) NSNumber * _Nonnull messageId; - -@property (strong, nonatomic) NSNumber * _Nonnull messageControl; - -@property (strong, nonatomic) NSNumber * _Nonnull startTime; - -@property (strong, nonatomic) NSNumber * _Nonnull durationInMinutes; - -@property (strong, nonatomic) NSString * _Nonnull message; - -@property (strong, nonatomic) NSNumber * _Nonnull optionalExtendedMessageControl; -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (strong, nonatomic, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; - -@end -@interface MTRMessagingClusterGetMessageCancellationParams : NSObject - -@property (strong, nonatomic) NSNumber * _Nonnull earliestImplementationTime; -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (strong, nonatomic, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; - -@end -@interface MTRMessagingClusterCancelAllMessagesParams : NSObject - -@property (strong, nonatomic) NSNumber * _Nonnull implementationDateTime; -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (strong, nonatomic, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; - @end @interface MTRApplianceEventsAndAlertClusterGetAlertsParams : NSObject /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 813e42fbd22743..5a83c466d976f6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -5285,172 +5285,6 @@ - (NSString *)description return descriptionString; } -@end -@implementation MTRMessagingClusterDisplayMessageParams -- (instancetype)init -{ - if (self = [super init]) { - - _messageId = @(0); - - _messageControl = @(0); - - _startTime = @(0); - - _durationInMinutes = @(0); - - _message = @""; - - _optionalExtendedMessageControl = @(0); - _timedInvokeTimeoutMs = nil; - } - return self; -} - -- (NSString *)description -{ - NSString * descriptionString = - [NSString stringWithFormat:@"<%@: messageId:%@; messageControl:%@; startTime:%@; durationInMinutes:%@; message:%@; " - @"optionalExtendedMessageControl:%@; >", - NSStringFromClass([self class]), _messageId, _messageControl, _startTime, _durationInMinutes, _message, - _optionalExtendedMessageControl]; - return descriptionString; -} - -@end -@implementation MTRMessagingClusterGetLastMessageParams -- (instancetype)init -{ - if (self = [super init]) { - _timedInvokeTimeoutMs = nil; - } - return self; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; - return descriptionString; -} - -@end -@implementation MTRMessagingClusterCancelMessageParams -- (instancetype)init -{ - if (self = [super init]) { - - _messageId = @(0); - - _messageControl = @(0); - _timedInvokeTimeoutMs = nil; - } - return self; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString - stringWithFormat:@"<%@: messageId:%@; messageControl:%@; >", NSStringFromClass([self class]), _messageId, _messageControl]; - return descriptionString; -} - -@end -@implementation MTRMessagingClusterMessageConfirmationParams -- (instancetype)init -{ - if (self = [super init]) { - - _messageId = @(0); - - _confirmationTime = @(0); - - _messageConfirmationControl = @(0); - - _messageResponse = [NSData data]; - _timedInvokeTimeoutMs = nil; - } - return self; -} - -- (NSString *)description -{ - NSString * descriptionString = - [NSString stringWithFormat:@"<%@: messageId:%@; confirmationTime:%@; messageConfirmationControl:%@; messageResponse:%@; >", - NSStringFromClass([self class]), _messageId, _confirmationTime, _messageConfirmationControl, - [_messageResponse base64EncodedStringWithOptions:0]]; - return descriptionString; -} - -@end -@implementation MTRMessagingClusterDisplayProtectedMessageParams -- (instancetype)init -{ - if (self = [super init]) { - - _messageId = @(0); - - _messageControl = @(0); - - _startTime = @(0); - - _durationInMinutes = @(0); - - _message = @""; - - _optionalExtendedMessageControl = @(0); - _timedInvokeTimeoutMs = nil; - } - return self; -} - -- (NSString *)description -{ - NSString * descriptionString = - [NSString stringWithFormat:@"<%@: messageId:%@; messageControl:%@; startTime:%@; durationInMinutes:%@; message:%@; " - @"optionalExtendedMessageControl:%@; >", - NSStringFromClass([self class]), _messageId, _messageControl, _startTime, _durationInMinutes, _message, - _optionalExtendedMessageControl]; - return descriptionString; -} - -@end -@implementation MTRMessagingClusterGetMessageCancellationParams -- (instancetype)init -{ - if (self = [super init]) { - - _earliestImplementationTime = @(0); - _timedInvokeTimeoutMs = nil; - } - return self; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString - stringWithFormat:@"<%@: earliestImplementationTime:%@; >", NSStringFromClass([self class]), _earliestImplementationTime]; - return descriptionString; -} - -@end -@implementation MTRMessagingClusterCancelAllMessagesParams -- (instancetype)init -{ - if (self = [super init]) { - - _implementationDateTime = @(0); - _timedInvokeTimeoutMs = nil; - } - return self; -} - -- (NSString *)description -{ - NSString * descriptionString = - [NSString stringWithFormat:@"<%@: implementationDateTime:%@; >", NSStringFromClass([self class]), _implementationDateTime]; - return descriptionString; -} - @end @implementation MTRApplianceEventsAndAlertClusterGetAlertsParams - (instancetype)init diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 4b1717d3d2b1c7..4fd720ab45c0d1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -1865,6 +1865,16 @@ id MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aRead } break; } + case Clusters::BallastConfiguration::Id: { + using namespace Clusters::BallastConfiguration; + switch (aPath.mEventId) { + + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case Clusters::IlluminanceMeasurement::Id: { using namespace Clusters::IlluminanceMeasurement; switch (aPath.mEventId) { diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index 35cbffdeba16c4..d0464d268fc426 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -32,6 +32,7 @@ 2CB7163C252E8A7C0026E2BB /* MTRDevicePairingDelegateBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2CB71639252E8A7B0026E2BB /* MTRDevicePairingDelegateBridge.mm */; }; 2CB7163F252F731E0026E2BB /* MTRDevicePairingDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 2CB7163E252F731E0026E2BB /* MTRDevicePairingDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2FD775552695557E00FF4B12 /* error-mapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2FD775542695557E00FF4B12 /* error-mapping.cpp */; }; + 5112F606287CD2C100B827E7 /* privilege-storage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5112F605287CD2C100B827E7 /* privilege-storage.cpp */; }; 5129BCFD26A9EE3300122DDF /* MTRError.h in Headers */ = {isa = PBXBuildFile; fileRef = 5129BCFC26A9EE3300122DDF /* MTRError.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5136661328067D550025EDAE /* MTRDeviceController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5136660F28067D540025EDAE /* MTRDeviceController_Internal.h */; }; 5136661428067D550025EDAE /* MTRControllerFactory.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5136661028067D540025EDAE /* MTRControllerFactory.mm */; }; @@ -149,6 +150,7 @@ 2CB71639252E8A7B0026E2BB /* MTRDevicePairingDelegateBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDevicePairingDelegateBridge.mm; sourceTree = ""; }; 2CB7163E252F731E0026E2BB /* MTRDevicePairingDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDevicePairingDelegate.h; sourceTree = ""; }; 2FD775542695557E00FF4B12 /* error-mapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "error-mapping.cpp"; path = "../../../app/util/error-mapping.cpp"; sourceTree = ""; }; + 5112F605287CD2C100B827E7 /* privilege-storage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "privilege-storage.cpp"; path = "../../../app/util/privilege-storage.cpp"; sourceTree = ""; }; 5129BCFC26A9EE3300122DDF /* MTRError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRError.h; sourceTree = ""; }; 5136660F28067D540025EDAE /* MTRDeviceController_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceController_Internal.h; sourceTree = ""; }; 5136661028067D540025EDAE /* MTRControllerFactory.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRControllerFactory.mm; sourceTree = ""; }; @@ -261,6 +263,7 @@ 1E857311265519DE0050A4D9 /* CHIPApp */ = { isa = PBXGroup; children = ( + 5112F605287CD2C100B827E7 /* privilege-storage.cpp */, 2FD775542695557E00FF4B12 /* error-mapping.cpp */, 51431AFA27D29CA4008A7943 /* ota-provider.cpp */, ); @@ -635,6 +638,7 @@ 5A7947E427C0129600434CF2 /* MTRDeviceController+XPC.m in Sources */, 5A6FEC9027B563D900F25F42 /* MTRDeviceControllerOverXPC.m in Sources */, B289D4222639C0D300D4E314 /* MTROnboardingPayloadParser.m in Sources */, + 5112F606287CD2C100B827E7 /* privilege-storage.cpp in Sources */, 2C1B027A2641DB4E00780EF1 /* MTROperationalCredentialsDelegate.mm in Sources */, 7560FD1C27FBBD3F005E85B3 /* MTREventTLVValueDecoder.mm in Sources */, B2E0D7B9245B0B5C003C5B48 /* MTRSetupPayload.mm in Sources */, diff --git a/src/include/platform/ConnectivityManager.h b/src/include/platform/ConnectivityManager.h index 162a31c3a3ab0e..d8638dcc237615 100644 --- a/src/include/platform/ConnectivityManager.h +++ b/src/include/platform/ConnectivityManager.h @@ -229,8 +229,6 @@ class ConnectivityManager // CHIPoBLE service methods Ble::BleLayer * GetBleLayer(); - CHIPoBLEServiceMode GetCHIPoBLEServiceMode(); - CHIP_ERROR SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool IsBLEAdvertisingEnabled(); /** * Enable or disable BLE advertising. @@ -532,16 +530,6 @@ inline Ble::BleLayer * ConnectivityManager::GetBleLayer() return static_cast(this)->_GetBleLayer(); } -inline ConnectivityManager::CHIPoBLEServiceMode ConnectivityManager::GetCHIPoBLEServiceMode() -{ - return static_cast(this)->_GetCHIPoBLEServiceMode(); -} - -inline CHIP_ERROR ConnectivityManager::SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - return static_cast(this)->_SetCHIPoBLEServiceMode(val); -} - inline bool ConnectivityManager::IsBLEAdvertisingEnabled() { return static_cast(this)->_IsBLEAdvertisingEnabled(); diff --git a/src/include/platform/internal/BLEManager.h b/src/include/platform/internal/BLEManager.h index 6525a507261f26..f37f2f3eb00743 100644 --- a/src/include/platform/internal/BLEManager.h +++ b/src/include/platform/internal/BLEManager.h @@ -55,8 +55,6 @@ class BLEManager CHIP_ERROR Init(); void Shutdown(); - CHIPoBLEServiceMode GetCHIPoBLEServiceMode(); - CHIP_ERROR SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool IsAdvertisingEnabled(); CHIP_ERROR SetAdvertisingEnabled(bool val); bool IsAdvertising(); @@ -125,16 +123,6 @@ inline void BLEManager::Shutdown() static_cast(this)->_Shutdown(); } -inline BLEManager::CHIPoBLEServiceMode BLEManager::GetCHIPoBLEServiceMode() -{ - return static_cast(this)->_GetCHIPoBLEServiceMode(); -} - -inline CHIP_ERROR BLEManager::SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - return static_cast(this)->_SetCHIPoBLEServiceMode(val); -} - inline bool BLEManager::IsAdvertisingEnabled() { return static_cast(this)->_IsAdvertisingEnabled(); diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.h b/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.h index 8c0a9f97cd147e..13a13643b4f588 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.h @@ -52,8 +52,6 @@ class GenericConnectivityManagerImpl_BLE // ===== Methods that implement the ConnectivityManager abstract interface. Ble::BleLayer * _GetBleLayer(); - ConnectivityManager::CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(); - CHIP_ERROR _SetCHIPoBLEServiceMode(ConnectivityManager::CHIPoBLEServiceMode val); bool _IsBLEAdvertisingEnabled(); CHIP_ERROR _SetBLEAdvertisingEnabled(bool val); bool _IsBLEAdvertising(); @@ -76,19 +74,6 @@ inline Ble::BleLayer * GenericConnectivityManagerImpl_BLE::_GetBleLay return BLEMgr().GetBleLayer(); } -template -inline ConnectivityManager::CHIPoBLEServiceMode GenericConnectivityManagerImpl_BLE::_GetCHIPoBLEServiceMode() -{ - return BLEMgr().GetCHIPoBLEServiceMode(); -} - -template -inline CHIP_ERROR -GenericConnectivityManagerImpl_BLE::_SetCHIPoBLEServiceMode(ConnectivityManager::CHIPoBLEServiceMode val) -{ - return BLEMgr().SetCHIPoBLEServiceMode(val); -} - template inline bool GenericConnectivityManagerImpl_BLE::_IsBLEAdvertisingEnabled() { diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_NoBLE.h b/src/include/platform/internal/GenericConnectivityManagerImpl_NoBLE.h index 4ea56a00f56cb2..83817a7c385e4a 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_NoBLE.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_NoBLE.h @@ -37,14 +37,6 @@ namespace Internal { * * The members of this class are all inlined methods that do nothing, and return static return * values. This allows the compiler to optimize away dead code without the use of \#ifdef's. - * For example: - * - * ``` - * if (ConnectivityMgr().GetCHIPoBLEServiceMode() != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported) - * { - * // ... do something on devices that support CHIPoBLE ... - * } - * ``` */ template class GenericConnectivityManagerImpl_NoBLE @@ -53,8 +45,6 @@ class GenericConnectivityManagerImpl_NoBLE // ===== Methods that implement the ConnectivityManager abstract interface. Ble::BleLayer * _GetBleLayer(void); - ConnectivityManager::CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); - CHIP_ERROR _SetCHIPoBLEServiceMode(ConnectivityManager::CHIPoBLEServiceMode val); bool _IsBLEAdvertisingEnabled(void); CHIP_ERROR _SetBLEAdvertisingEnabled(bool val); bool _IsBLEAdvertising(void); @@ -74,19 +64,6 @@ inline Ble::BleLayer * GenericConnectivityManagerImpl_NoBLE::_GetBleL return nullptr; } -template -inline ConnectivityManager::CHIPoBLEServiceMode GenericConnectivityManagerImpl_NoBLE::_GetCHIPoBLEServiceMode(void) -{ - return ConnectivityManager::kCHIPoBLEServiceMode_NotSupported; -} - -template -inline CHIP_ERROR -GenericConnectivityManagerImpl_NoBLE::_SetCHIPoBLEServiceMode(ConnectivityManager::CHIPoBLEServiceMode val) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} - template inline bool GenericConnectivityManagerImpl_NoBLE::_IsBLEAdvertisingEnabled(void) { diff --git a/src/inet/UDPEndPoint.cpp b/src/inet/UDPEndPoint.cpp index e0907d951a9e65..b0b6f3f861e989 100644 --- a/src/inet/UDPEndPoint.cpp +++ b/src/inet/UDPEndPoint.cpp @@ -125,8 +125,8 @@ void UDPEndPoint::Close() { if (mState != State::kClosed) { - CloseImpl(); mState = State::kClosed; + CloseImpl(); } } diff --git a/src/inet/UDPEndPointImplLwIP.cpp b/src/inet/UDPEndPointImplLwIP.cpp index d5e90568f7af84..9e6b98f780a330 100644 --- a/src/inet/UDPEndPointImplLwIP.cpp +++ b/src/inet/UDPEndPointImplLwIP.cpp @@ -241,6 +241,19 @@ void UDPEndPointImplLwIP::CloseImpl() udp_remove(mUDP); mUDP = nullptr; mLwIPEndPointType = LwIPEndPointType::Unknown; + + // In case that there is a UDPEndPointImplLwIP::LwIPReceiveUDPMessage + // event pending in the event queue (SystemLayer::ScheduleLambda), we + // schedule a release call to the end of the queue, to ensure that the + // queued pointer to UDPEndPointImplLwIP is not dangling. + Retain(); + CHIP_ERROR err = GetSystemLayer().ScheduleLambda([this] { Release(); }); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Inet, "Unable scedule lambda: %" CHIP_ERROR_FORMAT, err.Format()); + // There is nothing we can do here, accept the chance of racing + Release(); + } } // Unlock LwIP stack @@ -342,6 +355,10 @@ void UDPEndPointImplLwIP::LwIPReceiveUDPMessage(void * arg, struct udp_pcb * pcb UDPEndPointImplLwIP * ep = static_cast(arg); IPPacketInfo * pktInfo = nullptr; System::PacketBufferHandle buf = System::PacketBufferHandle::Adopt(p); + + if (ep->mState == State::kClosed) + return; + if (buf->HasChainedBuffer()) { // Try the simple expedient of flattening in-place. @@ -371,20 +388,15 @@ void UDPEndPointImplLwIP::LwIPReceiveUDPMessage(void * arg, struct udp_pcb * pcb pktInfo->DestPort = pcb->local_port; } - ep->Retain(); + // TODO: add thread-safe reference counting for UDP endpoints CHIP_ERROR err = ep->GetSystemLayer().ScheduleLambda([ep, p = System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(buf)] { ep->HandleDataReceived(System::PacketBufferHandle::Adopt(p)); - ep->Release(); }); if (err == CHIP_NO_ERROR) { // If ScheduleLambda() succeeded, it has ownership of the buffer, so we need to release it (without freeing it). static_cast(std::move(buf).UnsafeRelease()); } - else - { - ep->Release(); - } } CHIP_ERROR UDPEndPointImplLwIP::SetMulticastLoopback(IPVersion aIPVersion, bool aLoopback) diff --git a/src/inet/UDPEndPointImplOpenThread.cpp b/src/inet/UDPEndPointImplOpenThread.cpp index 02f11ba30bdf75..073f633bd8a38c 100644 --- a/src/inet/UDPEndPointImplOpenThread.cpp +++ b/src/inet/UDPEndPointImplOpenThread.cpp @@ -54,6 +54,9 @@ void UDPEndPointImplOT::handleUdpReceive(void * aContext, otMessage * aMessage, char destStr[Inet::IPAddress::kMaxStringLength]; #endif + if (ep->mState == State::kClosed) + return; + if (msgLen > System::PacketBuffer::kMaxSizeWithoutReserve) { ChipLogError(Inet, "UDP message too long, discarding. Size received %d", msgLen); @@ -98,18 +101,15 @@ void UDPEndPointImplOT::handleUdpReceive(void * aContext, otMessage * aMessage, } payload->SetDataLength(static_cast(msgLen)); - ep->Retain(); - auto * buf = std::move(payload).UnsafeRelease(); - CHIP_ERROR err = ep->GetSystemLayer().ScheduleLambda([ep, buf] { - ep->HandleDataReceived(System::PacketBufferHandle::Adopt(buf)); - ep->Release(); - }); + // TODO: add thread-safe reference counting for UDP endpoints + auto * buf = std::move(payload).UnsafeRelease(); + CHIP_ERROR err = + ep->GetSystemLayer().ScheduleLambda([ep, buf] { ep->HandleDataReceived(System::PacketBufferHandle::Adopt(buf)); }); if (err != CHIP_NO_ERROR) { // Make sure we properly clean up buf and ep, since our lambda will not // run. payload = System::PacketBufferHandle::Adopt(buf); - ep->Release(); } } @@ -261,6 +261,19 @@ void UDPEndPointImplOT::CloseImpl() if (otUdpIsOpen(mOTInstance, &mSocket)) { otUdpClose(mOTInstance, &mSocket); + + // In case that there is a UDPEndPointImplOT::handleUdpReceive event + // pending in the event queue (SystemLayer::ScheduleLambda), we + // schedule a release call to the end of the queue, to ensure that the + // queued pointer to UDPEndPointImplOT is not dangling. + Retain(); + CHIP_ERROR err = GetSystemLayer().ScheduleLambda([this] { Release(); }); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Inet, "Unable scedule lambda: %" CHIP_ERROR_FORMAT, err.Format()); + // There is nothing we can do here, accept the chance of racing + Release(); + } } UnlockOpenThread(); } diff --git a/src/platform/Ameba/BLEManagerImpl.cpp b/src/platform/Ameba/BLEManagerImpl.cpp index 449663268152e9..6987063539e708 100644 --- a/src/platform/Ameba/BLEManagerImpl.cpp +++ b/src/platform/Ameba/BLEManagerImpl.cpp @@ -352,23 +352,6 @@ BLEManagerImpl::CHIPoBLEConState * BLEManagerImpl::GetConnectionState(uint8_t co return NULL; } -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - - if (val != mServiceMode) - { - mServiceMode = val; - PlatformMgr().ScheduleWork(DriveBLEState, 0); - } - -exit: - return err; -} - CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/platform/Ameba/BLEManagerImpl.h b/src/platform/Ameba/BLEManagerImpl.h index 07cf5f22ad164a..693d1de8708d10 100755 --- a/src/platform/Ameba/BLEManagerImpl.h +++ b/src/platform/Ameba/BLEManagerImpl.h @@ -47,8 +47,6 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla CHIP_ERROR _Init(void); void _Shutdown() {} - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(void); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsAdvertising(void); @@ -200,11 +198,6 @@ inline BleLayer * BLEManagerImpl::_GetBleLayer() return this; } -inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void) -{ - return mServiceMode; -} - inline bool BLEManagerImpl::_IsAdvertisingEnabled(void) { return mFlags.Has(Flags::kAdvertisingEnabled); diff --git a/src/platform/CYW30739/BLEManagerImpl.cpp b/src/platform/CYW30739/BLEManagerImpl.cpp index e218adc161abd6..290461bfc89aa6 100644 --- a/src/platform/CYW30739/BLEManagerImpl.cpp +++ b/src/platform/CYW30739/BLEManagerImpl.cpp @@ -98,23 +98,6 @@ CHIP_ERROR BLEManagerImpl::_Init() return err; } -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - - if (val != mServiceMode) - { - mServiceMode = val; - PlatformMgr().ScheduleWork(DriveBLEState, 0); - } - -exit: - return err; -} - bool BLEManagerImpl::_IsAdvertisingEnabled(void) { return mFlags.Has(Flags::kFlag_AdvertisingEnabled); diff --git a/src/platform/CYW30739/BLEManagerImpl.h b/src/platform/CYW30739/BLEManagerImpl.h index 2b5d8bcdacf232..64ecf3edafe28c 100644 --- a/src/platform/CYW30739/BLEManagerImpl.h +++ b/src/platform/CYW30739/BLEManagerImpl.h @@ -52,8 +52,6 @@ class BLEManagerImpl final : public BLEManager, CHIP_ERROR _Init(void); void _Shutdown() {} - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(void); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsFastAdvertisingEnabled(void); diff --git a/src/platform/Darwin/BLEManagerImpl.cpp b/src/platform/Darwin/BLEManagerImpl.cpp index 91c3a813e9dfb5..49e2847a9dc2e3 100644 --- a/src/platform/Darwin/BLEManagerImpl.cpp +++ b/src/platform/Darwin/BLEManagerImpl.cpp @@ -56,18 +56,6 @@ CHIP_ERROR BLEManagerImpl::_Init() return err; } -ConnectivityManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void) -{ - ChipLogDetail(DeviceLayer, "%s", __FUNCTION__); - return ConnectivityManager::kCHIPoBLEServiceMode_NotSupported; -} - -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(ConnectivityManager::CHIPoBLEServiceMode val) -{ - ChipLogDetail(DeviceLayer, "%s", __FUNCTION__); - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} - bool BLEManagerImpl::_IsAdvertisingEnabled(void) { ChipLogDetail(DeviceLayer, "%s", __FUNCTION__); diff --git a/src/platform/Darwin/BLEManagerImpl.h b/src/platform/Darwin/BLEManagerImpl.h index 0554b2245bed98..83788bf4319d8f 100644 --- a/src/platform/Darwin/BLEManagerImpl.h +++ b/src/platform/Darwin/BLEManagerImpl.h @@ -48,8 +48,6 @@ class BLEManagerImpl final : public BLEManager, private BleLayer CHIP_ERROR _Init(void); void _Shutdown() {} - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(void); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsAdvertising(void); diff --git a/src/platform/EFR32/BLEManagerImpl.cpp b/src/platform/EFR32/BLEManagerImpl.cpp index 1d59f76d725bbc..e79d403235ffdf 100644 --- a/src/platform/EFR32/BLEManagerImpl.cpp +++ b/src/platform/EFR32/BLEManagerImpl.cpp @@ -299,23 +299,6 @@ void BLEManagerImpl::bluetoothStackEventHandler(void * p_arg) } } -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - - if (val != mServiceMode) - { - mServiceMode = val; - PlatformMgr().ScheduleWork(DriveBLEState, 0); - } - -exit: - return err; -} - CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/platform/EFR32/BLEManagerImpl.h b/src/platform/EFR32/BLEManagerImpl.h index 19e3900e9adfc2..561e553acd0ca2 100644 --- a/src/platform/EFR32/BLEManagerImpl.h +++ b/src/platform/EFR32/BLEManagerImpl.h @@ -50,8 +50,6 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla CHIP_ERROR _Init(void); void _Shutdown() {} - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(void); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsAdvertising(void); @@ -180,11 +178,6 @@ inline BleLayer * BLEManagerImpl::_GetBleLayer() return this; } -inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void) -{ - return mServiceMode; -} - inline bool BLEManagerImpl::_IsAdvertisingEnabled(void) { return mFlags.Has(Flags::kAdvertisingEnabled); diff --git a/src/platform/ESP32/BLEManagerImpl.h b/src/platform/ESP32/BLEManagerImpl.h index 284e0634cf5e03..9c3020f9b504bb 100644 --- a/src/platform/ESP32/BLEManagerImpl.h +++ b/src/platform/ESP32/BLEManagerImpl.h @@ -82,8 +82,6 @@ class BLEManagerImpl final : public BLEManager, CHIP_ERROR _Init(void); void _Shutdown() {} - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(void); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsAdvertising(void); @@ -283,11 +281,6 @@ inline ::chip::Ble::BleLayer * BLEManagerImpl::_GetBleLayer() return this; } -inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void) -{ - return mServiceMode; -} - inline bool BLEManagerImpl::_IsAdvertisingEnabled(void) { return mFlags.Has(Flags::kAdvertisingEnabled); diff --git a/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp b/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp index 126f52455cc0fd..fdec550c48de76 100644 --- a/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp +++ b/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp @@ -152,23 +152,6 @@ CHIP_ERROR BLEManagerImpl::_Init() return err; } -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - - if (val != mServiceMode) - { - mServiceMode = val; - PlatformMgr().ScheduleWork(DriveBLEState, 0); - } - -exit: - return err; -} - CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/platform/ESP32/nimble/BLEManagerImpl.cpp b/src/platform/ESP32/nimble/BLEManagerImpl.cpp index 8952ac48662e2c..b3ec3b80ce8291 100644 --- a/src/platform/ESP32/nimble/BLEManagerImpl.cpp +++ b/src/platform/ESP32/nimble/BLEManagerImpl.cpp @@ -162,23 +162,6 @@ CHIP_ERROR BLEManagerImpl::_Init() return err; } -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - - if (val != mServiceMode) - { - mServiceMode = val; - PlatformMgr().ScheduleWork(DriveBLEState, 0); - } - -exit: - return err; -} - CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/platform/Linux/BLEManagerImpl.cpp b/src/platform/Linux/BLEManagerImpl.cpp index 4e1ad383e272cd..7de6ac8dba6e1d 100644 --- a/src/platform/Linux/BLEManagerImpl.cpp +++ b/src/platform/Linux/BLEManagerImpl.cpp @@ -99,23 +99,6 @@ void BLEManagerImpl::_Shutdown() mDeviceScanner.reset(); } -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(mServiceMode == ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - - if (val != mServiceMode) - { - mServiceMode = val; - PlatformMgr().ScheduleWork(DriveBLEState, 0); - } - -exit: - return err; -} - CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/platform/Linux/BLEManagerImpl.h b/src/platform/Linux/BLEManagerImpl.h index 6d898dc7a62c1f..eed743e6c53b7c 100644 --- a/src/platform/Linux/BLEManagerImpl.h +++ b/src/platform/Linux/BLEManagerImpl.h @@ -113,8 +113,6 @@ class BLEManagerImpl final : public BLEManager, CHIP_ERROR _Init(); void _Shutdown(); - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsAdvertising(); @@ -233,11 +231,6 @@ inline Ble::BleLayer * BLEManagerImpl::_GetBleLayer() return this; } -inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode() -{ - return mServiceMode; -} - inline bool BLEManagerImpl::_IsAdvertisingEnabled() { return mFlags.Has(Flags::kAdvertisingEnabled); diff --git a/src/platform/P6/BLEManagerImpl.cpp b/src/platform/P6/BLEManagerImpl.cpp index d0f0c2f434ae42..134fc0123fc7a0 100644 --- a/src/platform/P6/BLEManagerImpl.cpp +++ b/src/platform/P6/BLEManagerImpl.cpp @@ -133,23 +133,6 @@ CHIP_ERROR BLEManagerImpl::_Init() return err; } -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - - if (val != mServiceMode) - { - mServiceMode = val; - PlatformMgr().ScheduleWork(DriveBLEState, 0); - } - -exit: - return err; -} - bool BLEManagerImpl::_IsAdvertisingEnabled(void) { return mFlags.Has(Flags::kFlag_AdvertisingEnabled); diff --git a/src/platform/P6/BLEManagerImpl.h b/src/platform/P6/BLEManagerImpl.h index 5f470962bf0ae8..d97fa47212cf1d 100644 --- a/src/platform/P6/BLEManagerImpl.h +++ b/src/platform/P6/BLEManagerImpl.h @@ -52,8 +52,6 @@ class BLEManagerImpl final : public BLEManager, CHIP_ERROR _Init(void); void _Shutdown() {} - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(void); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsFastAdvertisingEnabled(void); diff --git a/src/platform/Tizen/BLEManagerImpl.cpp b/src/platform/Tizen/BLEManagerImpl.cpp index af9f473baba074..4fa9d66c1deab1 100644 --- a/src/platform/Tizen/BLEManagerImpl.cpp +++ b/src/platform/Tizen/BLEManagerImpl.cpp @@ -65,9 +65,6 @@ static constexpr unsigned kNewConnectionScanTimeoutMs = 10000; /* Tizen Default Connect Timeout */ constexpr System::Clock::Timeout kConnectTimeoutMs = System::Clock::Seconds16(10); -const int BtpServiceDataLenMax = - 7; // OpCode(1) + Discriminator(2) + VendorId(2) + ProductId(2), 5.2.3.8.6. Advertising Data, CHIP Specification - static void __AdapterStateChangedCb(int result, bt_adapter_state_e adapterState, void * userData) { ChipLogProgress(DeviceLayer, "Adapter State Changed: %s", adapterState == BT_ADAPTER_ENABLED ? "Enabled" : "Disabled"); @@ -584,9 +581,9 @@ int BLEManagerImpl::RegisterGATTServer() int BLEManagerImpl::StartAdvertising() { - int ret = BT_ERROR_NONE; - CHIP_ERROR err = CHIP_NO_ERROR; - char service_data[BtpServiceDataLenMax] = { + int ret = BT_ERROR_NONE; + CHIP_ERROR err = CHIP_NO_ERROR; + char service_data[sizeof(ChipBLEDeviceIdentificationInfo)] = { 0x0, }; // need to fill advertising data. 5.2.3.8.6. Advertising Data, CHIP Specification ChipBLEDeviceIdentificationInfo deviceIdInfo = { @@ -929,23 +926,6 @@ CHIP_ERROR BLEManagerImpl::_Init(void) return err; } -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(mServiceMode == ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - - if (val != mServiceMode) - { - mServiceMode = val; - PlatformMgr().ScheduleWork(DriveBLEState, 0); - } - -exit: - return err; -} - CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val) { mFlags.Set(Flags::kAdvertisingEnabled, val); diff --git a/src/platform/Tizen/BLEManagerImpl.h b/src/platform/Tizen/BLEManagerImpl.h index 36dfa463f31510..a54d6ec9d7e792 100644 --- a/src/platform/Tizen/BLEManagerImpl.h +++ b/src/platform/Tizen/BLEManagerImpl.h @@ -88,8 +88,6 @@ class BLEManagerImpl final : public BLEManager, CHIP_ERROR _Init(void); void _Shutdown() {} - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(void); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsAdvertising(void); @@ -253,11 +251,6 @@ inline Ble::BleLayer * BLEManagerImpl::_GetBleLayer() return this; } -inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode() -{ - return mServiceMode; -} - inline bool BLEManagerImpl::_IsAdvertisingEnabled() { return mFlags.Has(Flags::kAdvertisingEnabled); diff --git a/src/platform/Zephyr/BLEManagerImpl.cpp b/src/platform/Zephyr/BLEManagerImpl.cpp index b95fcccdbeca79..8aa322afcfb16c 100644 --- a/src/platform/Zephyr/BLEManagerImpl.cpp +++ b/src/platform/Zephyr/BLEManagerImpl.cpp @@ -352,21 +352,6 @@ CHIP_ERROR BLEManagerImpl::StopAdvertising(void) return CHIP_NO_ERROR; } -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - VerifyOrReturnError(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, - CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - - if (val != mServiceMode) - { - mServiceMode = val; - PlatformMgr().ScheduleWork(DriveBLEState, 0); - } - - return CHIP_NO_ERROR; -} - CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val) { VerifyOrReturnError(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, diff --git a/src/platform/Zephyr/BLEManagerImpl.h b/src/platform/Zephyr/BLEManagerImpl.h index e72adbfe604a60..a99847c9f90168 100644 --- a/src/platform/Zephyr/BLEManagerImpl.h +++ b/src/platform/Zephyr/BLEManagerImpl.h @@ -60,8 +60,6 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla CHIP_ERROR _Init(void); void _Shutdown() {} - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(void); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsAdvertising(void); @@ -186,11 +184,6 @@ inline BleLayer * BLEManagerImpl::_GetBleLayer() return this; } -inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void) -{ - return mServiceMode; -} - inline bool BLEManagerImpl::_IsAdvertisingEnabled(void) { return mFlags.Has(Flags::kAdvertisingEnabled); diff --git a/src/platform/Zephyr/KeyValueStoreManagerImpl.cpp b/src/platform/Zephyr/KeyValueStoreManagerImpl.cpp index 35c205db549815..da254e615263bc 100644 --- a/src/platform/Zephyr/KeyValueStoreManagerImpl.cpp +++ b/src/platform/Zephyr/KeyValueStoreManagerImpl.cpp @@ -44,7 +44,7 @@ struct ReadEntry struct DeleteSubtreeEntry { - CHIP_ERROR result; + int result; }; // Random magic bytes to represent an empty value. @@ -128,11 +128,16 @@ int DeleteSubtreeCallback(const char * name, size_t /* entrySize */, settings_re void * param) { DeleteSubtreeEntry & entry = *static_cast(param); - const CHIP_ERROR error = KeyValueStoreMgr().Delete(name); + char fullKey[SETTINGS_MAX_NAME_LEN + 1]; + + // name comes from Zephyr settings subsystem so it is guaranteed to fit in the buffer. + (void) snprintf(fullKey, sizeof(fullKey), CHIP_DEVICE_CONFIG_SETTINGS_KEY "/%s", name); + const int result = settings_delete(fullKey); - if (entry.result == CHIP_NO_ERROR) + // Return the first error, but continue removing remaining keys anyway. + if (entry.result == 0) { - entry.result = error; + entry.result = result; } return 0; @@ -199,11 +204,15 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Delete(const char * key) CHIP_ERROR KeyValueStoreManagerImpl::DoFactoryReset() { - DeleteSubtreeEntry entry{ CHIP_NO_ERROR }; - const int result = settings_load_subtree_direct(CHIP_DEVICE_CONFIG_SETTINGS_KEY, DeleteSubtreeCallback, &entry); + DeleteSubtreeEntry entry{ /* success */ 0 }; + int result = settings_load_subtree_direct(CHIP_DEVICE_CONFIG_SETTINGS_KEY, DeleteSubtreeCallback, &entry); - VerifyOrReturnError(result == 0, System::MapErrorZephyr(result)); - return entry.result; + if (result == 0) + { + result = entry.result; + } + + return System::MapErrorZephyr(result); } } // namespace PersistedStorage diff --git a/src/platform/Zephyr/ZephyrConfig.cpp b/src/platform/Zephyr/ZephyrConfig.cpp index 72b2ab201fca8e..60a17788a3cff0 100644 --- a/src/platform/Zephyr/ZephyrConfig.cpp +++ b/src/platform/Zephyr/ZephyrConfig.cpp @@ -49,18 +49,19 @@ namespace Internal { #define NAMESPACE_COUNTERS CHIP_DEVICE_CONFIG_SETTINGS_KEY "/ctr/" // Keys stored in the chip factory nam -const ZephyrConfig::Key ZephyrConfig::kConfigKey_SerialNum = CONFIG_KEY(NAMESPACE_FACTORY "serial-num"); -const ZephyrConfig::Key ZephyrConfig::kConfigKey_MfrDeviceId = CONFIG_KEY(NAMESPACE_FACTORY "device-id"); -const ZephyrConfig::Key ZephyrConfig::kConfigKey_MfrDeviceCert = CONFIG_KEY(NAMESPACE_FACTORY "device-cert"); -const ZephyrConfig::Key ZephyrConfig::kConfigKey_MfrDeviceICACerts = CONFIG_KEY(NAMESPACE_FACTORY "device-ca-certs"); -const ZephyrConfig::Key ZephyrConfig::kConfigKey_MfrDevicePrivateKey = CONFIG_KEY(NAMESPACE_FACTORY "device-key"); -const ZephyrConfig::Key ZephyrConfig::kConfigKey_HardwareVersion = CONFIG_KEY(NAMESPACE_FACTORY "hardware-ver"); -const ZephyrConfig::Key ZephyrConfig::kConfigKey_ManufacturingDate = CONFIG_KEY(NAMESPACE_FACTORY "mfg-date"); -const ZephyrConfig::Key ZephyrConfig::kConfigKey_SetupPinCode = CONFIG_KEY(NAMESPACE_FACTORY "pin-code"); -const ZephyrConfig::Key ZephyrConfig::kConfigKey_SetupDiscriminator = CONFIG_KEY(NAMESPACE_FACTORY "discriminator"); -const ZephyrConfig::Key ZephyrConfig::kConfigKey_Spake2pIterationCount = CONFIG_KEY(NAMESPACE_FACTORY "iteration-count"); -const ZephyrConfig::Key ZephyrConfig::kConfigKey_Spake2pSalt = CONFIG_KEY(NAMESPACE_FACTORY "salt"); -const ZephyrConfig::Key ZephyrConfig::kConfigKey_Spake2pVerifier = CONFIG_KEY(NAMESPACE_FACTORY "verifier"); +const ZephyrConfig::Key ZephyrConfig::kConfigKey_SerialNum = CONFIG_KEY(NAMESPACE_FACTORY "serial-num"); +const ZephyrConfig::Key ZephyrConfig::kConfigKey_MfrDeviceId = CONFIG_KEY(NAMESPACE_FACTORY "device-id"); +const ZephyrConfig::Key ZephyrConfig::kConfigKey_MfrDeviceCert = CONFIG_KEY(NAMESPACE_FACTORY "device-cert"); +const ZephyrConfig::Key ZephyrConfig::kConfigKey_MfrDeviceICACerts = CONFIG_KEY(NAMESPACE_FACTORY "device-ca-certs"); +const ZephyrConfig::Key ZephyrConfig::kConfigKey_MfrDevicePrivateKey = CONFIG_KEY(NAMESPACE_FACTORY "device-key"); +const ZephyrConfig::Key ZephyrConfig::kConfigKey_HardwareVersion = CONFIG_KEY(NAMESPACE_FACTORY "hardware-ver"); +const ZephyrConfig::Key ZephyrConfig::kConfigKey_ManufacturingDate = CONFIG_KEY(NAMESPACE_FACTORY "mfg-date"); +const ZephyrConfig::Key ZephyrConfig::kConfigKey_SetupPinCode = CONFIG_KEY(NAMESPACE_FACTORY "pin-code"); +const ZephyrConfig::Key ZephyrConfig::kConfigKey_SetupDiscriminator = CONFIG_KEY(NAMESPACE_FACTORY "discriminator"); +const ZephyrConfig::Key ZephyrConfig::kConfigKey_Spake2pIterationCount = CONFIG_KEY(NAMESPACE_FACTORY "iteration-count"); +const ZephyrConfig::Key ZephyrConfig::kConfigKey_Spake2pSalt = CONFIG_KEY(NAMESPACE_FACTORY "salt"); +const ZephyrConfig::Key ZephyrConfig::kConfigKey_Spake2pVerifier = CONFIG_KEY(NAMESPACE_FACTORY "verifier"); +const ZephyrConfig::Key ZephyrConfig::kConfigKey_CertificationDeclaration = CONFIG_KEY(NAMESPACE_FACTORY "cert-declaration"); // Keys stored in the chip config namespace // NOTE: update sAllResettableConfigKeys definition when adding a new entry below const ZephyrConfig::Key ZephyrConfig::kConfigKey_ServiceConfig = CONFIG_KEY(NAMESPACE_CONFIG "service-config"); diff --git a/src/platform/Zephyr/ZephyrConfig.h b/src/platform/Zephyr/ZephyrConfig.h index bf18c131965125..b451d0c13997e9 100644 --- a/src/platform/Zephyr/ZephyrConfig.h +++ b/src/platform/Zephyr/ZephyrConfig.h @@ -23,7 +23,8 @@ #pragma once -#include +#include +#include namespace chip { namespace DeviceLayer { @@ -63,6 +64,7 @@ class ZephyrConfig static const Key kConfigKey_Spake2pIterationCount; static const Key kConfigKey_Spake2pSalt; static const Key kConfigKey_Spake2pVerifier; + static const Key kConfigKey_CertificationDeclaration; static const Key kCounterKey_RebootCount; static const Key kCounterKey_BootReason; diff --git a/src/platform/android/BLEManagerImpl.cpp b/src/platform/android/BLEManagerImpl.cpp index 2fa6556677cebd..4aab1c74c62aaa 100644 --- a/src/platform/android/BLEManagerImpl.cpp +++ b/src/platform/android/BLEManagerImpl.cpp @@ -161,24 +161,6 @@ CHIP_ERROR BLEManagerImpl::_Init() return err; } -BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode() -{ - bool has = false; - CHIP_ERROR err = HasFlag(Flags::kServiceModeEnabled, has); - - VerifyOrReturnError(err == CHIP_NO_ERROR, ConnectivityManager::kCHIPoBLEServiceMode_NotSupported); - return has ? ConnectivityManager::kCHIPoBLEServiceMode_Enabled : ConnectivityManager::kCHIPoBLEServiceMode_Disabled; -} - -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - ReturnErrorCodeIf(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, CHIP_ERROR_INVALID_ARGUMENT); - - bool isSet = (val == ConnectivityManager::kCHIPoBLEServiceMode_Enabled) ? true : false; - - return SetFlag(Flags::kServiceModeEnabled, isSet); -} - bool BLEManagerImpl::_IsAdvertisingEnabled() { bool has = false; diff --git a/src/platform/android/BLEManagerImpl.h b/src/platform/android/BLEManagerImpl.h index af014c1a10990e..718db85c71b147 100644 --- a/src/platform/android/BLEManagerImpl.h +++ b/src/platform/android/BLEManagerImpl.h @@ -57,8 +57,6 @@ class BLEManagerImpl final : public BLEManager, CHIP_ERROR _Init(); void _Shutdown() {} - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsAdvertising(); diff --git a/src/platform/bouffalolab/BL602/BLEManagerImpl.cpp b/src/platform/bouffalolab/BL602/BLEManagerImpl.cpp index 947598e0d8c4f5..2ac59f4320f1dc 100644 --- a/src/platform/bouffalolab/BL602/BLEManagerImpl.cpp +++ b/src/platform/bouffalolab/BL602/BLEManagerImpl.cpp @@ -363,23 +363,6 @@ CHIP_ERROR BLEManagerImpl::StopAdvertising(void) return CHIP_NO_ERROR; } -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - - if (val != mServiceMode) - { - mServiceMode = val; - PlatformMgr().ScheduleWork(DriveBLEState, 0); - } - -exit: - return err; -} - CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/platform/bouffalolab/BL602/BLEManagerImpl.h b/src/platform/bouffalolab/BL602/BLEManagerImpl.h index 0e7fc523c6ae0f..33ab32a4078cd6 100644 --- a/src/platform/bouffalolab/BL602/BLEManagerImpl.h +++ b/src/platform/bouffalolab/BL602/BLEManagerImpl.h @@ -51,8 +51,6 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla CHIP_ERROR _Init(void); void _Shutdown() {} - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(void); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsAdvertising(void); @@ -166,11 +164,6 @@ inline BleLayer * BLEManagerImpl::_GetBleLayer() return this; } -inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void) -{ - return mServiceMode; -} - inline bool BLEManagerImpl::_IsAdvertisingEnabled(void) { return mFlags.Has(Flags::kAdvertisingEnabled); diff --git a/src/platform/cc13x2_26x2/BLEManagerImpl.cpp b/src/platform/cc13x2_26x2/BLEManagerImpl.cpp index 096d10e3198271..3f1ea583bdc716 100644 --- a/src/platform/cc13x2_26x2/BLEManagerImpl.cpp +++ b/src/platform/cc13x2_26x2/BLEManagerImpl.cpp @@ -125,19 +125,6 @@ CHIP_ERROR BLEManagerImpl::_Init(void) return err; } -BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void) -{ - return mServiceMode; -} - -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(BLEManager::CHIPoBLEServiceMode val) -{ - mServiceMode = val; - - /* Trigger state update */ - return DriveBLEState(); -} - bool BLEManagerImpl::_IsAdvertisingEnabled(void) { return mFlags.Has(Flags::kAdvertisingEnabled); diff --git a/src/platform/cc13x2_26x2/BLEManagerImpl.h b/src/platform/cc13x2_26x2/BLEManagerImpl.h index 42f2181d0dd2ad..668778e4084d9f 100644 --- a/src/platform/cc13x2_26x2/BLEManagerImpl.h +++ b/src/platform/cc13x2_26x2/BLEManagerImpl.h @@ -208,8 +208,6 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla CHIP_ERROR _Init(void); void _Shutdown() {} - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(void); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsAdvertising(void); diff --git a/src/platform/mbed/BLEManagerImpl.cpp b/src/platform/mbed/BLEManagerImpl.cpp index d147a982bc2f47..4cb7214a11c875 100644 --- a/src/platform/mbed/BLEManagerImpl.cpp +++ b/src/platform/mbed/BLEManagerImpl.cpp @@ -831,23 +831,6 @@ CHIP_ERROR BLEManagerImpl::StopAdvertising(void) return err; } -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - - if (val != mServiceMode) - { - mServiceMode = val; - PlatformMgr().ScheduleWork(DriveBLEState, 0); - } - -exit: - return err; -} - CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/platform/mbed/BLEManagerImpl.h b/src/platform/mbed/BLEManagerImpl.h index 31db5f9f5ef294..e642b1276493f0 100644 --- a/src/platform/mbed/BLEManagerImpl.h +++ b/src/platform/mbed/BLEManagerImpl.h @@ -47,8 +47,6 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla CHIP_ERROR _Init(void); void _Shutdown() {} - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(void); CHIP_ERROR _SetAdvertisingMode(BLEAdvertisingMode mode); CHIP_ERROR _SetAdvertisingEnabled(bool val); @@ -151,11 +149,6 @@ inline BleLayer * BLEManagerImpl::_GetBleLayer() return this; } -inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void) -{ - return mServiceMode; -} - inline bool BLEManagerImpl::_IsAdvertisingEnabled(void) { return mFlags.Has(Flags::kFlag_AdvertisingEnabled); diff --git a/src/platform/nrfconnect/BUILD.gn b/src/platform/nrfconnect/BUILD.gn index e95a2742eb6f75..928c3c045b4725 100644 --- a/src/platform/nrfconnect/BUILD.gn +++ b/src/platform/nrfconnect/BUILD.gn @@ -49,7 +49,11 @@ static_library("nrfconnect") { "SystemPlatformConfig.h", ] - public = [ "${chip_root}/src/credentials/DeviceAttestationCredsProvider.h" ] + public = [ + "${chip_root}/src/credentials/CHIPCert.h", + "${chip_root}/src/credentials/CertificationDeclaration.h", + "${chip_root}/src/credentials/DeviceAttestationCredsProvider.h", + ] public_deps = [ "${chip_root}/src/platform:platform_base" ] diff --git a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h index 73919004875c82..087b06bdcabbc5 100644 --- a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h +++ b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h @@ -124,6 +124,58 @@ #endif // !defined(CONFIG_CHIP_MALLOC_SYS_HEAP) && defined(CONFIG_NEWLIB_LIBC) #endif // CHIP_DEVICE_CONFIG_HEAP_STATISTICS_MALLINFO +#ifndef CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION +//-> format_version = 1 +//-> vendor_id = 0xFFF1 +//-> product_id_array = [ 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007, 0x8008, 0x8009, 0x800A, 0x800B, +// 0x800C, 0x800D, 0x800E, 0x800F, 0x8010, 0x8011, 0x8012, 0x8013, 0x8014, 0x8015, 0x8016, 0x8017, 0x8018, 0x8019, 0x801A, +// 0x801B, 0x801C, 0x801D, 0x801E, 0x801F, 0x8020, 0x8021, 0x8022, 0x8023, 0x8024, 0x8025, 0x8026, 0x8027, 0x8028, 0x8029, +// 0x802A, 0x802B, 0x802C, 0x802D, 0x802E, 0x802F, 0x8030, 0x8031, 0x8032, 0x8033, 0x8034, 0x8035, 0x8036, 0x8037, 0x8038, +// 0x8039, 0x803A, 0x803B, 0x803C, 0x803D, 0x803E, 0x803F, 0x8040, 0x8041, 0x8042, 0x8043, 0x8044, 0x8045, 0x8046, 0x8047, +// 0x8048, 0x8049, 0x804A, 0x804B, 0x804C, 0x804D, 0x804E, 0x804F, 0x8050, 0x8051, 0x8052, 0x8053, 0x8054, 0x8055, 0x8056, +// 0x8057, 0x8058, 0x8059, 0x805A, 0x805B, 0x805C, 0x805D, 0x805E, 0x805F, 0x8060, 0x8061, 0x8062, 0x8063 ] +//-> device_type_id = 0x0016 +//-> certificate_id = "ZIG20142ZB330003-24" +//-> security_level = 0 +//-> security_information = 0 +//-> version_number = 0x2694 +//-> certification_type = 0 +//-> dac_origin_vendor_id is not present +//-> dac_origin_product_id is not present +#define CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION \ + { \ + 0x30, 0x82, 0x02, 0x19, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x0a, 0x30, \ + 0x82, 0x02, 0x06, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, \ + 0x02, 0x01, 0x30, 0x82, 0x01, 0x71, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, \ + 0x01, 0x62, 0x04, 0x82, 0x01, 0x5e, 0x15, 0x24, 0x00, 0x01, 0x25, 0x01, 0xf1, 0xff, 0x36, 0x02, 0x05, 0x00, 0x80, \ + 0x05, 0x01, 0x80, 0x05, 0x02, 0x80, 0x05, 0x03, 0x80, 0x05, 0x04, 0x80, 0x05, 0x05, 0x80, 0x05, 0x06, 0x80, 0x05, \ + 0x07, 0x80, 0x05, 0x08, 0x80, 0x05, 0x09, 0x80, 0x05, 0x0a, 0x80, 0x05, 0x0b, 0x80, 0x05, 0x0c, 0x80, 0x05, 0x0d, \ + 0x80, 0x05, 0x0e, 0x80, 0x05, 0x0f, 0x80, 0x05, 0x10, 0x80, 0x05, 0x11, 0x80, 0x05, 0x12, 0x80, 0x05, 0x13, 0x80, \ + 0x05, 0x14, 0x80, 0x05, 0x15, 0x80, 0x05, 0x16, 0x80, 0x05, 0x17, 0x80, 0x05, 0x18, 0x80, 0x05, 0x19, 0x80, 0x05, \ + 0x1a, 0x80, 0x05, 0x1b, 0x80, 0x05, 0x1c, 0x80, 0x05, 0x1d, 0x80, 0x05, 0x1e, 0x80, 0x05, 0x1f, 0x80, 0x05, 0x20, \ + 0x80, 0x05, 0x21, 0x80, 0x05, 0x22, 0x80, 0x05, 0x23, 0x80, 0x05, 0x24, 0x80, 0x05, 0x25, 0x80, 0x05, 0x26, 0x80, \ + 0x05, 0x27, 0x80, 0x05, 0x28, 0x80, 0x05, 0x29, 0x80, 0x05, 0x2a, 0x80, 0x05, 0x2b, 0x80, 0x05, 0x2c, 0x80, 0x05, \ + 0x2d, 0x80, 0x05, 0x2e, 0x80, 0x05, 0x2f, 0x80, 0x05, 0x30, 0x80, 0x05, 0x31, 0x80, 0x05, 0x32, 0x80, 0x05, 0x33, \ + 0x80, 0x05, 0x34, 0x80, 0x05, 0x35, 0x80, 0x05, 0x36, 0x80, 0x05, 0x37, 0x80, 0x05, 0x38, 0x80, 0x05, 0x39, 0x80, \ + 0x05, 0x3a, 0x80, 0x05, 0x3b, 0x80, 0x05, 0x3c, 0x80, 0x05, 0x3d, 0x80, 0x05, 0x3e, 0x80, 0x05, 0x3f, 0x80, 0x05, \ + 0x40, 0x80, 0x05, 0x41, 0x80, 0x05, 0x42, 0x80, 0x05, 0x43, 0x80, 0x05, 0x44, 0x80, 0x05, 0x45, 0x80, 0x05, 0x46, \ + 0x80, 0x05, 0x47, 0x80, 0x05, 0x48, 0x80, 0x05, 0x49, 0x80, 0x05, 0x4a, 0x80, 0x05, 0x4b, 0x80, 0x05, 0x4c, 0x80, \ + 0x05, 0x4d, 0x80, 0x05, 0x4e, 0x80, 0x05, 0x4f, 0x80, 0x05, 0x50, 0x80, 0x05, 0x51, 0x80, 0x05, 0x52, 0x80, 0x05, \ + 0x53, 0x80, 0x05, 0x54, 0x80, 0x05, 0x55, 0x80, 0x05, 0x56, 0x80, 0x05, 0x57, 0x80, 0x05, 0x58, 0x80, 0x05, 0x59, \ + 0x80, 0x05, 0x5a, 0x80, 0x05, 0x5b, 0x80, 0x05, 0x5c, 0x80, 0x05, 0x5d, 0x80, 0x05, 0x5e, 0x80, 0x05, 0x5f, 0x80, \ + 0x05, 0x60, 0x80, 0x05, 0x61, 0x80, 0x05, 0x62, 0x80, 0x05, 0x63, 0x80, 0x18, 0x24, 0x03, 0x16, 0x2c, 0x04, 0x13, \ + 0x5a, 0x49, 0x47, 0x32, 0x30, 0x31, 0x34, 0x32, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, 0x33, 0x2d, 0x32, 0x34, \ + 0x24, 0x05, 0x00, 0x24, 0x06, 0x00, 0x25, 0x07, 0x94, 0x26, 0x24, 0x08, 0x00, 0x18, 0x31, 0x7d, 0x30, 0x7b, 0x02, \ + 0x01, 0x03, 0x80, 0x14, 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, 0xdd, \ + 0xf5, 0x04, 0xf3, 0x71, 0x60, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, \ + 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x47, 0x30, 0x45, 0x02, 0x20, 0x24, 0xe5, \ + 0xd1, 0xf4, 0x7a, 0x7d, 0x7b, 0x0d, 0x20, 0x6a, 0x26, 0xef, 0x69, 0x9b, 0x7c, 0x97, 0x57, 0xb7, 0x2d, 0x46, 0x90, \ + 0x89, 0xde, 0x31, 0x92, 0xe6, 0x78, 0xc7, 0x45, 0xe7, 0xf6, 0x0c, 0x02, 0x21, 0x00, 0xf8, 0xaa, 0x2f, 0xa7, 0x11, \ + 0xfc, 0xb7, 0x9b, 0x97, 0xe3, 0x97, 0xce, 0xda, 0x66, 0x7b, 0xae, 0x46, 0x4e, 0x2b, 0xd3, 0xff, 0xdf, 0xc3, 0xcc, \ + 0xed, 0x7a, 0xa8, 0xca, 0x5f, 0x4c, 0x1a, 0x7c \ + } +#endif + // ========== Platform-specific Configuration Overrides ========= #ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY diff --git a/src/platform/nrfconnect/FactoryDataParser.c b/src/platform/nrfconnect/FactoryDataParser.c index c297a8d29008b7..3036fb57f58363 100644 --- a/src/platform/nrfconnect/FactoryDataParser.c +++ b/src/platform/nrfconnect/FactoryDataParser.c @@ -149,6 +149,10 @@ bool ParseFactoryData(uint8_t * buffer, uint16_t bufferSize, struct FactoryData { res = res && zcbor_bstr_decode(states, (struct zcbor_string *) &factoryData->product_name); } + else if (strncmp("enable_key", (const char *) currentString.value, currentString.len) == 0) + { + res = res && zcbor_bstr_decode(states, (struct zcbor_string *) &factoryData->enable_key); + } else if (strncmp("user", (const char *) currentString.value, currentString.len) == 0) { res = res && zcbor_bstr_decode(states, (struct zcbor_string *) &factoryData->user); diff --git a/src/platform/nrfconnect/FactoryDataParser.h b/src/platform/nrfconnect/FactoryDataParser.h index 53b78a816ae142..156010ab66c527 100644 --- a/src/platform/nrfconnect/FactoryDataParser.h +++ b/src/platform/nrfconnect/FactoryDataParser.h @@ -53,6 +53,7 @@ struct FactoryData struct FactoryDataString spake2_verifier; uint16_t discriminator; uint32_t passcode; + struct FactoryDataString enable_key; struct FactoryDataString user; bool vendorIdPresent; diff --git a/src/platform/nrfconnect/FactoryDataProvider.cpp b/src/platform/nrfconnect/FactoryDataProvider.cpp index 70ca9c7436a8ac..967226cfc107a4 100644 --- a/src/platform/nrfconnect/FactoryDataProvider.cpp +++ b/src/platform/nrfconnect/FactoryDataProvider.cpp @@ -19,6 +19,11 @@ #include "CHIPDevicePlatformConfig.h" #include +#if CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE +#include +#include +#endif + #include namespace chip { @@ -84,53 +89,18 @@ CHIP_ERROR FactoryDataProvider::Init() template CHIP_ERROR FactoryDataProvider::GetCertificationDeclaration(MutableByteSpan & outBuffer) { - //-> format_version = 1 - //-> vendor_id = 0xFFF1 - //-> product_id_array = [ 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007, 0x8008, 0x8009, 0x800A, 0x800B, - // 0x800C, 0x800D, 0x800E, 0x800F, 0x8010, 0x8011, 0x8012, 0x8013, 0x8014, 0x8015, 0x8016, 0x8017, 0x8018, 0x8019, 0x801A, - // 0x801B, 0x801C, 0x801D, 0x801E, 0x801F, 0x8020, 0x8021, 0x8022, 0x8023, 0x8024, 0x8025, 0x8026, 0x8027, 0x8028, 0x8029, - // 0x802A, 0x802B, 0x802C, 0x802D, 0x802E, 0x802F, 0x8030, 0x8031, 0x8032, 0x8033, 0x8034, 0x8035, 0x8036, 0x8037, 0x8038, - // 0x8039, 0x803A, 0x803B, 0x803C, 0x803D, 0x803E, 0x803F, 0x8040, 0x8041, 0x8042, 0x8043, 0x8044, 0x8045, 0x8046, 0x8047, - // 0x8048, 0x8049, 0x804A, 0x804B, 0x804C, 0x804D, 0x804E, 0x804F, 0x8050, 0x8051, 0x8052, 0x8053, 0x8054, 0x8055, 0x8056, - // 0x8057, 0x8058, 0x8059, 0x805A, 0x805B, 0x805C, 0x805D, 0x805E, 0x805F, 0x8060, 0x8061, 0x8062, 0x8063 ] - //-> device_type_id = 0x0016 - //-> certificate_id = "ZIG20142ZB330003-24" - //-> security_level = 0 - //-> security_information = 0 - //-> version_number = 0x2694 - //-> certification_type = 0 - //-> dac_origin_vendor_id is not present - //-> dac_origin_product_id is not present - const uint8_t kCdForAllExamples[541] = { - 0x30, 0x82, 0x02, 0x19, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x0a, 0x30, - 0x82, 0x02, 0x06, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, - 0x01, 0x30, 0x82, 0x01, 0x71, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, 0x01, 0x62, - 0x04, 0x82, 0x01, 0x5e, 0x15, 0x24, 0x00, 0x01, 0x25, 0x01, 0xf1, 0xff, 0x36, 0x02, 0x05, 0x00, 0x80, 0x05, 0x01, 0x80, - 0x05, 0x02, 0x80, 0x05, 0x03, 0x80, 0x05, 0x04, 0x80, 0x05, 0x05, 0x80, 0x05, 0x06, 0x80, 0x05, 0x07, 0x80, 0x05, 0x08, - 0x80, 0x05, 0x09, 0x80, 0x05, 0x0a, 0x80, 0x05, 0x0b, 0x80, 0x05, 0x0c, 0x80, 0x05, 0x0d, 0x80, 0x05, 0x0e, 0x80, 0x05, - 0x0f, 0x80, 0x05, 0x10, 0x80, 0x05, 0x11, 0x80, 0x05, 0x12, 0x80, 0x05, 0x13, 0x80, 0x05, 0x14, 0x80, 0x05, 0x15, 0x80, - 0x05, 0x16, 0x80, 0x05, 0x17, 0x80, 0x05, 0x18, 0x80, 0x05, 0x19, 0x80, 0x05, 0x1a, 0x80, 0x05, 0x1b, 0x80, 0x05, 0x1c, - 0x80, 0x05, 0x1d, 0x80, 0x05, 0x1e, 0x80, 0x05, 0x1f, 0x80, 0x05, 0x20, 0x80, 0x05, 0x21, 0x80, 0x05, 0x22, 0x80, 0x05, - 0x23, 0x80, 0x05, 0x24, 0x80, 0x05, 0x25, 0x80, 0x05, 0x26, 0x80, 0x05, 0x27, 0x80, 0x05, 0x28, 0x80, 0x05, 0x29, 0x80, - 0x05, 0x2a, 0x80, 0x05, 0x2b, 0x80, 0x05, 0x2c, 0x80, 0x05, 0x2d, 0x80, 0x05, 0x2e, 0x80, 0x05, 0x2f, 0x80, 0x05, 0x30, - 0x80, 0x05, 0x31, 0x80, 0x05, 0x32, 0x80, 0x05, 0x33, 0x80, 0x05, 0x34, 0x80, 0x05, 0x35, 0x80, 0x05, 0x36, 0x80, 0x05, - 0x37, 0x80, 0x05, 0x38, 0x80, 0x05, 0x39, 0x80, 0x05, 0x3a, 0x80, 0x05, 0x3b, 0x80, 0x05, 0x3c, 0x80, 0x05, 0x3d, 0x80, - 0x05, 0x3e, 0x80, 0x05, 0x3f, 0x80, 0x05, 0x40, 0x80, 0x05, 0x41, 0x80, 0x05, 0x42, 0x80, 0x05, 0x43, 0x80, 0x05, 0x44, - 0x80, 0x05, 0x45, 0x80, 0x05, 0x46, 0x80, 0x05, 0x47, 0x80, 0x05, 0x48, 0x80, 0x05, 0x49, 0x80, 0x05, 0x4a, 0x80, 0x05, - 0x4b, 0x80, 0x05, 0x4c, 0x80, 0x05, 0x4d, 0x80, 0x05, 0x4e, 0x80, 0x05, 0x4f, 0x80, 0x05, 0x50, 0x80, 0x05, 0x51, 0x80, - 0x05, 0x52, 0x80, 0x05, 0x53, 0x80, 0x05, 0x54, 0x80, 0x05, 0x55, 0x80, 0x05, 0x56, 0x80, 0x05, 0x57, 0x80, 0x05, 0x58, - 0x80, 0x05, 0x59, 0x80, 0x05, 0x5a, 0x80, 0x05, 0x5b, 0x80, 0x05, 0x5c, 0x80, 0x05, 0x5d, 0x80, 0x05, 0x5e, 0x80, 0x05, - 0x5f, 0x80, 0x05, 0x60, 0x80, 0x05, 0x61, 0x80, 0x05, 0x62, 0x80, 0x05, 0x63, 0x80, 0x18, 0x24, 0x03, 0x16, 0x2c, 0x04, - 0x13, 0x5a, 0x49, 0x47, 0x32, 0x30, 0x31, 0x34, 0x32, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, 0x33, 0x2d, 0x32, 0x34, - 0x24, 0x05, 0x00, 0x24, 0x06, 0x00, 0x25, 0x07, 0x94, 0x26, 0x24, 0x08, 0x00, 0x18, 0x31, 0x7d, 0x30, 0x7b, 0x02, 0x01, - 0x03, 0x80, 0x14, 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, 0xdd, 0xf5, 0x04, - 0xf3, 0x71, 0x60, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x0a, 0x06, 0x08, - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x47, 0x30, 0x45, 0x02, 0x20, 0x24, 0xe5, 0xd1, 0xf4, 0x7a, 0x7d, - 0x7b, 0x0d, 0x20, 0x6a, 0x26, 0xef, 0x69, 0x9b, 0x7c, 0x97, 0x57, 0xb7, 0x2d, 0x46, 0x90, 0x89, 0xde, 0x31, 0x92, 0xe6, - 0x78, 0xc7, 0x45, 0xe7, 0xf6, 0x0c, 0x02, 0x21, 0x00, 0xf8, 0xaa, 0x2f, 0xa7, 0x11, 0xfc, 0xb7, 0x9b, 0x97, 0xe3, 0x97, - 0xce, 0xda, 0x66, 0x7b, 0xae, 0x46, 0x4e, 0x2b, 0xd3, 0xff, 0xdf, 0xc3, 0xcc, 0xed, 0x7a, 0xa8, 0xca, 0x5f, 0x4c, 0x1a, - 0x7c, - }; +#if CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE + size_t cdLen = 0; + + if (Internal::ZephyrConfig::ReadConfigValueBin(Internal::ZephyrConfig::kConfigKey_CertificationDeclaration, + reinterpret_cast(outBuffer.data()), outBuffer.size(), + cdLen) == CHIP_NO_ERROR) + { + outBuffer.reduce_size(cdLen); + return CHIP_NO_ERROR; + } +#endif + constexpr uint8_t kCdForAllExamples[] = CHIP_DEVICE_CONFIG_CERTIFICATION_DECLARATION; return CopySpanToMutableSpan(ByteSpan{ kCdForAllExamples }, outBuffer); } @@ -350,6 +320,19 @@ CHIP_ERROR FactoryDataProvider::GetRotatingDeviceIdUniqueId(Mu return CHIP_NO_ERROR; } +template +CHIP_ERROR FactoryDataProvider::GetEnableKey(MutableByteSpan & enableKey) +{ + ReturnErrorCodeIf(!mFactoryData.enable_key.data, CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND); + ReturnErrorCodeIf(enableKey.size() < mFactoryData.enable_key.len, CHIP_ERROR_BUFFER_TOO_SMALL); + + memcpy(enableKey.data(), mFactoryData.enable_key.data, mFactoryData.enable_key.len); + + enableKey.reduce_size(mFactoryData.enable_key.len); + + return CHIP_NO_ERROR; +} + // Fully instantiate the template class in whatever compilation unit includes this file. template class FactoryDataProvider; template class FactoryDataProvider; diff --git a/src/platform/nrfconnect/FactoryDataProvider.h b/src/platform/nrfconnect/FactoryDataProvider.h index 202058aa99e7e3..0818c3f506694d 100644 --- a/src/platform/nrfconnect/FactoryDataProvider.h +++ b/src/platform/nrfconnect/FactoryDataProvider.h @@ -105,6 +105,9 @@ class FactoryDataProvider : public chip::Credentials::DeviceAttestationCredentia CHIP_ERROR GetHardwareVersionString(char * buf, size_t bufSize) override; CHIP_ERROR GetRotatingDeviceIdUniqueId(MutableByteSpan & uniqueIdSpan) override; + // ===== Members functions that are platform-specific + CHIP_ERROR GetEnableKey(MutableByteSpan & enableKey); + private: static constexpr uint16_t kFactoryDataPartitionSize = PM_FACTORY_DATA_SIZE; static constexpr uint32_t kFactoryDataPartitionAddress = PM_FACTORY_DATA_ADDRESS; diff --git a/src/platform/nrfconnect/OTAImageProcessorImpl.cpp b/src/platform/nrfconnect/OTAImageProcessorImpl.cpp index 016395aa8ec63e..b558906258e994 100644 --- a/src/platform/nrfconnect/OTAImageProcessorImpl.cpp +++ b/src/platform/nrfconnect/OTAImageProcessorImpl.cpp @@ -23,6 +23,12 @@ #include #include +#if CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE +#include +#include +#include +#endif + #include #include #include @@ -31,6 +37,14 @@ #include #include +#if CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE +// Cd globals are needed to be accessed from dfu image writer lambdas +namespace { +uint8_t sCdBuf[chip::Credentials::kMaxCMSSignedCDMessage] = { 0 }; +size_t sCdSavedBytes = 0; +} // namespace +#endif + namespace chip { namespace DeviceLayer { @@ -61,6 +75,22 @@ CHIP_ERROR OTAImageProcessorImpl::PrepareDownloadImpl() ReturnErrorOnFailure(System::MapErrorZephyr(dfu_multi_image_register_writer(&writer))); }; +#if CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE + dfu_image_writer cdWriter; + cdWriter.image_id = CONFIG_CHIP_CERTIFiCATION_DECLARATION_OTA_IMAGE_ID; + cdWriter.open = [](int id, size_t size) { return size <= sizeof(sCdBuf) ? 0 : -EFBIG; }; + cdWriter.write = [](const uint8_t * chunk, size_t chunk_size) { + memcpy(&sCdBuf[sCdSavedBytes], chunk, chunk_size); + sCdSavedBytes += chunk_size; + return 0; + }; + cdWriter.close = [](bool success) { + return settings_save_one(Internal::ZephyrConfig::kConfigKey_CertificationDeclaration, sCdBuf, sCdSavedBytes); + }; + + ReturnErrorOnFailure(System::MapErrorZephyr(dfu_multi_image_register_writer(&cdWriter))); +#endif + return CHIP_NO_ERROR; } diff --git a/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp b/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp index 44a9c0c7890d46..ce2c4a235cdaa8 100644 --- a/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp +++ b/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp @@ -308,23 +308,6 @@ BLEManagerImpl::CHIPoBLEConState * BLEManagerImpl::GetConnectionState(uint8_t co return NULL; } -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - - if (val != mServiceMode) - { - mServiceMode = val; - PlatformMgr().ScheduleWork(DriveBLEState, 0); - } - -exit: - return err; -} - CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/platform/nxp/k32w/k32w0/BLEManagerImpl.h b/src/platform/nxp/k32w/k32w0/BLEManagerImpl.h index 1ff7ba1910f452..b3b473337bf253 100644 --- a/src/platform/nxp/k32w/k32w0/BLEManagerImpl.h +++ b/src/platform/nxp/k32w/k32w0/BLEManagerImpl.h @@ -65,8 +65,6 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla CHIP_ERROR _Init(void); void _Shutdown() {} - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(void); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsAdvertising(void); @@ -282,11 +280,6 @@ inline BleLayer * BLEManagerImpl::_GetBleLayer() return this; } -inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void) -{ - return mServiceMode; -} - } // namespace Internal } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/qpg/BLEManagerImpl.cpp b/src/platform/qpg/BLEManagerImpl.cpp index bbb7c8c4c96bb9..8f3aa45fd0a867 100644 --- a/src/platform/qpg/BLEManagerImpl.cpp +++ b/src/platform/qpg/BLEManagerImpl.cpp @@ -124,23 +124,6 @@ CHIP_ERROR BLEManagerImpl::_Init() return err; } -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - - if (val != mServiceMode) - { - mServiceMode = val; - PlatformMgr().ScheduleWork(DriveBLEState, 0); - } - -exit: - return err; -} - CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/platform/qpg/BLEManagerImpl.h b/src/platform/qpg/BLEManagerImpl.h index 5c5b571e1485f0..8038db590a5a41 100644 --- a/src/platform/qpg/BLEManagerImpl.h +++ b/src/platform/qpg/BLEManagerImpl.h @@ -49,8 +49,6 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla CHIP_ERROR _Init(void); void _Shutdown() {} - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(void); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsAdvertising(void); @@ -170,11 +168,6 @@ inline BleLayer * BLEManagerImpl::_GetBleLayer() return this; } -inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void) -{ - return mServiceMode; -} - inline bool BLEManagerImpl::_IsAdvertisingEnabled(void) { return mFlags.Has(Flags::kAdvertisingEnabled); diff --git a/src/platform/telink/BLEManagerImpl.cpp b/src/platform/telink/BLEManagerImpl.cpp index 68464a1fec8628..eaacb0250338a2 100644 --- a/src/platform/telink/BLEManagerImpl.cpp +++ b/src/platform/telink/BLEManagerImpl.cpp @@ -467,11 +467,6 @@ void BLEManagerImpl::_InitGatt(void) bls_att_setAttributeTable((u8 *) gattTable); } -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - return CHIP_NO_ERROR; -} - CHIP_ERROR BLEManagerImpl::ConfigureAdvertisingData(void) { ble_sts_t status = BLE_SUCCESS; diff --git a/src/platform/telink/BLEManagerImpl.h b/src/platform/telink/BLEManagerImpl.h index e3a0f458f59f17..86aae895197582 100644 --- a/src/platform/telink/BLEManagerImpl.h +++ b/src/platform/telink/BLEManagerImpl.h @@ -45,8 +45,6 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla CHIP_ERROR _Init(void); void _Shutdown(); - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(void); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsAdvertising(void); @@ -196,11 +194,6 @@ inline BleLayer * BLEManagerImpl::_GetBleLayer() return this; } -inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void) -{ - return mServiceMode; -} - inline bool BLEManagerImpl::_IsAdvertisingEnabled(void) { return mFlags.Has(Flags::kAdvertisingEnabled); diff --git a/src/platform/tests/TestKeyValueStoreMgr.cpp b/src/platform/tests/TestKeyValueStoreMgr.cpp index acb3e5533e8a3a..ec2c35723a043c 100644 --- a/src/platform/tests/TestKeyValueStoreMgr.cpp +++ b/src/platform/tests/TestKeyValueStoreMgr.cpp @@ -287,7 +287,7 @@ static void TestKeyValueStoreMgr_MultiRead(nlTestSuite * inSuite, void * inConte #ifdef __ZEPHYR__ static void TestKeyValueStoreMgr_DoFactoryReset(nlTestSuite * inSuite, void * inContext) { - constexpr const char * kStrKey = "some_string_key"; + constexpr const char * kStrKey = "string_with_weird_chars\\=_key"; constexpr const char * kUintKey = "some_uint_key"; NL_TEST_ASSERT(inSuite, KeyValueStoreMgr().Put(kStrKey, "some_string") == CHIP_NO_ERROR); diff --git a/src/platform/webos/BLEManagerImpl.cpp b/src/platform/webos/BLEManagerImpl.cpp index e98e38ba3ab35b..12376d82671c12 100644 --- a/src/platform/webos/BLEManagerImpl.cpp +++ b/src/platform/webos/BLEManagerImpl.cpp @@ -134,23 +134,6 @@ void BLEManagerImpl::_Shutdown() mDeviceScanner.reset(); } -CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(mServiceMode == ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - - if (val != mServiceMode) - { - mServiceMode = val; - PlatformMgr().ScheduleWork(DriveBLEState, 0); - } - -exit: - return err; -} - CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/platform/webos/BLEManagerImpl.h b/src/platform/webos/BLEManagerImpl.h index e4f20dd431cacb..bc8ad739d82bf0 100644 --- a/src/platform/webos/BLEManagerImpl.h +++ b/src/platform/webos/BLEManagerImpl.h @@ -96,8 +96,6 @@ class BLEManagerImpl final : public BLEManager, CHIP_ERROR _Init(); void _Shutdown(); - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(); - CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsAdvertising(); @@ -250,11 +248,6 @@ inline Ble::BleLayer * BLEManagerImpl::_GetBleLayer() return this; } -inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode() -{ - return mServiceMode; -} - inline bool BLEManagerImpl::_IsAdvertisingEnabled() { return mFlags.Has(Flags::kAdvertisingEnabled); diff --git a/src/protocols/secure_channel/PASESession.h b/src/protocols/secure_channel/PASESession.h index 8669427ff2ce94..cb44865075935d 100644 --- a/src/protocols/secure_channel/PASESession.h +++ b/src/protocols/secure_channel/PASESession.h @@ -49,9 +49,6 @@ extern const char * kSpake2pR2ISessionInfo; constexpr uint16_t kPBKDFParamRandomNumberSize = 32; -constexpr uint32_t kSetupPINCodeMaximumValue = 99999998; -constexpr uint32_t kSetupPINCodeUndefinedValue = 0; - using namespace Crypto; struct PASESessionSerialized; diff --git a/src/setup_payload/SetupPayload.cpp b/src/setup_payload/SetupPayload.cpp index a53cdf9e4c224d..12260a0087cd29 100644 --- a/src/setup_payload/SetupPayload.cpp +++ b/src/setup_payload/SetupPayload.cpp @@ -111,6 +111,20 @@ bool PayloadContents::isValidManualCode() const return CheckPayloadCommonConstraints(); } +bool PayloadContents::IsValidSetupPIN(uint32_t setupPIN) +{ + // SHALL be restricted to the values 0x0000001 to 0x5F5E0FE (00000001 to 99999998 in decimal), excluding the invalid Passcode + // values. + if (setupPIN == kSetupPINCodeUndefinedValue || setupPIN > kSetupPINCodeMaximumValue || setupPIN == 11111111 || + setupPIN == 22222222 || setupPIN == 33333333 || setupPIN == 44444444 || setupPIN == 55555555 || setupPIN == 66666666 || + setupPIN == 77777777 || setupPIN == 88888888 || setupPIN == 12345678 || setupPIN == 87654321) + { + return false; + } + + return true; +} + bool PayloadContents::CheckPayloadCommonConstraints() const { // A version not equal to 0 would be invalid for v1 and would indicate new format (e.g. version 2) @@ -119,11 +133,7 @@ bool PayloadContents::CheckPayloadCommonConstraints() const return false; } - // SHALL be restricted to the values 0x0000001 to 0x5F5E0FE (00000001 to 99999998 in decimal), excluding the invalid Passcode - // values. - if (setUpPINCode < 0x0000001 || setUpPINCode > 0x5F5E0FE || setUpPINCode == 11111111 || setUpPINCode == 22222222 || - setUpPINCode == 33333333 || setUpPINCode == 44444444 || setUpPINCode == 55555555 || setUpPINCode == 66666666 || - setUpPINCode == 77777777 || setUpPINCode == 88888888 || setUpPINCode == 12345678 || setUpPINCode == 87654321) + if (!IsValidSetupPIN(setUpPINCode)) { return false; } diff --git a/src/setup_payload/SetupPayload.h b/src/setup_payload/SetupPayload.h index 868c71067f4cf6..fa9e6ded9c5662 100644 --- a/src/setup_payload/SetupPayload.h +++ b/src/setup_payload/SetupPayload.h @@ -72,6 +72,9 @@ constexpr uint8_t kBPKFSaltTag = 0x02; constexpr uint8_t kNumberOFDevicesTag = 0x03; constexpr uint8_t kCommissioningTimeoutTag = 0x04; +constexpr uint32_t kSetupPINCodeMaximumValue = 99999998; +constexpr uint32_t kSetupPINCodeUndefinedValue = 0; + // clang-format off const int kTotalPayloadDataSizeInBits = kVersionFieldLengthInBits + @@ -124,6 +127,8 @@ struct PayloadContents bool isShortDiscriminator = false; bool operator==(PayloadContents & input) const; + static bool IsValidSetupPIN(uint32_t setupPIN); + private: bool CheckPayloadCommonConstraints() const; }; diff --git a/src/system/SystemLayerImplSelect.cpp b/src/system/SystemLayerImplSelect.cpp index bd2e8060858d2b..a7fc85748daf82 100644 --- a/src/system/SystemLayerImplSelect.cpp +++ b/src/system/SystemLayerImplSelect.cpp @@ -182,23 +182,22 @@ CHIP_ERROR LayerImplSelect::ScheduleWork(TimerCompleteCallback onComplete, void { VerifyOrReturnError(mLayerState.IsInitialized(), CHIP_ERROR_INCORRECT_STATE); - CancelTimer(onComplete, appState); - - TimerList::Node * timer = mTimerPool.Create(*this, SystemClock().GetMonotonicTimestamp(), onComplete, appState); - VerifyOrReturnError(timer != nullptr, CHIP_ERROR_NO_MEMORY); - #if CHIP_SYSTEM_CONFIG_USE_DISPATCH dispatch_queue_t dispatchQueue = GetDispatchQueue(); if (dispatchQueue) { - (void) mTimerList.Add(timer); dispatch_async(dispatchQueue, ^{ - this->HandleTimerComplete(timer); + onComplete(this, appState); }); return CHIP_NO_ERROR; } #endif // CHIP_SYSTEM_CONFIG_USE_DISPATCH + CancelTimer(onComplete, appState); + + TimerList::Node * timer = mTimerPool.Create(*this, SystemClock().GetMonotonicTimestamp(), onComplete, appState); + VerifyOrReturnError(timer != nullptr, CHIP_ERROR_NO_MEMORY); + if (mTimerList.Add(timer) == timer) { // The new timer is the earliest, so the time until the next event has probably changed. diff --git a/src/test_driver/linux-cirque/CommissioningFailureOnReportTest.py b/src/test_driver/linux-cirque/CommissioningFailureOnReportTest.py index da558623c4c469..bca82e7795a8e1 100755 --- a/src/test_driver/linux-cirque/CommissioningFailureOnReportTest.py +++ b/src/test_driver/linux-cirque/CommissioningFailureOnReportTest.py @@ -91,7 +91,11 @@ def run_controller_test(self): req_device_id = req_ids[0] self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( - CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip-0.0-cp37-abi3-linux_x86_64.whl"))) + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) + self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) + self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command = "gdb -return-child-result -q -ex run -ex bt --args python3 {} -t 150 -a {} --paa-trust-store-path {} --fail-on-report".format( os.path.join( diff --git a/src/test_driver/linux-cirque/CommissioningFailureTest.py b/src/test_driver/linux-cirque/CommissioningFailureTest.py index ecd061030c2cb0..b625c8eb268ed3 100755 --- a/src/test_driver/linux-cirque/CommissioningFailureTest.py +++ b/src/test_driver/linux-cirque/CommissioningFailureTest.py @@ -91,7 +91,11 @@ def run_controller_test(self): req_device_id = req_ids[0] self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( - CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip-0.0-cp37-abi3-linux_x86_64.whl"))) + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) + self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) + self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command = "gdb -return-child-result -q -ex run -ex bt --args python3 {} -t 150 -a {} --paa-trust-store-path {}".format( os.path.join( diff --git a/src/test_driver/linux-cirque/CommissioningTest.py b/src/test_driver/linux-cirque/CommissioningTest.py index 253383bab2b30e..09a1f017300a02 100755 --- a/src/test_driver/linux-cirque/CommissioningTest.py +++ b/src/test_driver/linux-cirque/CommissioningTest.py @@ -107,7 +107,11 @@ def run_controller_test(self): req_device_id = req_ids[0] self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( - CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip-0.0-cp37-abi3-linux_x86_64.whl"))) + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) + self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) + self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command = "gdb -return-child-result -q -ex run -ex bt --args python3 {} -t 150 -a {} --paa-trust-store-path {} --discriminator {} --nodeid {}".format( os.path.join( diff --git a/src/test_driver/linux-cirque/FailsafeTest.py b/src/test_driver/linux-cirque/FailsafeTest.py index 7a6fd503b7ad8c..adde541957c9ca 100755 --- a/src/test_driver/linux-cirque/FailsafeTest.py +++ b/src/test_driver/linux-cirque/FailsafeTest.py @@ -91,7 +91,11 @@ def run_controller_test(self): req_device_id = req_ids[0] self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( - CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip-0.0-cp37-abi3-linux_x86_64.whl"))) + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) + self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) + self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command = "gdb -return-child-result -q -ex run -ex bt --args python3 {} -t 150 -a {} --paa-trust-store-path {}".format( os.path.join( diff --git a/src/test_driver/linux-cirque/MobileDeviceTest.py b/src/test_driver/linux-cirque/MobileDeviceTest.py index c3d443e55877b5..bb86da6dbf4631 100755 --- a/src/test_driver/linux-cirque/MobileDeviceTest.py +++ b/src/test_driver/linux-cirque/MobileDeviceTest.py @@ -91,7 +91,11 @@ def run_controller_test(self): req_device_id = req_ids[0] self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( - CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip-0.0-cp37-abi3-linux_x86_64.whl"))) + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) + self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) + self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command = "gdb -return-child-result -q -ex run -ex bt --args python3 {} -t 240 -a {} --paa-trust-store-path {}".format( os.path.join( diff --git a/src/test_driver/linux-cirque/SplitCommissioningTest.py b/src/test_driver/linux-cirque/SplitCommissioningTest.py index 69235b86339d07..24d00e372ec1da 100755 --- a/src/test_driver/linux-cirque/SplitCommissioningTest.py +++ b/src/test_driver/linux-cirque/SplitCommissioningTest.py @@ -99,7 +99,11 @@ def run_controller_test(self): req_device_id = req_ids[0] self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( - CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip-0.0-cp37-abi3-linux_x86_64.whl"))) + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_clusters-0.0-py3-none-any.whl"))) + self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl"))) + self.execute_device_cmd(req_device_id, "pip3 install {}".format(os.path.join( + CHIP_REPO, "out/debug/linux_x64_gcc/controller/python/chip_repl-0.0-py3-none-any.whl"))) command = "gdb -return-child-result -q -ex run -ex bt --args python3 {} -t 150 --address1 {} --address2 {} --paa-trust-store-path {}".format( os.path.join( diff --git a/src/tools/spake2p/Cmd_GenVerifier.cpp b/src/tools/spake2p/Cmd_GenVerifier.cpp index 92bfe3808cf88e..e39a9939b8dd48 100644 --- a/src/tools/spake2p/Cmd_GenVerifier.cpp +++ b/src/tools/spake2p/Cmd_GenVerifier.cpp @@ -37,6 +37,7 @@ #include #include #include +#include namespace { diff --git a/third_party/p6/BUILD.gn b/third_party/p6/BUILD.gn index dd79b07d9af0cc..cc892053658136 100644 --- a/third_party/p6/BUILD.gn +++ b/third_party/p6/BUILD.gn @@ -26,23 +26,26 @@ assert(p6_target_project != "", "p6_target_project must be specified") config("p6_sdk_config") { # Pull out includes from generated json # Treat these includes as system includes, so warnings in them are not fatal. - _include_dirs = [] - foreach(inc, mtb_json.includes) { + _system_include_dirs = [] + foreach(include_dir, mtb_json.includes) { # Strip off leading -I part - _include_dirs += [ "/" + rebase_path(string_replace(inc, "-I", "", 1), - "/", - "${p6_sdk_build_root}/p6_sdk/") ] - } + include_dir = string_replace(include_dir, "-I", "", 1) - # Also add project include path (passed in from project build) - proj_path = get_label_info(p6_target_project, "dir") - _include_dirs += [ "/" + rebase_path("${proj_path}/include", "/", ".") ] + # Path is relative to SDK + include_dir = "${p6_sdk_root}/${include_dir}" + + _system_include_dirs += [ include_dir ] + } cflags = [] - foreach(include_dir, _include_dirs) { - cflags += [ "-isystem" + include_dir ] + foreach(include_dir, _system_include_dirs) { + cflags += [ "-isystem" + rebase_path(include_dir, root_build_dir) ] } + # Also add project include path (passed in from project build) + proj_path = get_label_info(p6_target_project, "dir") + include_dirs = [ "${proj_path}/include" ] + # Pull out defines from generated json defines = [] foreach(def, mtb_json.defines) { @@ -53,7 +56,10 @@ config("p6_sdk_config") { # Pull out static libs (.a files) from generated json libs = [] foreach(lib, mtb_json.libs) { - libs += [ "/" + rebase_path(lib, "/", "${p6_sdk_build_root}/p6_sdk/") ] + # Path is relative to SDK + lib = "${p6_sdk_root}/${lib}" + + libs += [ lib ] } cflags_c = mtb_json.cflags @@ -65,10 +71,14 @@ config("p6_sdk_config") { # OTA app provides it's own linker script if (!chip_enable_ota_requestor) { linker_script_flags = filter_include(mtb_json.ldflags, [ "-T*" ]) - foreach(flag, linker_script_flags) { - ldflags += [ "-T/" + rebase_path(string_replace(flag, "-T", "", 1), - "/", - "${p6_sdk_build_root}/p6_sdk/") ] + foreach(linker_script, linker_script_flags) { + # Strip off leading -T part + linker_script = string_replace(linker_script, "-T", "", 1) + + # Path is relative to SDK + linker_script = "${p6_sdk_root}/${linker_script}" + + ldflags += [ "-T" + rebase_path(linker_script, root_build_dir) ] } } diff --git a/third_party/p6/p6_sdk.gni b/third_party/p6/p6_sdk.gni index bb66435dd0e454..fb86bb34937030 100644 --- a/third_party/p6/p6_sdk.gni +++ b/third_party/p6/p6_sdk.gni @@ -27,9 +27,8 @@ if (is_debug) { debug_str = "Release" } -mtb_json = read_file( - "$p6_sdk_build_root/p6_sdk/build/${p6_board}/$debug_str/GCC_ARM.json", - "json") +mtb_json = read_file("${p6_sdk_root}/build/${p6_board}/$debug_str/GCC_ARM.json", + "json") # Defines an p6 SDK build target. # @@ -85,23 +84,17 @@ template("p6_sdk_sources") { # Pull out c sources from generated json foreach(src, mtb_json_local.c_source) { - sources += [ rebase_path(src, - "${p6_project_dir}", - "${p6_sdk_build_root}/p6_sdk/") ] + sources += [ "${p6_sdk_root}/${src}" ] } # Pull out cpp sources from generated json foreach(src, mtb_json_local.cxx_source) { - sources += [ rebase_path(src, - "${p6_project_dir}", - "${p6_sdk_build_root}/p6_sdk/") ] + sources += [ "${p6_sdk_root}/${src}" ] } # Pull out .S files from generated json foreach(asm, mtb_json_local.asm_source) { - sources += [ rebase_path(asm, - "${p6_project_dir}", - "${p6_sdk_build_root}/p6_sdk/") ] + sources += [ "${p6_sdk_root}/${asm}" ] } public_deps = [] diff --git a/third_party/pigweed/repo b/third_party/pigweed/repo index 81460c6abb2e06..438c2a742cff99 160000 --- a/third_party/pigweed/repo +++ b/third_party/pigweed/repo @@ -1 +1 @@ -Subproject commit 81460c6abb2e068f27d44eca58640364793b133f +Subproject commit 438c2a742cff99b8f7723cabee5d7d9b31902869 diff --git a/third_party/tizen/tizen_sdk.gni b/third_party/tizen/tizen_sdk.gni index 05484aed50be3c..0f89226e7bbc40 100644 --- a/third_party/tizen/tizen_sdk.gni +++ b/third_party/tizen/tizen_sdk.gni @@ -18,7 +18,7 @@ import("//build_overrides/tizen.gni") import("${build_root}/config/tizen/config.gni") -tizen_manifest_parser = rebase_path("tizen_manifest_parser.py") +tizen_manifest_parser = get_path_info("tizen_manifest_parser.py", "abspath") template("tizen_sdk") { forward_variables_from(invoker, @@ -74,7 +74,9 @@ template("tizen_sdk_package") { "should be used for signing TPK package.") # Extract data from Tizen XML manifest. - manifest = exec_script(tizen_manifest_parser, [ invoker.manifest ], "json") + manifest = exec_script(tizen_manifest_parser, + [ rebase_path(invoker.manifest, root_build_dir) ], + "json") manifest_package = manifest["package"] manifest_apps = manifest["apps"] diff --git a/third_party/zap/repo b/third_party/zap/repo index 9a4e455c3a4956..a62906eac316be 160000 --- a/third_party/zap/repo +++ b/third_party/zap/repo @@ -1 +1 @@ -Subproject commit 9a4e455c3a4956842d11971148b2d5ee0ccead53 +Subproject commit a62906eac316be552be78fbb669c5c853fd3a955 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 e9b44f139a1fe3..02c83fbab5bcd1 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 @@ -963,11 +963,9 @@ #define ZCL_BALLAST_STATUS_ATTRIBUTE_ID (0x0002) #define ZCL_MIN_LEVEL_ATTRIBUTE_ID (0x0010) #define ZCL_MAX_LEVEL_ATTRIBUTE_ID (0x0011) -#define ZCL_POWER_ON_LEVEL_ATTRIBUTE_ID (0x0012) -#define ZCL_POWER_ON_FADE_TIME_ATTRIBUTE_ID (0x0013) #define ZCL_INTRINSIC_BALLAST_FACTOR_ATTRIBUTE_ID (0x0014) #define ZCL_BALLAST_FACTOR_ADJUSTMENT_ATTRIBUTE_ID (0x0015) -#define ZCL_LAMP_QUALITY_ATTRIBUTE_ID (0x0020) +#define ZCL_LAMP_QUANTITY_ATTRIBUTE_ID (0x0020) #define ZCL_LAMP_TYPE_ATTRIBUTE_ID (0x0030) #define ZCL_LAMP_MANUFACTURER_ATTRIBUTE_ID (0x0031) #define ZCL_LAMP_RATED_HOURS_ATTRIBUTE_ID (0x0032) @@ -1450,12 +1448,6 @@ // Server attributes -// Attribute ids for cluster: Messaging - -// Client attributes - -// Server attributes - // Attribute ids for cluster: Appliance Identification // Client attributes 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 d10c866bd50e60..1d1e86768a01b9 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 @@ -23058,26 +23058,29 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) } // namespace MaxLevel -namespace PowerOnLevel { +namespace IntrinsicBalanceFactor { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +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::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -23087,59 +23090,50 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace PowerOnLevel - -namespace PowerOnFadeTime { - -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus SetNull(chip::EndpointId endpoint) { - 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 (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (value.IsNull()) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + return SetNull(endpoint); } - 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); + + return Set(endpoint, value.Value()); } -} // namespace PowerOnFadeTime +} // namespace IntrinsicBalanceFactor -namespace IntrinsicBallastFactor { +namespace BallastFactorAdjustment { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +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::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -23149,40 +23143,28 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace IntrinsicBallastFactor - -namespace BallastFactorAdjustment { - -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus SetNull(chip::EndpointId endpoint) { 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 (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (value.IsNull()) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + return SetNull(endpoint); } - 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); + + return Set(endpoint, value.Value()); } } // namespace BallastFactorAdjustment -namespace LampQuality { +namespace LampQuantity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { @@ -23211,7 +23193,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace LampQuality +} // namespace LampQuantity namespace LampType { @@ -23277,24 +23259,27 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) namespace LampRatedHours { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +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::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { using Traits = NumericAttributeTraits>; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -23304,28 +23289,50 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_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::BallastConfiguration::Id, Id, writable, ZCL_INT24U_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 LampRatedHours namespace LampBurnHours { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +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::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { using Traits = NumericAttributeTraits>; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -23335,6 +23342,25 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_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::BallastConfiguration::Id, Id, writable, ZCL_INT24U_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 LampBurnHours namespace LampAlarmMode { @@ -23370,24 +23396,27 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) namespace LampBurnHoursTripPoint { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +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::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { using Traits = NumericAttributeTraits>; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } @@ -23397,6 +23426,25 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_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::BallastConfiguration::Id, Id, writable, ZCL_INT24U_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 LampBurnHoursTripPoint namespace FeatureMap { @@ -33030,74 +33078,6 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace AccountLogin -namespace Messaging { -namespace Attributes { - -namespace FeatureMap { - -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) -{ - 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 (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint32_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::Messaging::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace FeatureMap - -namespace ClusterRevision { - -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::Messaging::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::Messaging::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace Messaging - namespace ApplianceIdentification { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 0263f3fe92db8a..e6930f6e15d0dc 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 @@ -3911,30 +3911,24 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace MaxLevel -namespace PowerOnLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); -} // namespace PowerOnLevel - -namespace PowerOnFadeTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); -} // namespace PowerOnFadeTime - -namespace IntrinsicBallastFactor { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +namespace IntrinsicBalanceFactor { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); -} // namespace IntrinsicBallastFactor +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +} // namespace IntrinsicBalanceFactor namespace BallastFactorAdjustment { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +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 BallastFactorAdjustment -namespace LampQuality { +namespace LampQuantity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); -} // namespace LampQuality +} // namespace LampQuantity namespace LampType { EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string @@ -3947,13 +3941,17 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace LampManufacturer namespace LampRatedHours { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int24u +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 chip::app::DataModel::Nullable & value); } // namespace LampRatedHours namespace LampBurnHours { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int24u +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 chip::app::DataModel::Nullable & value); } // namespace LampBurnHours namespace LampAlarmMode { @@ -3962,8 +3960,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace LampAlarmMode namespace LampBurnHoursTripPoint { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int24u +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 chip::app::DataModel::Nullable & value); } // namespace LampBurnHoursTripPoint namespace FeatureMap { @@ -5669,22 +5669,6 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace AccountLogin -namespace Messaging { -namespace Attributes { - -namespace FeatureMap { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); -} // namespace FeatureMap - -namespace ClusterRevision { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace Messaging - namespace ApplianceIdentification { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 393a046cb1809a..0283da63b4d167 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -901,14 +901,6 @@ void emberAfApplicationBasicClusterInitCallback(chip::EndpointId endpoint); */ void emberAfAccountLoginClusterInitCallback(chip::EndpointId endpoint); -/** @brief Messaging Cluster Init - * - * Cluster Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfMessagingClusterInitCallback(chip::EndpointId endpoint); - /** @brief Appliance Identification Cluster Init * * Cluster Init @@ -11303,102 +11295,6 @@ void emberAfAccountLoginClusterServerTickCallback(chip::EndpointId endpoint); */ void emberAfAccountLoginClusterClientTickCallback(chip::EndpointId endpoint); -// -// Messaging Cluster -// - -/** @brief Messaging Cluster Server Init - * - * Server Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfMessagingClusterServerInitCallback(chip::EndpointId endpoint); - -/** @brief Messaging Cluster Client Init - * - * Client Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfMessagingClusterClientInitCallback(chip::EndpointId endpoint); - -/** @brief Messaging Cluster Server Attribute Changed - * - * Server Attribute Changed - * - * @param attributePath Concrete attribute path that changed - */ -void MatterMessagingClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); - -/** @brief Messaging Cluster Server Message Sent - * - * Server Message Sent - * - * @param destination The destination to which the message was sent - * @param apsFrame The APS frame for the message - * @param msgLen The length of the message - * @param message The message that was sent - * @param status The status of the sent message - */ -void emberAfMessagingClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); - -/** @brief Messaging Cluster Client Message Sent - * - * Client Message Sent - * - * @param destination The destination to which the message was sent - * @param apsFrame The APS frame for the message - * @param msgLen The length of the message - * @param message The message that was sent - * @param status The status of the sent message - */ -void emberAfMessagingClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); - -/** @brief Messaging Cluster Server Pre Attribute Changed - * - * Server Pre Attribute Changed - * - * @param attributePath Concrete attribute path to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -chip::Protocols::InteractionModel::Status -MatterMessagingClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, - EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); - -/** @brief Messaging Cluster Client Pre Attribute Changed - * - * Client Pre Attribute Changed - * - * @param attributePath Concrete attribute path to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -chip::Protocols::InteractionModel::Status -MatterMessagingClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, - EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); - -/** @brief Messaging Cluster Server Tick - * - * Server Tick - * - * @param endpoint Endpoint that is being served - */ -void emberAfMessagingClusterServerTickCallback(chip::EndpointId endpoint); - -/** @brief Messaging Cluster Client Tick - * - * Client Tick - * - * @param endpoint Endpoint that is being served - */ -void emberAfMessagingClusterClientTickCallback(chip::EndpointId endpoint); - // // Appliance Identification Cluster // @@ -13425,48 +13321,6 @@ bool emberAfAccountLoginClusterLoginCallback(chip::app::CommandHandler * command bool emberAfAccountLoginClusterLogoutCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::AccountLogin::Commands::Logout::DecodableType & commandData); -/** - * @brief Messaging Cluster DisplayMessage Command callback (from server) - */ -bool emberAfMessagingClusterDisplayMessageCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint32_t messageId, uint8_t messageControl, uint32_t startTime, - uint16_t durationInMinutes, chip::CharSpan message, - uint8_t optionalExtendedMessageControl); -/** - * @brief Messaging Cluster GetLastMessage Command callback (from client) - */ -bool emberAfMessagingClusterGetLastMessageCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Messaging::Commands::GetLastMessage::DecodableType & commandData); -/** - * @brief Messaging Cluster CancelMessage Command callback (from server) - */ -bool emberAfMessagingClusterCancelMessageCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint32_t messageId, uint8_t messageControl); -/** - * @brief Messaging Cluster MessageConfirmation Command callback (from client) - */ -bool emberAfMessagingClusterMessageConfirmationCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Messaging::Commands::MessageConfirmation::DecodableType & commandData); -/** - * @brief Messaging Cluster DisplayProtectedMessage Command callback (from server) - */ -bool emberAfMessagingClusterDisplayProtectedMessageCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint32_t messageId, uint8_t messageControl, uint32_t startTime, - uint16_t durationInMinutes, chip::CharSpan message, - uint8_t optionalExtendedMessageControl); -/** - * @brief Messaging Cluster GetMessageCancellation Command callback (from client) - */ -bool emberAfMessagingClusterGetMessageCancellationCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Messaging::Commands::GetMessageCancellation::DecodableType & commandData); -/** - * @brief Messaging Cluster CancelAllMessages Command callback (from server) - */ -bool emberAfMessagingClusterCancelAllMessagesCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint32_t implementationDateTime); /** * @brief Appliance Events and Alert Cluster GetAlerts 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 8d44a1d1e50d2c..9c66e59889ba56 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 @@ -233,8 +233,6 @@ void __attribute__((weak)) MatterApplicationBasicPluginClientInitCallback() {} void MatterApplicationBasicPluginServerInitCallback(); void __attribute__((weak)) MatterAccountLoginPluginClientInitCallback() {} void MatterAccountLoginPluginServerInitCallback(); -void __attribute__((weak)) MatterMessagingPluginClientInitCallback() {} -void MatterMessagingPluginServerInitCallback(); void __attribute__((weak)) MatterApplianceIdentificationPluginClientInitCallback() {} void MatterApplianceIdentificationPluginServerInitCallback(); void __attribute__((weak)) MatterMeterIdentificationPluginClientInitCallback() {} diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index bf03770c1249ef..ebf0648f0fba01 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -2240,149 +2240,6 @@ enum class ApplicationStatusEnum : uint8_t namespace AccountLogin { } // namespace AccountLogin -namespace Messaging { - -// Enum for EventId -enum class EventId : uint8_t -{ - kMeterCoverRemoved = 0x00, - kMeterCoverClosed = 0x01, - kStrongMagneticField = 0x02, - kNoStrongMagneticField = 0x03, - kBatteryFailure = 0x04, - kLowBattery = 0x05, - kProgramMemoryError = 0x06, - kRamError = 0x07, - kNvMemoryError = 0x08, - kMeasurementSystemError = 0x09, - kWatchdogError = 0x0A, - kSupplyDisconnectFailure = 0x0B, - kSupplyConnectFailure = 0x0C, - kMeasurmentSoftwareChanged = 0x0D, - kDstEnabled = 0x0E, - kDstDisabled = 0x0F, - kClockAdjBackward = 0x10, - kClockAdjForward = 0x11, - kClockInvalid = 0x12, - kCommsErrorHan = 0x13, - kCommsOkHan = 0x14, - kFraudAttempt = 0x15, - kPowerLoss = 0x16, - kIncorrectProtocol = 0x17, - kUnusualHanTraffic = 0x18, - kUnexpectedClockChange = 0x19, - kCommsUsingUnauthenticatedComponent = 0x1A, - kErrorRegClear = 0x1B, - kAlarmRegClear = 0x1C, - kUnexpectedHwReset = 0x1D, - kUnexpectedProgramExecution = 0x1E, - kEventLogCleared = 0x1F, - kManualDisconnect = 0x20, - kManualConnect = 0x21, - kRemoteDisconnection = 0x22, - kLocalDisconnection = 0x23, - kLimitThresholdExceeded = 0x24, - kLimitThresholdOk = 0x25, - kLimitThresholdChanged = 0x26, - kMaximumDemandExceeded = 0x27, - kProfileCleared = 0x28, - kFirmwareReadyForActivation = 0x29, - kFirmwareActivated = 0x2A, - kPatchFailure = 0x2B, - kTouTariffActivation = 0x2C, - k8x8Tariffactivated = 0x2D, - kSingleTariffRateActivated = 0x2E, - kAsynchronousBillingOccurred = 0x2F, - kSynchronousBillingOccurred = 0x30, - kIncorrectPolarity = 0x80, - kCurrentNoVoltage = 0x81, - kUnderVoltage = 0x82, - kOverVoltage = 0x83, - kNormalVoltage = 0x84, - kPfBelowThreshold = 0x85, - kPfAboveThreshold = 0x86, - kTerminalCoverRemoved = 0x87, - kTerminalCoverClosed = 0x88, - kReverseFlow = 0xA0, - kTiltTamper = 0xA1, - kBatteryCoverRemoved = 0xA2, - kBatteryCoverClosed = 0xA3, - kExcessFlow = 0xA4, - kCreditOk = 0xC0, - kLowCredit = 0xC1, - kEmergencyCreditInUse = 0xC0, - kEmergencyCreditExhausted = 0xC1, - kZeroCreditEcNotSelected = 0xC2, - kSupplyOn = 0xC3, - kSupplyOffAarmed = 0xC4, - kSupplyOff = 0xC5, - kDiscountApplied = 0xC6, - kManufacturerSpecificA = 0xE0, - kManufacturerSpecificB = 0xE1, - kManufacturerSpecificC = 0xE2, - kManufacturerSpecificD = 0xE3, - kManufacturerSpecificE = 0xE4, - kManufacturerSpecificF = 0xE5, - kManufacturerSpecificG = 0xE6, - kManufacturerSpecificH = 0xE7, - kManufacturerSpecificI = 0xE8, -}; - -// Enum for MessagingControlConfirmation -enum class MessagingControlConfirmation : uint8_t -{ - kNotRequired = 0x00, - kRequired = 0x80, -}; - -// Enum for MessagingControlEnhancedConfirmation -enum class MessagingControlEnhancedConfirmation : uint8_t -{ - kNotRequired = 0x00, - kRequired = 0x20, -}; - -// Enum for MessagingControlImportance -enum class MessagingControlImportance : uint8_t -{ - kLow = 0x00, - kMedium = 0x04, - kHigh = 0x08, - kCritical = 0x0C, -}; - -// Enum for MessagingControlTransmission -enum class MessagingControlTransmission : uint8_t -{ - kNormal = 0x00, - kNormalAndAnonymous = 0x01, - kAnonymous = 0x02, - kReserved = 0x03, -}; - -// Bitmap for MessagingConfirmationControl -enum class MessagingConfirmationControl : uint8_t -{ - kNoReturned = 0x1, - kYesReturned = 0x2, -}; - -// Bitmap for MessagingControlMask -enum class MessagingControlMask : uint8_t -{ - kTransMechanism = 0x3, - kMessageUrgency = 0xC, - kEnhancedConfirmationRequest = 0x20, - kMessageConfirmation = 0x80, -}; - -// Bitmap for MessagingExtendedControlMask -enum class MessagingExtendedControlMask : uint8_t -{ - kMessageConfirmationStatus = 0x1, -}; -} // namespace Messaging - namespace ApplianceIdentification { } // namespace ApplianceIdentification 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 d2facf25253f48..c250f9ec837d22 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 @@ -343,9 +343,6 @@ static constexpr chip::ClusterId ZCL_APPLICATION_BASIC_CLUSTER_ID = 0x050D; // Definitions for cluster: Account Login static constexpr chip::ClusterId ZCL_ACCOUNT_LOGIN_CLUSTER_ID = 0x050E; -// Definitions for cluster: Messaging -static constexpr chip::ClusterId ZCL_MESSAGING_CLUSTER_ID = 0x0703; - // Definitions for cluster: Appliance Identification static constexpr chip::ClusterId ZCL_APPLIANCE_IDENTIFICATION_CLUSTER_ID = 0x0B00; 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 9a9ffc38039e35..1f0c91ef8c3056 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 @@ -17051,20 +17051,14 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre case Attributes::MaxLevel::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, maxLevel)); break; - case Attributes::PowerOnLevel::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, powerOnLevel)); - break; - case Attributes::PowerOnFadeTime::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, powerOnFadeTime)); - break; - case Attributes::IntrinsicBallastFactor::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, intrinsicBallastFactor)); + case Attributes::IntrinsicBalanceFactor::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, intrinsicBalanceFactor)); break; case Attributes::BallastFactorAdjustment::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, ballastFactorAdjustment)); break; - case Attributes::LampQuality::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, lampQuality)); + case Attributes::LampQuantity::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, lampQuantity)); break; case Attributes::LampType::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, lampType)); @@ -21603,359 +21597,6 @@ namespace Events { } // namespace Events } // namespace AccountLogin -namespace Messaging { - -namespace Commands { -namespace DisplayMessage { -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::kMessageId)), messageId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMessageControl)), messageControl)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStartTime)), startTime)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kDurationInMinutes)), durationInMinutes)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMessage)), message)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalExtendedMessageControl)), - optionalExtendedMessageControl)); - 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) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kMessageId): - ReturnErrorOnFailure(DataModel::Decode(reader, messageId)); - break; - case to_underlying(Fields::kMessageControl): - ReturnErrorOnFailure(DataModel::Decode(reader, messageControl)); - break; - case to_underlying(Fields::kStartTime): - ReturnErrorOnFailure(DataModel::Decode(reader, startTime)); - break; - case to_underlying(Fields::kDurationInMinutes): - ReturnErrorOnFailure(DataModel::Decode(reader, durationInMinutes)); - break; - case to_underlying(Fields::kMessage): - ReturnErrorOnFailure(DataModel::Decode(reader, message)); - break; - case to_underlying(Fields::kOptionalExtendedMessageControl): - ReturnErrorOnFailure(DataModel::Decode(reader, optionalExtendedMessageControl)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace DisplayMessage. -namespace GetLastMessage { -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) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace GetLastMessage. -namespace CancelMessage { -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::kMessageId)), messageId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMessageControl)), messageControl)); - 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) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kMessageId): - ReturnErrorOnFailure(DataModel::Decode(reader, messageId)); - break; - case to_underlying(Fields::kMessageControl): - ReturnErrorOnFailure(DataModel::Decode(reader, messageControl)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace CancelMessage. -namespace MessageConfirmation { -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::kMessageId)), messageId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kConfirmationTime)), confirmationTime)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMessageConfirmationControl)), messageConfirmationControl)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMessageResponse)), messageResponse)); - 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) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kMessageId): - ReturnErrorOnFailure(DataModel::Decode(reader, messageId)); - break; - case to_underlying(Fields::kConfirmationTime): - ReturnErrorOnFailure(DataModel::Decode(reader, confirmationTime)); - break; - case to_underlying(Fields::kMessageConfirmationControl): - ReturnErrorOnFailure(DataModel::Decode(reader, messageConfirmationControl)); - break; - case to_underlying(Fields::kMessageResponse): - ReturnErrorOnFailure(DataModel::Decode(reader, messageResponse)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace MessageConfirmation. -namespace DisplayProtectedMessage { -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::kMessageId)), messageId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMessageControl)), messageControl)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStartTime)), startTime)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kDurationInMinutes)), durationInMinutes)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMessage)), message)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalExtendedMessageControl)), - optionalExtendedMessageControl)); - 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) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kMessageId): - ReturnErrorOnFailure(DataModel::Decode(reader, messageId)); - break; - case to_underlying(Fields::kMessageControl): - ReturnErrorOnFailure(DataModel::Decode(reader, messageControl)); - break; - case to_underlying(Fields::kStartTime): - ReturnErrorOnFailure(DataModel::Decode(reader, startTime)); - break; - case to_underlying(Fields::kDurationInMinutes): - ReturnErrorOnFailure(DataModel::Decode(reader, durationInMinutes)); - break; - case to_underlying(Fields::kMessage): - ReturnErrorOnFailure(DataModel::Decode(reader, message)); - break; - case to_underlying(Fields::kOptionalExtendedMessageControl): - ReturnErrorOnFailure(DataModel::Decode(reader, optionalExtendedMessageControl)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace DisplayProtectedMessage. -namespace GetMessageCancellation { -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::kEarliestImplementationTime)), earliestImplementationTime)); - 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) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kEarliestImplementationTime): - ReturnErrorOnFailure(DataModel::Decode(reader, earliestImplementationTime)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace GetMessageCancellation. -namespace CancelAllMessages { -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::kImplementationDateTime)), implementationDateTime)); - 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) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kImplementationDateTime): - ReturnErrorOnFailure(DataModel::Decode(reader, implementationDateTime)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace CancelAllMessages. -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); - break; - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); - 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 Messaging namespace ApplianceIdentification { namespace Commands { 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 c4ff3169f9652d..1d94fdcf5d6783 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 @@ -22596,55 +22596,31 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace MaxLevel -namespace PowerOnLevel { +namespace IntrinsicBalanceFactor { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BallastConfiguration::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::PowerOnLevel::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace PowerOnLevel -namespace PowerOnFadeTime { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BallastConfiguration::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::PowerOnFadeTime::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace PowerOnFadeTime -namespace IntrinsicBallastFactor { -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::BallastConfiguration::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::IntrinsicBallastFactor::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::IntrinsicBalanceFactor::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace IntrinsicBallastFactor +} // namespace IntrinsicBalanceFactor namespace BallastFactorAdjustment { 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::BallastConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::BallastFactorAdjustment::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace BallastFactorAdjustment -namespace LampQuality { +namespace LampQuantity { struct TypeInfo { using Type = uint8_t; @@ -22652,10 +22628,10 @@ struct TypeInfo using DecodableArgType = uint8_t; static constexpr ClusterId GetClusterId() { return Clusters::BallastConfiguration::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::LampQuality::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::LampQuantity::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace LampQuality +} // namespace LampQuantity namespace LampType { struct TypeInfo { @@ -22685,9 +22661,9 @@ struct TypeInfo namespace LampRatedHours { struct TypeInfo { - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_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::BallastConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LampRatedHours::Id; } @@ -22697,9 +22673,9 @@ struct TypeInfo namespace LampBurnHours { struct TypeInfo { - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_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::BallastConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LampBurnHours::Id; } @@ -22721,9 +22697,9 @@ struct TypeInfo namespace LampBurnHoursTripPoint { struct TypeInfo { - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_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::BallastConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LampBurnHoursTripPoint::Id; } @@ -22769,22 +22745,20 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::PhysicalMinLevel::TypeInfo::DecodableType physicalMinLevel = static_cast(0); - Attributes::PhysicalMaxLevel::TypeInfo::DecodableType physicalMaxLevel = static_cast(0); - Attributes::BallastStatus::TypeInfo::DecodableType ballastStatus = static_cast(0); - Attributes::MinLevel::TypeInfo::DecodableType minLevel = static_cast(0); - Attributes::MaxLevel::TypeInfo::DecodableType maxLevel = static_cast(0); - Attributes::PowerOnLevel::TypeInfo::DecodableType powerOnLevel = static_cast(0); - Attributes::PowerOnFadeTime::TypeInfo::DecodableType powerOnFadeTime = static_cast(0); - Attributes::IntrinsicBallastFactor::TypeInfo::DecodableType intrinsicBallastFactor = static_cast(0); - Attributes::BallastFactorAdjustment::TypeInfo::DecodableType ballastFactorAdjustment = static_cast(0); - Attributes::LampQuality::TypeInfo::DecodableType lampQuality = static_cast(0); + Attributes::PhysicalMinLevel::TypeInfo::DecodableType physicalMinLevel = static_cast(0); + Attributes::PhysicalMaxLevel::TypeInfo::DecodableType physicalMaxLevel = static_cast(0); + Attributes::BallastStatus::TypeInfo::DecodableType ballastStatus = static_cast(0); + Attributes::MinLevel::TypeInfo::DecodableType minLevel = static_cast(0); + Attributes::MaxLevel::TypeInfo::DecodableType maxLevel = static_cast(0); + Attributes::IntrinsicBalanceFactor::TypeInfo::DecodableType intrinsicBalanceFactor; + Attributes::BallastFactorAdjustment::TypeInfo::DecodableType ballastFactorAdjustment; + Attributes::LampQuantity::TypeInfo::DecodableType lampQuantity = static_cast(0); Attributes::LampType::TypeInfo::DecodableType lampType; Attributes::LampManufacturer::TypeInfo::DecodableType lampManufacturer; - Attributes::LampRatedHours::TypeInfo::DecodableType lampRatedHours = static_cast(0); - Attributes::LampBurnHours::TypeInfo::DecodableType lampBurnHours = static_cast(0); - Attributes::LampAlarmMode::TypeInfo::DecodableType lampAlarmMode = static_cast(0); - Attributes::LampBurnHoursTripPoint::TypeInfo::DecodableType lampBurnHoursTripPoint = static_cast(0); + Attributes::LampRatedHours::TypeInfo::DecodableType lampRatedHours; + Attributes::LampBurnHours::TypeInfo::DecodableType lampBurnHours; + Attributes::LampAlarmMode::TypeInfo::DecodableType lampAlarmMode = static_cast(0); + Attributes::LampBurnHoursTripPoint::TypeInfo::DecodableType lampBurnHoursTripPoint; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::AttributeList::TypeInfo::DecodableType attributeList; @@ -29631,367 +29605,6 @@ struct TypeInfo }; } // namespace Attributes } // namespace AccountLogin -namespace Messaging { - -namespace Commands { -// Forward-declarations so we can reference these later. - -namespace DisplayMessage { -struct Type; -struct DecodableType; -} // namespace DisplayMessage - -namespace GetLastMessage { -struct Type; -struct DecodableType; -} // namespace GetLastMessage - -namespace CancelMessage { -struct Type; -struct DecodableType; -} // namespace CancelMessage - -namespace MessageConfirmation { -struct Type; -struct DecodableType; -} // namespace MessageConfirmation - -namespace DisplayProtectedMessage { -struct Type; -struct DecodableType; -} // namespace DisplayProtectedMessage - -namespace GetMessageCancellation { -struct Type; -struct DecodableType; -} // namespace GetMessageCancellation - -namespace CancelAllMessages { -struct Type; -struct DecodableType; -} // namespace CancelAllMessages - -} // namespace Commands - -namespace Commands { -namespace DisplayMessage { -enum class Fields -{ - kMessageId = 0, - kMessageControl = 1, - kStartTime = 2, - kDurationInMinutes = 3, - kMessage = 4, - kOptionalExtendedMessageControl = 5, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::DisplayMessage::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - - uint32_t messageId = static_cast(0); - chip::BitMask messageControl = static_cast>(0); - uint32_t startTime = static_cast(0); - uint16_t durationInMinutes = static_cast(0); - chip::CharSpan message; - chip::BitMask optionalExtendedMessageControl = - static_cast>(0); - - 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::DisplayMessage::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - - uint32_t messageId = static_cast(0); - chip::BitMask messageControl = static_cast>(0); - uint32_t startTime = static_cast(0); - uint16_t durationInMinutes = static_cast(0); - chip::CharSpan message; - chip::BitMask optionalExtendedMessageControl = - static_cast>(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace DisplayMessage -namespace GetLastMessage { -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::GetLastMessage::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - - 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::GetLastMessage::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace GetLastMessage -namespace CancelMessage { -enum class Fields -{ - kMessageId = 0, - kMessageControl = 1, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::CancelMessage::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - - uint32_t messageId = static_cast(0); - chip::BitMask messageControl = static_cast>(0); - - 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::CancelMessage::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - - uint32_t messageId = static_cast(0); - chip::BitMask messageControl = static_cast>(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace CancelMessage -namespace MessageConfirmation { -enum class Fields -{ - kMessageId = 0, - kConfirmationTime = 1, - kMessageConfirmationControl = 2, - kMessageResponse = 3, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MessageConfirmation::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - - uint32_t messageId = static_cast(0); - uint32_t confirmationTime = static_cast(0); - uint8_t messageConfirmationControl = static_cast(0); - chip::ByteSpan messageResponse; - - 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::MessageConfirmation::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - - uint32_t messageId = static_cast(0); - uint32_t confirmationTime = static_cast(0); - uint8_t messageConfirmationControl = static_cast(0); - chip::ByteSpan messageResponse; - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace MessageConfirmation -namespace DisplayProtectedMessage { -enum class Fields -{ - kMessageId = 0, - kMessageControl = 1, - kStartTime = 2, - kDurationInMinutes = 3, - kMessage = 4, - kOptionalExtendedMessageControl = 5, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::DisplayProtectedMessage::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - - uint32_t messageId = static_cast(0); - chip::BitMask messageControl = static_cast>(0); - uint32_t startTime = static_cast(0); - uint16_t durationInMinutes = static_cast(0); - chip::CharSpan message; - chip::BitMask optionalExtendedMessageControl = - static_cast>(0); - - 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::DisplayProtectedMessage::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - - uint32_t messageId = static_cast(0); - chip::BitMask messageControl = static_cast>(0); - uint32_t startTime = static_cast(0); - uint16_t durationInMinutes = static_cast(0); - chip::CharSpan message; - chip::BitMask optionalExtendedMessageControl = - static_cast>(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace DisplayProtectedMessage -namespace GetMessageCancellation { -enum class Fields -{ - kEarliestImplementationTime = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::GetMessageCancellation::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - - uint32_t earliestImplementationTime = static_cast(0); - - 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::GetMessageCancellation::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - - uint32_t earliestImplementationTime = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace GetMessageCancellation -namespace CancelAllMessages { -enum class Fields -{ - kImplementationDateTime = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::CancelAllMessages::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - - uint32_t implementationDateTime = static_cast(0); - - 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::CancelAllMessages::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - - uint32_t implementationDateTime = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace CancelAllMessages -} // namespace Commands - -namespace Attributes { - -namespace GeneratedCommandList { -struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } -}; -} // namespace GeneratedCommandList -namespace AcceptedCommandList { -struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } -}; -} // namespace AcceptedCommandList -namespace AttributeList { -struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } -}; -} // namespace AttributeList -namespace FeatureMap { -struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } -}; -} // namespace FeatureMap -namespace ClusterRevision { -struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } -}; -} // namespace ClusterRevision - -struct TypeInfo -{ - struct DecodableType - { - static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - - CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - - Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; - Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; - Attributes::AttributeList::TypeInfo::DecodableType attributeList; - Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); - Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); - }; -}; -} // namespace Attributes -} // namespace Messaging namespace ApplianceIdentification { namespace Attributes { 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 8135695b990b13..916f289b60a360 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 @@ -356,15 +356,6 @@ #define ZCL_LOGIN_COMMAND_ID (0x02) #define ZCL_LOGOUT_COMMAND_ID (0x03) -// Commands for cluster: Messaging -#define ZCL_DISPLAY_MESSAGE_COMMAND_ID (0x00) -#define ZCL_GET_LAST_MESSAGE_COMMAND_ID (0x00) -#define ZCL_CANCEL_MESSAGE_COMMAND_ID (0x01) -#define ZCL_MESSAGE_CONFIRMATION_COMMAND_ID (0x01) -#define ZCL_DISPLAY_PROTECTED_MESSAGE_COMMAND_ID (0x02) -#define ZCL_GET_MESSAGE_CANCELLATION_COMMAND_ID (0x02) -#define ZCL_CANCEL_ALL_MESSAGES_COMMAND_ID (0x03) - // Commands for cluster: Appliance Events and Alert #define ZCL_GET_ALERTS_COMMAND_ID (0x00) #define ZCL_GET_ALERTS_RESPONSE_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 252127c9185fd8..dce2505e4ea734 100644 --- a/zzz_generated/app-common/app-common/zap-generated/enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/enums.h @@ -755,20 +755,6 @@ enum EmberAfWiFiVersionType : uint8_t #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) -#define EMBER_AF_MESSAGING_CONFIRMATION_CONTROL_YES_RETURNED_OFFSET (1) -#define EMBER_AF_MESSAGING_CONTROL_MASK_TRANS_MECHANISM (3) -#define EMBER_AF_MESSAGING_CONTROL_MASK_TRANS_MECHANISM_OFFSET (0) -#define EMBER_AF_MESSAGING_CONTROL_MASK_MESSAGE_URGENCY (12) -#define EMBER_AF_MESSAGING_CONTROL_MASK_MESSAGE_URGENCY_OFFSET (2) -#define EMBER_AF_MESSAGING_CONTROL_MASK_ENHANCED_CONFIRMATION_REQUEST (32) -#define EMBER_AF_MESSAGING_CONTROL_MASK_ENHANCED_CONFIRMATION_REQUEST_OFFSET (5) -#define EMBER_AF_MESSAGING_CONTROL_MASK_MESSAGE_CONFIRMATION (128) -#define EMBER_AF_MESSAGING_CONTROL_MASK_MESSAGE_CONFIRMATION_OFFSET (7) -#define EMBER_AF_MESSAGING_EXTENDED_CONTROL_MASK_MESSAGE_CONFIRMATION_STATUS (1) -#define EMBER_AF_MESSAGING_EXTENDED_CONTROL_MASK_MESSAGE_CONFIRMATION_STATUS_OFFSET (0) #define EMBER_AF_MODE_MOTOR_DIRECTION_REVERSED (1) #define EMBER_AF_MODE_MOTOR_DIRECTION_REVERSED_OFFSET (0) #define EMBER_AF_MODE_CALIBRATION_MODE (2) 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 c665aa9c6c3e98..ff018c33ffa802 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 @@ -3886,25 +3886,17 @@ namespace MaxLevel { static constexpr AttributeId Id = 0x00000011; } // namespace MaxLevel -namespace PowerOnLevel { -static constexpr AttributeId Id = 0x00000012; -} // namespace PowerOnLevel - -namespace PowerOnFadeTime { -static constexpr AttributeId Id = 0x00000013; -} // namespace PowerOnFadeTime - -namespace IntrinsicBallastFactor { +namespace IntrinsicBalanceFactor { static constexpr AttributeId Id = 0x00000014; -} // namespace IntrinsicBallastFactor +} // namespace IntrinsicBalanceFactor namespace BallastFactorAdjustment { static constexpr AttributeId Id = 0x00000015; } // namespace BallastFactorAdjustment -namespace LampQuality { +namespace LampQuantity { static constexpr AttributeId Id = 0x00000020; -} // namespace LampQuality +} // namespace LampQuantity namespace LampType { static constexpr AttributeId Id = 0x00000030; @@ -5949,32 +5941,6 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace AccountLogin -namespace Messaging { -namespace Attributes { - -namespace GeneratedCommandList { -static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; -} // namespace GeneratedCommandList - -namespace AcceptedCommandList { -static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; -} // namespace AcceptedCommandList - -namespace AttributeList { -static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; -} // namespace AttributeList - -namespace FeatureMap { -static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; -} // namespace FeatureMap - -namespace ClusterRevision { -static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace Messaging - namespace ApplianceIdentification { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index 4c4d17c7a13210..35b73227baf9ff 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 @@ -346,9 +346,6 @@ static constexpr ClusterId Id = 0x0000050D; namespace AccountLogin { static constexpr ClusterId Id = 0x0000050E; } // namespace AccountLogin -namespace Messaging { -static constexpr ClusterId Id = 0x00000703; -} // namespace Messaging namespace ApplianceIdentification { static constexpr ClusterId Id = 0x00000B00; } // namespace ApplianceIdentification 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 b4979dbe3dd9e3..994e5919623c31 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 @@ -1243,40 +1243,6 @@ static constexpr CommandId Id = 0x00000003; } // namespace Commands } // namespace AccountLogin -namespace Messaging { -namespace Commands { - -namespace DisplayMessage { -static constexpr CommandId Id = 0x00000000; -} // namespace DisplayMessage - -namespace GetLastMessage { -static constexpr CommandId Id = 0x00000000; -} // namespace GetLastMessage - -namespace CancelMessage { -static constexpr CommandId Id = 0x00000001; -} // namespace CancelMessage - -namespace MessageConfirmation { -static constexpr CommandId Id = 0x00000001; -} // namespace MessageConfirmation - -namespace DisplayProtectedMessage { -static constexpr CommandId Id = 0x00000002; -} // namespace DisplayProtectedMessage - -namespace GetMessageCancellation { -static constexpr CommandId Id = 0x00000002; -} // namespace GetMessageCancellation - -namespace CancelAllMessages { -static constexpr CommandId Id = 0x00000003; -} // namespace CancelAllMessages - -} // namespace Commands -} // namespace Messaging - namespace ApplianceEventsAndAlert { namespace Commands { 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 a79175a20136da..1aefef551764c0 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 @@ -734,12 +734,6 @@ #define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER #endif -#if defined(ZCL_USING_MESSAGING_CLUSTER_SERVER) || defined(ZCL_USING_MESSAGING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_MESSAGING_CLUSTER { ZCL_MESSAGING_CLUSTER_ID, "Messaging" }, -#else -#define CHIP_PRINTCLUSTER_MESSAGING_CLUSTER -#endif - #if defined(ZCL_USING_APPLIANCE_IDENTIFICATION_CLUSTER_SERVER) || defined(ZCL_USING_APPLIANCE_IDENTIFICATION_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_APPLIANCE_IDENTIFICATION_CLUSTER { ZCL_APPLIANCE_IDENTIFICATION_CLUSTER_ID, "Appliance Identification" }, #else @@ -885,7 +879,6 @@ CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER \ CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER \ CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER \ - CHIP_PRINTCLUSTER_MESSAGING_CLUSTER \ CHIP_PRINTCLUSTER_APPLIANCE_IDENTIFICATION_CLUSTER \ CHIP_PRINTCLUSTER_METER_IDENTIFICATION_CLUSTER \ CHIP_PRINTCLUSTER_APPLIANCE_EVENTS_AND_ALERT_CLUSTER \ diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index de0669afab61da..6171f4426e7426 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -140,7 +140,6 @@ | ApplicationLauncher | 0x050C | | ApplicationBasic | 0x050D | | AccountLogin | 0x050E | -| Messaging | 0x0703 | | ApplianceIdentification | 0x0B00 | | MeterIdentification | 0x0B01 | | ApplianceEventsAndAlert | 0x0B02 | @@ -6736,11 +6735,9 @@ class ColorControlStepColorTemperature : public ClusterCommand | * BallastStatus | 0x0002 | | * MinLevel | 0x0010 | | * MaxLevel | 0x0011 | -| * PowerOnLevel | 0x0012 | -| * PowerOnFadeTime | 0x0013 | -| * IntrinsicBallastFactor | 0x0014 | +| * IntrinsicBalanceFactor | 0x0014 | | * BallastFactorAdjustment | 0x0015 | -| * LampQuality | 0x0020 | +| * LampQuantity | 0x0020 | | * LampType | 0x0030 | | * LampManufacturer | 0x0031 | | * LampRatedHours | 0x0032 | @@ -8635,118 +8632,6 @@ class AccountLoginLogout : public ClusterCommand chip::app::Clusters::AccountLogin::Commands::Logout::Type mRequest; }; -/*----------------------------------------------------------------------------*\ -| Cluster Messaging | 0x0703 | -|------------------------------------------------------------------------------| -| Commands: | | -| * GetLastMessage | 0x00 | -| * MessageConfirmation | 0x01 | -| * GetMessageCancellation | 0x02 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command GetLastMessage - */ -class MessagingGetLastMessage : public ClusterCommand -{ -public: - MessagingGetLastMessage(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("get-last-message", credsIssuerConfig) - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000703) command (0x00000000) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000703, 0x00000000, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000703) command (0x00000000) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000703, 0x00000000, mRequest); - } - -private: - chip::app::Clusters::Messaging::Commands::GetLastMessage::Type mRequest; -}; - -/* - * Command MessageConfirmation - */ -class MessagingMessageConfirmation : public ClusterCommand -{ -public: - MessagingMessageConfirmation(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("message-confirmation", credsIssuerConfig) - { - AddArgument("MessageId", 0, UINT32_MAX, &mRequest.messageId); - AddArgument("ConfirmationTime", 0, UINT32_MAX, &mRequest.confirmationTime); - AddArgument("MessageConfirmationControl", 0, UINT8_MAX, &mRequest.messageConfirmationControl); - AddArgument("MessageResponse", &mRequest.messageResponse); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000703) command (0x00000001) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000703, 0x00000001, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000703) command (0x00000001) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000703, 0x00000001, mRequest); - } - -private: - chip::app::Clusters::Messaging::Commands::MessageConfirmation::Type mRequest; -}; - -/* - * Command GetMessageCancellation - */ -class MessagingGetMessageCancellation : public ClusterCommand -{ -public: - MessagingGetMessageCancellation(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("get-message-cancellation", credsIssuerConfig) - { - AddArgument("EarliestImplementationTime", 0, UINT32_MAX, &mRequest.earliestImplementationTime); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000703) command (0x00000002) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000703, 0x00000002, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000703) command (0x00000002) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000703, 0x00000002, mRequest); - } - -private: - chip::app::Clusters::Messaging::Commands::GetMessageCancellation::Type mRequest; -}; - /*----------------------------------------------------------------------------*\ | Cluster ApplianceIdentification | 0x0B00 | |------------------------------------------------------------------------------| @@ -14067,11 +13952,9 @@ void registerClusterBallastConfiguration(Commands & commands, CredentialIssuerCo make_unique(Id, "ballast-status", Attributes::BallastStatus::Id, credsIssuerConfig), // make_unique(Id, "min-level", Attributes::MinLevel::Id, credsIssuerConfig), // make_unique(Id, "max-level", Attributes::MaxLevel::Id, credsIssuerConfig), // - make_unique(Id, "power-on-level", Attributes::PowerOnLevel::Id, credsIssuerConfig), // - make_unique(Id, "power-on-fade-time", Attributes::PowerOnFadeTime::Id, credsIssuerConfig), // - make_unique(Id, "intrinsic-ballast-factor", Attributes::IntrinsicBallastFactor::Id, credsIssuerConfig), // + make_unique(Id, "intrinsic-balance-factor", Attributes::IntrinsicBalanceFactor::Id, credsIssuerConfig), // make_unique(Id, "ballast-factor-adjustment", Attributes::BallastFactorAdjustment::Id, credsIssuerConfig), // - make_unique(Id, "lamp-quality", Attributes::LampQuality::Id, credsIssuerConfig), // + make_unique(Id, "lamp-quantity", Attributes::LampQuantity::Id, credsIssuerConfig), // make_unique(Id, "lamp-type", Attributes::LampType::Id, credsIssuerConfig), // make_unique(Id, "lamp-manufacturer", Attributes::LampManufacturer::Id, credsIssuerConfig), // make_unique(Id, "lamp-rated-hours", Attributes::LampRatedHours::Id, credsIssuerConfig), // @@ -14086,38 +13969,32 @@ void registerClusterBallastConfiguration(Commands & commands, CredentialIssuerCo make_unique>(Id, credsIssuerConfig), // make_unique>(Id, "min-level", 0, UINT8_MAX, Attributes::MinLevel::Id, credsIssuerConfig), // make_unique>(Id, "max-level", 0, UINT8_MAX, Attributes::MaxLevel::Id, credsIssuerConfig), // - make_unique>(Id, "power-on-level", 0, UINT8_MAX, Attributes::PowerOnLevel::Id, - credsIssuerConfig), // - make_unique>(Id, "power-on-fade-time", 0, UINT16_MAX, Attributes::PowerOnFadeTime::Id, - credsIssuerConfig), // - make_unique>(Id, "intrinsic-ballast-factor", 0, UINT8_MAX, Attributes::IntrinsicBallastFactor::Id, - credsIssuerConfig), // - make_unique>(Id, "ballast-factor-adjustment", 0, UINT8_MAX, Attributes::BallastFactorAdjustment::Id, - credsIssuerConfig), // - make_unique>(Id, "lamp-type", Attributes::LampType::Id, credsIssuerConfig), // + make_unique>>( + Id, "intrinsic-balance-factor", 0, UINT8_MAX, Attributes::IntrinsicBalanceFactor::Id, credsIssuerConfig), // + make_unique>>( + Id, "ballast-factor-adjustment", 0, UINT8_MAX, Attributes::BallastFactorAdjustment::Id, credsIssuerConfig), // + make_unique>(Id, "lamp-type", Attributes::LampType::Id, credsIssuerConfig), // make_unique>(Id, "lamp-manufacturer", Attributes::LampManufacturer::Id, credsIssuerConfig), // - make_unique>(Id, "lamp-rated-hours", 0, UINT32_MAX, Attributes::LampRatedHours::Id, - credsIssuerConfig), // - make_unique>(Id, "lamp-burn-hours", 0, UINT32_MAX, Attributes::LampBurnHours::Id, - credsIssuerConfig), // + make_unique>>(Id, "lamp-rated-hours", 0, UINT32_MAX, + Attributes::LampRatedHours::Id, credsIssuerConfig), // + make_unique>>(Id, "lamp-burn-hours", 0, UINT32_MAX, + Attributes::LampBurnHours::Id, credsIssuerConfig), // make_unique>(Id, "lamp-alarm-mode", 0, UINT8_MAX, Attributes::LampAlarmMode::Id, credsIssuerConfig), // - make_unique>(Id, "lamp-burn-hours-trip-point", 0, UINT32_MAX, - Attributes::LampBurnHoursTripPoint::Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "physical-min-level", Attributes::PhysicalMinLevel::Id, credsIssuerConfig), // - make_unique(Id, "physical-max-level", Attributes::PhysicalMaxLevel::Id, credsIssuerConfig), // - make_unique(Id, "ballast-status", Attributes::BallastStatus::Id, credsIssuerConfig), // - make_unique(Id, "min-level", Attributes::MinLevel::Id, credsIssuerConfig), // - make_unique(Id, "max-level", Attributes::MaxLevel::Id, credsIssuerConfig), // - make_unique(Id, "power-on-level", Attributes::PowerOnLevel::Id, credsIssuerConfig), // - make_unique(Id, "power-on-fade-time", Attributes::PowerOnFadeTime::Id, credsIssuerConfig), // - make_unique(Id, "intrinsic-ballast-factor", Attributes::IntrinsicBallastFactor::Id, + make_unique>>( + Id, "lamp-burn-hours-trip-point", 0, UINT32_MAX, Attributes::LampBurnHoursTripPoint::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "physical-min-level", Attributes::PhysicalMinLevel::Id, credsIssuerConfig), // + make_unique(Id, "physical-max-level", Attributes::PhysicalMaxLevel::Id, credsIssuerConfig), // + make_unique(Id, "ballast-status", Attributes::BallastStatus::Id, credsIssuerConfig), // + make_unique(Id, "min-level", Attributes::MinLevel::Id, credsIssuerConfig), // + make_unique(Id, "max-level", Attributes::MaxLevel::Id, credsIssuerConfig), // + make_unique(Id, "intrinsic-balance-factor", Attributes::IntrinsicBalanceFactor::Id, credsIssuerConfig), // make_unique(Id, "ballast-factor-adjustment", Attributes::BallastFactorAdjustment::Id, credsIssuerConfig), // - make_unique(Id, "lamp-quality", Attributes::LampQuality::Id, credsIssuerConfig), // + make_unique(Id, "lamp-quantity", Attributes::LampQuantity::Id, credsIssuerConfig), // make_unique(Id, "lamp-type", Attributes::LampType::Id, credsIssuerConfig), // make_unique(Id, "lamp-manufacturer", Attributes::LampManufacturer::Id, credsIssuerConfig), // make_unique(Id, "lamp-rated-hours", Attributes::LampRatedHours::Id, credsIssuerConfig), // @@ -16317,45 +16194,6 @@ void registerClusterAccountLogin(Commands & commands, CredentialIssuerCommands * commands.Register(clusterName, clusterCommands); } -void registerClusterMessaging(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) -{ - using namespace chip::app::Clusters::Messaging; - - const char * clusterName = "Messaging"; - - commands_list clusterCommands = { - // - // Commands - // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - // - // Attributes - // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // - make_unique>(Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // - // - // Events - // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - }; - - commands.Register(clusterName, clusterCommands); -} void registerClusterApplianceIdentification(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::ApplianceIdentification; @@ -17460,7 +17298,6 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterApplicationLauncher(commands, credsIssuerConfig); registerClusterApplicationBasic(commands, credsIssuerConfig); registerClusterAccountLogin(commands, credsIssuerConfig); - registerClusterMessaging(commands, credsIssuerConfig); registerClusterApplianceIdentification(commands, credsIssuerConfig); registerClusterMeterIdentification(commands, credsIssuerConfig); registerClusterApplianceEventsAndAlert(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index f7e482982a7862..f74a43dc5a4517 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -7925,6 +7925,107 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case BallastConfiguration::Id: { + switch (path.mAttributeId) + { + case BallastConfiguration::Attributes::PhysicalMinLevel::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PhysicalMinLevel", 1, value); + } + case BallastConfiguration::Attributes::PhysicalMaxLevel::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PhysicalMaxLevel", 1, value); + } + case BallastConfiguration::Attributes::BallastStatus::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("BallastStatus", 1, value); + } + case BallastConfiguration::Attributes::MinLevel::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MinLevel", 1, value); + } + case BallastConfiguration::Attributes::MaxLevel::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxLevel", 1, value); + } + case BallastConfiguration::Attributes::IntrinsicBalanceFactor::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("IntrinsicBalanceFactor", 1, value); + } + case BallastConfiguration::Attributes::BallastFactorAdjustment::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("BallastFactorAdjustment", 1, value); + } + case BallastConfiguration::Attributes::LampQuantity::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LampQuantity", 1, value); + } + case BallastConfiguration::Attributes::LampType::Id: { + chip::CharSpan value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LampType", 1, value); + } + case BallastConfiguration::Attributes::LampManufacturer::Id: { + chip::CharSpan value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LampManufacturer", 1, value); + } + case BallastConfiguration::Attributes::LampRatedHours::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LampRatedHours", 1, value); + } + case BallastConfiguration::Attributes::LampBurnHours::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LampBurnHours", 1, value); + } + case BallastConfiguration::Attributes::LampAlarmMode::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LampAlarmMode", 1, value); + } + case BallastConfiguration::Attributes::LampBurnHoursTripPoint::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LampBurnHoursTripPoint", 1, value); + } + case BallastConfiguration::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case BallastConfiguration::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case BallastConfiguration::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case BallastConfiguration::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case BallastConfiguration::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case IlluminanceMeasurement::Id: { switch (path.mAttributeId) { diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 35dc4236d77909..c1d2b694c69cfc 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -199,6 +199,7 @@ class TestList : public Command printf("TestConfigVariables\n"); printf("TestDescriptorCluster\n"); printf("TestBasicInformation\n"); + printf("TestFabricRemovalWhileSubscribed\n"); printf("TestGeneralCommissioning\n"); printf("TestIdentifyCluster\n"); printf("TestOperationalCredentialsCluster\n"); @@ -2429,7 +2430,7 @@ class Test_TC_CC_1_1Suite : public TestCommand class Test_TC_CC_2_1Suite : public TestCommand { public: - Test_TC_CC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_2_1", 61, credsIssuerConfig) + Test_TC_CC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_2_1", 54, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -2473,7 +2474,6 @@ class Test_TC_CC_2_1Suite : public TestCommand { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("currentHue", value, 0U)); VerifyOrReturn(CheckConstraintType("value", "", "uint8")); } break; @@ -2482,7 +2482,6 @@ class Test_TC_CC_2_1Suite : public TestCommand { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("currentSaturation", value, 0U)); VerifyOrReturn(CheckConstraintType("value", "", "uint8")); } break; @@ -2491,7 +2490,7 @@ class Test_TC_CC_2_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("currentX", value, 24939U)); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); } break; case 4: @@ -2509,25 +2508,28 @@ class Test_TC_CC_2_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("currentY", value, 24701U)); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintType("value", "", "enum8")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); } break; case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorTemperature", value, 250U)); + VerifyOrReturn(CheckConstraintType("value", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 254)); } break; case 8: @@ -2541,14 +2543,6 @@ class Test_TC_CC_2_1Suite : public TestCommand } break; case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint8_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorMode", value, 1U)); - } - break; - case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -2558,79 +2552,75 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); } break; - case 11: + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("options", value, 0U)); - VerifyOrReturn(CheckConstraintType("value", "", "map8")); + VerifyOrReturn(CheckConstraintType("value", "", "bitmap8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); } break; - case 12: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("enhancedCurrentHue", value, 0U)); VerifyOrReturn(CheckConstraintType("value", "", "uint16")); } break; - case 13: + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("enhancedColorMode", value, 1U)); VerifyOrReturn(CheckConstraintType("value", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); } break; - case 14: + case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopActive", value, 0U)); VerifyOrReturn(CheckConstraintType("value", "", "uint8")); } break; - case 15: + case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopDirection", value, 0U)); VerifyOrReturn(CheckConstraintType("value", "", "uint8")); } break; - case 16: + case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopTime", value, 25U)); VerifyOrReturn(CheckConstraintType("value", "", "uint16")); } break; - case 17: + case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", value, 8960U)); VerifyOrReturn(CheckConstraintType("value", "", "uint16")); } break; - case 18: + case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopStoredEnhancedHue", value, 0U)); VerifyOrReturn(CheckConstraintType("value", "", "uint16")); } break; - case 19: + case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint32_t value; @@ -2638,33 +2628,18 @@ class Test_TC_CC_2_1Suite : public TestCommand FeatureMapValue = value; } break; - case 20: + case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("colorCapabilities", value, FeatureMapValue)); - } - break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "map16")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 31U)); } break; - case 22: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorTempPhysicalMinMireds", value, 0U)); - } - break; - case 23: + case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2674,15 +2649,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 24: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorTempPhysicalMaxMireds", value, 65279U)); - } - break; - case 25: + case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2692,7 +2659,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 26: + case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2702,7 +2669,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 27: + case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2712,35 +2679,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 28: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("remainingTime", value, 0U)); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); - } - break; - case 29: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint8_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); - } - break; - case 30: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::CharSpan value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 254)); - } - break; - case 31: + case 24: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -2750,7 +2689,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 6U)); } break; - case 32: + case 25: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2760,7 +2699,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 33: + case 26: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2770,7 +2709,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 34: + case 27: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -2778,7 +2717,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "uint8")); } break; - case 35: + case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2788,7 +2727,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 36: + case 29: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2798,7 +2737,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 37: + case 30: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -2806,7 +2745,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "uint8")); } break; - case 38: + case 31: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2816,7 +2755,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 39: + case 32: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2826,7 +2765,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 40: + case 33: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -2834,7 +2773,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "uint8")); } break; - case 41: + case 34: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2844,7 +2783,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 42: + case 35: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2854,7 +2793,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 43: + case 36: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -2862,7 +2801,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "uint8")); } break; - case 44: + case 37: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2872,7 +2811,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 45: + case 38: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2882,7 +2821,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 46: + case 39: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -2890,7 +2829,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "uint8")); } break; - case 47: + case 40: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2900,7 +2839,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 48: + case 41: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2910,7 +2849,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 49: + case 42: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -2918,7 +2857,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "uint8")); } break; - case 50: + case 43: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2928,7 +2867,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 51: + case 44: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2938,7 +2877,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 52: + case 45: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2948,7 +2887,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 53: + case 46: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2958,7 +2897,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 54: + case 47: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -2966,7 +2905,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "uint8")); } break; - case 55: + case 48: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2976,7 +2915,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 56: + case 49: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -2986,7 +2925,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 57: + case 50: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -2994,7 +2933,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "uint8")); } break; - case 58: + case 51: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -3004,7 +2943,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 59: + case 52: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; @@ -3014,7 +2953,7 @@ class Test_TC_CC_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 60: + case 53: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -3045,360 +2984,318 @@ class Test_TC_CC_2_1Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Validate constraints of attribute: CurrentHue"); - VerifyOrDo(!ShouldSkip("CC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(1, "TH reads CurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0000 && CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id, true, chip::NullOptional); } case 2: { - LogStep(2, "Validate constraints of attribute: CurrentSaturation"); - VerifyOrDo(!ShouldSkip("CC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(2, "TH reads CurrentSaturation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0001 && CC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id, true, chip::NullOptional); } case 3: { - LogStep(3, "Reads CurrentX attribute from DUT"); - VerifyOrDo(!ShouldSkip("CC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, - chip::NullOptional); + LogStep(3, "TH reads RemainingTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::RemainingTime::Id, + true, chip::NullOptional); } case 4: { - LogStep(4, "Validate constraints of attribute: CurrentX"); - VerifyOrDo(!ShouldSkip("CC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(4, "TH reads CurrentX attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0003 && CC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id, true, chip::NullOptional); } case 5: { - LogStep(5, "Reads CurrentY attribute from DUT"); - VerifyOrDo(!ShouldSkip("CC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(5, "TH reads CurrentY attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0004 && CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, chip::NullOptional); } case 6: { - LogStep(6, "Validate constraints of attribute: CurrentY"); - VerifyOrDo(!ShouldSkip("CC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id, true, - chip::NullOptional); + LogStep(6, "TH reads DriftCompensation attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::DriftCompensation::Id, + true, chip::NullOptional); } case 7: { - LogStep(7, "Reads ColorTemperatureMireds attribute from DUT"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, + LogStep(7, "TH reads CompensationText attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CompensationText::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Validate constraints of attribute: ColorTemperatureMireds"); - VerifyOrDo(!ShouldSkip("CC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(8, "TH reads ColorTemperatureMireds attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A0007 && CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id, true, chip::NullOptional); } case 9: { - LogStep(9, "Reads ColorMode attribute from DUT"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, - chip::NullOptional); - } - case 10: { - LogStep(10, "Validate constraints of attribute: ColorMode"); + LogStep(9, "TH reads ColorMode attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorMode::Id, true, chip::NullOptional); } - case 11: { - LogStep(11, "Validate constraints of attribute: Options"); + case 10: { + LogStep(10, "TH reads Options attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Options::Id, true, chip::NullOptional); } - case 12: { - LogStep(12, "Validate constraints of attribute: EnhancedCurrentHue"); - VerifyOrDo(!ShouldSkip("CC.S.A4000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 11: { + LogStep(11, "TH reads EnhancedCurrentHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4000 && CC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedCurrentHue::Id, true, chip::NullOptional); } - case 13: { - LogStep(13, "Validate constraints of attribute: EnhancedColorMode"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 12: { + LogStep(12, "TH reads EnhancedColorMode attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.F02 && CC.S.A4001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, true, chip::NullOptional); } - case 14: { - LogStep(14, "Validate constraints of attribute: ColorLoopActive"); - VerifyOrDo(!ShouldSkip("CC.S.A4002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 13: { + LogStep(13, "TH reads ColorLoopActive attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4002 && CC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id, true, chip::NullOptional); } - case 15: { - LogStep(15, "Validate constraints of attribute: ColorLoopDirection"); - VerifyOrDo(!ShouldSkip("CC.S.A4003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 14: { + LogStep(14, "TH reads ColorLoopDirection attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4003 && CC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopDirection::Id, true, chip::NullOptional); } - case 16: { - LogStep(16, "Validate constraints of attribute: ColorLoopTime"); - VerifyOrDo(!ShouldSkip("CC.S.A4004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 15: { + LogStep(15, "TH reads ColorLoopTime attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4004 && CC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopTime::Id, true, chip::NullOptional); } - case 17: { - LogStep(17, "Validate constraints of attribute: ColorLoopStartEnhancedHue"); - VerifyOrDo(!ShouldSkip("CC.S.A4005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 16: { + LogStep(16, "TH reads ColorLoopStartEnhancedHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4005 && CC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, true, chip::NullOptional); } - case 18: { - LogStep(18, "Validate constraints of attribute: ColorLoopStoredEnhancedHue"); - VerifyOrDo(!ShouldSkip("CC.S.A4006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 17: { + LogStep(17, "TH reads ColorLoopStoredEnhancedHue attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4006 && CC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, true, chip::NullOptional); } - case 19: { - LogStep(19, "read the optional global attribute: FeatureMap"); + case 18: { + LogStep(18, "TH reads FeatureMap attribute from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::FeatureMap::Id, true, chip::NullOptional); } - case 20: { - LogStep(20, "Reads ColorCapabilities attribute from DUT"); - VerifyOrDo(!ShouldSkip("CC.S.A400a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorCapabilities::Id, - true, chip::NullOptional); - } - case 21: { - LogStep(21, "Validate constraints of attribute: ColorCapabilities"); + case 19: { + LogStep(19, "TH reads ColorCapabilities attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A400a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorCapabilities::Id, true, chip::NullOptional); } - case 22: { - LogStep(22, "Reads ColorTempPhysicalMinMireds attribute from DUT"); - VerifyOrDo(!ShouldSkip("CC.S.A400b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, - ColorControl::Attributes::ColorTempPhysicalMinMireds::Id, true, chip::NullOptional); - } - case 23: { - LogStep(23, "Validate constraints of attribute: ColorTempPhysicalMinMireds"); - VerifyOrDo(!ShouldSkip("CC.S.A400b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 20: { + LogStep(20, "TH reads ColorTempPhysicalMinMireds attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A400b && CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTempPhysicalMinMireds::Id, true, chip::NullOptional); } - case 24: { - LogStep(24, "Read ColorTempPhysicalMaxMireds attribute from DUT"); - VerifyOrDo(!ShouldSkip("CC.S.A400c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, - ColorControl::Attributes::ColorTempPhysicalMaxMireds::Id, true, chip::NullOptional); - } - case 25: { - LogStep(25, "Validate constraints of attribute: ColorTempPhysicalMaxMireds"); - VerifyOrDo(!ShouldSkip("CC.S.A400c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 21: { + LogStep(21, "TH reads ColorTempPhysicalMaxMireds attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A400c && CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTempPhysicalMaxMireds::Id, true, chip::NullOptional); } - case 26: { - LogStep(26, "Read the optional attribute: CoupleColorTempToLevelMinMireds"); - VerifyOrDo(!ShouldSkip("CC.S.A400d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 22: { + LogStep(22, "TH reads CoupleColorTempToLevelMinMireds attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A400d && CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CoupleColorTempToLevelMinMireds::Id, true, chip::NullOptional); } - case 27: { - LogStep(27, "Read the optional attribute: StartUpColorTemperatureMireds"); - VerifyOrDo(!ShouldSkip("CC.S.A4010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 23: { + LogStep(23, "TH reads StartUpColorTemperatureMireds attribute from DUT"); + VerifyOrDo(!ShouldSkip("CC.S.A4010 && CC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::StartUpColorTemperatureMireds::Id, true, chip::NullOptional); } - case 28: { - LogStep(28, "Validate constraints of attribute: RemainingTime"); - VerifyOrDo(!ShouldSkip("CC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::RemainingTime::Id, - true, chip::NullOptional); - } - case 29: { - LogStep(29, "Read the optional attribute: DriftCompensation"); - VerifyOrDo(!ShouldSkip("CC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::DriftCompensation::Id, - true, chip::NullOptional); - } - case 30: { - LogStep(30, "Read the optional attribute: CompensationText"); - VerifyOrDo(!ShouldSkip("CC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CompensationText::Id, - true, chip::NullOptional); - } - case 31: { - LogStep(31, "Read the mandatory attribute: NumberOfPrimaries"); + case 24: { + LogStep(24, "TH reads NumberOfPrimaries attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::NumberOfPrimaries::Id, true, chip::NullOptional); } - case 32: { - LogStep(32, "Read the mandatory attribute: Primary1X"); + case 25: { + LogStep(25, "TH reads Primary1X attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary1X::Id, true, chip::NullOptional); } - case 33: { - LogStep(33, "Read the mandatory attribute: Primary1Y"); + case 26: { + LogStep(26, "TH reads Primary1Y attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary1Y::Id, true, chip::NullOptional); } - case 34: { - LogStep(34, "Read the mandatory attribute: Primary1Intensity"); + case 27: { + LogStep(27, "TH reads Primary1Intensity attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary1Intensity::Id, true, chip::NullOptional); } - case 35: { - LogStep(35, "Read the mandatory attribute: Primary2X"); + case 28: { + LogStep(28, "TH reads Primary2X attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary2X::Id, true, chip::NullOptional); } - case 36: { - LogStep(36, "Read the mandatory attribute: Primary2Y"); + case 29: { + LogStep(29, "TH reads Primary2Y attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary2Y::Id, true, chip::NullOptional); } - case 37: { - LogStep(37, "Validate constraints of attribute: Primary2Intensity"); + case 30: { + LogStep(30, "TH reads Primary2Intensity attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary2Intensity::Id, true, chip::NullOptional); } - case 38: { - LogStep(38, "Read the mandatory attribute: Primary3X"); + case 31: { + LogStep(31, "TH reads Primary3X attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0019"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary3X::Id, true, chip::NullOptional); } - case 39: { - LogStep(39, "Read the mandatory attribute: Primary3Y"); + case 32: { + LogStep(32, "TH reads Primary3Y attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A001a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary3Y::Id, true, chip::NullOptional); } - case 40: { - LogStep(40, "Read the mandatory attribute: Primary3Intensity"); + case 33: { + LogStep(33, "TH reads Primary3Intensity attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A001b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary3Intensity::Id, true, chip::NullOptional); } - case 41: { - LogStep(41, "Read the mandatory attribute: Primary4X"); + case 34: { + LogStep(34, "TH reads Primary4X attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0020"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary4X::Id, true, chip::NullOptional); } - case 42: { - LogStep(42, "Read the mandatory attribute: Primary4Y"); + case 35: { + LogStep(35, "TH reads Primary4Y attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary4Y::Id, true, chip::NullOptional); } - case 43: { - LogStep(43, "Read the mandatory attribute: Primary4Intensity"); + case 36: { + LogStep(36, "TH reads Primary4Intensity attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0022"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary4Intensity::Id, true, chip::NullOptional); } - case 44: { - LogStep(44, "Read the mandatory attribute: Primary5X"); + case 37: { + LogStep(37, "TH reads Primary5X attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0024"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary5X::Id, true, chip::NullOptional); } - case 45: { - LogStep(45, "Read the mandatory attribute: Primary5Y"); + case 38: { + LogStep(38, "TH reads Primary5Y attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0025"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary5Y::Id, true, chip::NullOptional); } - case 46: { - LogStep(46, "Read the mandatory attribute: Primary5Intensity"); + case 39: { + LogStep(39, "TH reads Primary5Intensity attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0026"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary5Intensity::Id, true, chip::NullOptional); } - case 47: { - LogStep(47, "Read the mandatory attribute: Primary6X"); + case 40: { + LogStep(40, "TH reads Primary6X attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0028"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary6X::Id, true, chip::NullOptional); } - case 48: { - LogStep(48, "Read the mandatory attribute: Primary6Y"); + case 41: { + LogStep(41, "TH reads Primary6Y attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0029"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary6Y::Id, true, chip::NullOptional); } - case 49: { - LogStep(49, "Read the mandatory attribute: Primary6Intensity"); + case 42: { + LogStep(42, "TH reads Primary6Intensity attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A002a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::Primary6Intensity::Id, true, chip::NullOptional); } - case 50: { - LogStep(50, "Read the optional attribute: WhitePointX"); + case 43: { + LogStep(43, "TH reads WhitePointX attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0030"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::WhitePointX::Id, true, chip::NullOptional); } - case 51: { - LogStep(51, "Read the optional attribute: WhitePointY"); + case 44: { + LogStep(44, "TH reads WhitePointY attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0031"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::WhitePointY::Id, true, chip::NullOptional); } - case 52: { - LogStep(52, "Read the optional attribute: ColorPointRX"); + case 45: { + LogStep(45, "TH reads ColorPointRX attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0032"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorPointRX::Id, true, chip::NullOptional); } - case 53: { - LogStep(53, "Read the optional attribute: ColorPointRY"); + case 46: { + LogStep(46, "TH reads ColorPointRY attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0033"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorPointRY::Id, true, chip::NullOptional); } - case 54: { - LogStep(54, "Read the optional attribute: ColorPointRIntensity"); + case 47: { + LogStep(47, "TH reads ColorPointRIntensity attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0034"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorPointRIntensity::Id, true, chip::NullOptional); } - case 55: { - LogStep(55, "Read the optional attribute: ColorPointGX"); + case 48: { + LogStep(48, "TH reads ColorPointGX attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0036"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorPointGX::Id, true, chip::NullOptional); } - case 56: { - LogStep(56, "Read the optional attribute: ColorPointGY"); + case 49: { + LogStep(49, "TH reads ColorPointGY attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0037"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorPointGY::Id, true, chip::NullOptional); } - case 57: { - LogStep(57, "Read the optional attribute: ColorPointGIntensity"); + case 50: { + LogStep(50, "TH reads ColorPointGIntensity attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A0038"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorPointGIntensity::Id, true, chip::NullOptional); } - case 58: { - LogStep(58, "Read the optional attribute: ColorPointBX"); + case 51: { + LogStep(51, "TH reads ColorPointBX attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A003a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorPointBX::Id, true, chip::NullOptional); } - case 59: { - LogStep(59, "Read the optional attribute: ColorPointBY"); + case 52: { + LogStep(52, "TH reads ColorPointBY attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A003b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorPointBY::Id, true, chip::NullOptional); } - case 60: { - LogStep(60, "Read the optional attribute: ColorPointBIntensity"); + case 53: { + LogStep(53, "TH reads ColorPointBIntensity attribute from DUT"); VerifyOrDo(!ShouldSkip("CC.S.A003c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorPointBIntensity::Id, true, chip::NullOptional); @@ -9725,7 +9622,7 @@ class Test_TC_CC_8_1Suite : public TestCommand class Test_TC_BINFO_2_1Suite : public TestCommand { public: - Test_TC_BINFO_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BINFO_2_1", 19, credsIssuerConfig) + Test_TC_BINFO_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BINFO_2_1", 66, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -9733,7 +9630,69 @@ class Test_TC_BINFO_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BINFO_2_1Suite() {} + ~Test_TC_BINFO_2_1Suite() + { + if (CountryCodeBuffer != nullptr) + { + chip::Platform::MemoryFree(CountryCodeBuffer); + CountryCodeBuffer = nullptr; + } + if (VendorNameValueBuffer != nullptr) + { + chip::Platform::MemoryFree(VendorNameValueBuffer); + VendorNameValueBuffer = nullptr; + } + if (ProductNameValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductNameValueBuffer); + ProductNameValueBuffer = nullptr; + } + if (NodeLabelValueBuffer != nullptr) + { + chip::Platform::MemoryFree(NodeLabelValueBuffer); + NodeLabelValueBuffer = nullptr; + } + if (HardwareVersionStringValueBuffer != nullptr) + { + chip::Platform::MemoryFree(HardwareVersionStringValueBuffer); + HardwareVersionStringValueBuffer = nullptr; + } + if (SoftwareVersionStringValueBuffer != nullptr) + { + chip::Platform::MemoryFree(SoftwareVersionStringValueBuffer); + SoftwareVersionStringValueBuffer = nullptr; + } + if (ManufacturingDateValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ManufacturingDateValueBuffer); + ManufacturingDateValueBuffer = nullptr; + } + if (PartNumberValueBuffer != nullptr) + { + chip::Platform::MemoryFree(PartNumberValueBuffer); + PartNumberValueBuffer = nullptr; + } + if (ProductURLValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductURLValueBuffer); + ProductURLValueBuffer = nullptr; + } + if (ProductLabelValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductLabelValueBuffer); + ProductLabelValueBuffer = nullptr; + } + if (SerialNumberValueBuffer != nullptr) + { + chip::Platform::MemoryFree(SerialNumberValueBuffer); + SerialNumberValueBuffer = nullptr; + } + if (UniqueIDValueBuffer != nullptr) + { + chip::Platform::MemoryFree(UniqueIDValueBuffer); + UniqueIDValueBuffer = nullptr; + } + } chip::System::Clock::Timeout GetWaitDuration() const override { @@ -9746,6 +9705,37 @@ class Test_TC_BINFO_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; + char * CountryCodeBuffer = nullptr; + chip::CharSpan CountryCode; + uint16_t DataModelRevisionValue; + char * VendorNameValueBuffer = nullptr; + chip::CharSpan VendorNameValue; + chip::VendorId VendorIDValue; + char * ProductNameValueBuffer = nullptr; + chip::CharSpan ProductNameValue; + uint16_t ProductIDValue; + char * NodeLabelValueBuffer = nullptr; + chip::CharSpan NodeLabelValue; + uint16_t HardwareVersionValue; + char * HardwareVersionStringValueBuffer = nullptr; + chip::CharSpan HardwareVersionStringValue; + uint32_t SoftwareVersionValue; + char * SoftwareVersionStringValueBuffer = nullptr; + chip::CharSpan SoftwareVersionStringValue; + char * ManufacturingDateValueBuffer = nullptr; + chip::CharSpan ManufacturingDateValue; + char * PartNumberValueBuffer = nullptr; + chip::CharSpan PartNumberValue; + char * ProductURLValueBuffer = nullptr; + chip::CharSpan ProductURLValue; + char * ProductLabelValueBuffer = nullptr; + chip::CharSpan ProductLabelValue; + char * SerialNumberValueBuffer = nullptr; + chip::CharSpan SerialNumberValue; + char * UniqueIDValueBuffer = nullptr; + chip::CharSpan UniqueIDValue; + chip::app::Clusters::Basic::Structs::CapabilityMinimaStruct::DecodableType CapabilityMinimaValue; + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } // @@ -9763,74 +9753,210 @@ class Test_TC_BINFO_2_1Suite : public TestCommand shouldContinue = true; break; case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (CountryCodeBuffer != nullptr) + { + chip::Platform::MemoryFree(CountryCodeBuffer); + } + CountryCodeBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(CountryCodeBuffer, value.data(), value.size()); + CountryCode = chip::CharSpan(CountryCodeBuffer, value.size()); + } + break; + case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + DataModelRevisionValue = value; } break; - case 2: + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("dataModelRevision", value, DataModelRevisionValue)); + } + break; + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 32)); + if (VendorNameValueBuffer != nullptr) + { + chip::Platform::MemoryFree(VendorNameValueBuffer); + } + VendorNameValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(VendorNameValueBuffer, value.data(), value.size()); + VendorNameValue = chip::CharSpan(VendorNameValueBuffer, value.size()); } break; - case 3: + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("vendorName", value, VendorNameValue)); + } + break; + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::VendorId value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65521U)); + VendorIDValue = value; } break; - case 4: + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorID", value, VendorIDValue)); + } + break; + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 32)); + if (ProductNameValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductNameValueBuffer); + } + ProductNameValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(ProductNameValueBuffer, value.data(), value.size()); + ProductNameValue = chip::CharSpan(ProductNameValueBuffer, value.size()); } break; - case 5: + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("productName", value, ProductNameValue)); + } + break; + case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + ProductIDValue = value; } break; - case 6: + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("productID", value, ProductIDValue)); + } + break; + case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 32)); + if (NodeLabelValueBuffer != nullptr) + { + chip::Platform::MemoryFree(NodeLabelValueBuffer); + } + NodeLabelValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(NodeLabelValueBuffer, value.data(), value.size()); + NodeLabelValue = chip::CharSpan(NodeLabelValueBuffer, value.size()); } break; - case 7: + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("newnode", 7))); + } + break; + case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("location", value, CountryCode)); VerifyOrReturn(CheckConstraintType("value", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 16)); } break; - case 8: + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("location", value, chip::CharSpan("in", 2))); + } + break; + case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + HardwareVersionValue = value; } break; - case 9: + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("hardwareVersion", value, HardwareVersionValue)); + } + break; + case 26: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; @@ -9838,70 +9964,304 @@ class Test_TC_BINFO_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "string")); VerifyOrReturn(CheckConstraintMinLength("value", value.size(), 1)); VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 64)); + if (HardwareVersionStringValueBuffer != nullptr) + { + chip::Platform::MemoryFree(HardwareVersionStringValueBuffer); + } + HardwareVersionStringValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(HardwareVersionStringValueBuffer, value.data(), value.size()); + HardwareVersionStringValue = chip::CharSpan(HardwareVersionStringValueBuffer, value.size()); } break; - case 10: + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("hardwareVersionString", value, HardwareVersionStringValue)); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967294UL)); + SoftwareVersionValue = value; + } + break; + case 30: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 11: + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("softwareVersion", value, SoftwareVersionValue)); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value", value.size(), 1)); + if (SoftwareVersionStringValueBuffer != nullptr) + { + chip::Platform::MemoryFree(SoftwareVersionStringValueBuffer); + } + SoftwareVersionStringValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(SoftwareVersionStringValueBuffer, value.data(), value.size()); + SoftwareVersionStringValue = chip::CharSpan(SoftwareVersionStringValueBuffer, value.size()); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("softwareVersionString", value, SoftwareVersionStringValue)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "string")); + VerifyOrReturn(CheckConstraintMinLength("value", value.size(), 8)); + VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 16)); + if (ManufacturingDateValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ManufacturingDateValueBuffer); + } + ManufacturingDateValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(ManufacturingDateValueBuffer, value.data(), value.size()); + ManufacturingDateValue = chip::CharSpan(ManufacturingDateValueBuffer, value.size()); + } + break; + case 37: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 12: + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("manufacturingDate", value, ManufacturingDateValue)); + } + break; + case 40: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 32)); + if (PartNumberValueBuffer != nullptr) + { + chip::Platform::MemoryFree(PartNumberValueBuffer); + } + PartNumberValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(PartNumberValueBuffer, value.data(), value.size()); + PartNumberValue = chip::CharSpan(PartNumberValueBuffer, value.size()); } break; - case 13: + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("partNumber", value, PartNumberValue)); + } + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 256)); + if (ProductURLValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductURLValueBuffer); + } + ProductURLValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(ProductURLValueBuffer, value.data(), value.size()); + ProductURLValue = chip::CharSpan(ProductURLValueBuffer, value.size()); + } + break; + case 44: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 14: + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("productURL", value, ProductURLValue)); + } + break; + case 47: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 64)); + if (ProductLabelValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductLabelValueBuffer); + } + ProductLabelValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(ProductLabelValueBuffer, value.data(), value.size()); + ProductLabelValue = chip::CharSpan(ProductLabelValueBuffer, value.size()); } break; - case 15: + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("productLabel", value, ProductLabelValue)); + } + break; + case 51: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 32)); + if (SerialNumberValueBuffer != nullptr) + { + chip::Platform::MemoryFree(SerialNumberValueBuffer); + } + SerialNumberValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(SerialNumberValueBuffer, value.data(), value.size()); + SerialNumberValue = chip::CharSpan(SerialNumberValueBuffer, value.size()); } break; - case 16: + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("serialNumber", value, SerialNumberValue)); + } + break; + case 54: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("localConfigDisabled", value, false)); VerifyOrReturn(CheckConstraintType("value", "", "boolean")); } break; - case 17: + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 56: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("localConfigDisabled", value, true)); + } + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("reachable", value, true)); VerifyOrReturn(CheckConstraintType("value", "", "boolean")); } break; - case 18: + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 59: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 32)); + if (UniqueIDValueBuffer != nullptr) + { + chip::Platform::MemoryFree(UniqueIDValueBuffer); + } + UniqueIDValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(UniqueIDValueBuffer, value.data(), value.size()); + UniqueIDValue = chip::CharSpan(UniqueIDValueBuffer, value.size()); + } + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("uniqueID", value, UniqueIDValue)); + } + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Basic::Structs::CapabilityMinimaStruct::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + CapabilityMinimaValue = value; + } + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 64: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Basic::Structs::CapabilityMinimaStruct::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); } break; default: @@ -9927,62 +10287,210 @@ class Test_TC_BINFO_2_1Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Query Data Model Revision"); + LogStep(1, "TH reads Location from the DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::Location::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads DataModelRevision from the DUT."); VerifyOrDo(!ShouldSkip("BINFO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::DataModelRevision::Id, true, chip::NullOptional); } - case 2: { - LogStep(2, "Query Vendor Name"); + case 3: { + LogStep(3, "TH writes DataModelRevision from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint16_t value; + value = 4388U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::DataModelRevision::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads DataModelRevision from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::DataModelRevision::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads VendorName from the DUT."); VerifyOrDo(!ShouldSkip("BINFO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::VendorName::Id, true, chip::NullOptional); } - case 3: { - LogStep(3, "Query VendorID"); + case 6: { + LogStep(6, "TH writes VendorName from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("samplegarbage: not in length on purpose", 6); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::VendorName::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads VendorName from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::VendorName::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads VendorID from the DUT."); VerifyOrDo(!ShouldSkip("BINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::VendorID::Id, true, chip::NullOptional); } - case 4: { - LogStep(4, "Query Product Name"); + case 9: { + LogStep(9, "TH writes VendorID from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::VendorId value; + value = static_cast(17); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::VendorID::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads VendorID from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::VendorID::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads ProductName from the DUT"); VerifyOrDo(!ShouldSkip("BINFO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::ProductName::Id, true, chip::NullOptional); } - case 5: { - LogStep(5, "Query ProductID"); + case 12: { + LogStep(12, "TH writes ProductName from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newproductgarbage: not in length on purpose", 10); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::ProductName::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, "TH reads ProductName from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::ProductName::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "TH reads ProductID from the DUT."); VerifyOrDo(!ShouldSkip("BINFO.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::ProductID::Id, true, chip::NullOptional); } - case 6: { - LogStep(6, "Query Node Label"); + case 15: { + LogStep(15, "TH writes ProductID from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint16_t value; + value = 17697U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::ProductID::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 16: { + LogStep(16, "TH reads ProductID from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::ProductID::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "TH reads NodeLabel from the DUT"); VerifyOrDo(!ShouldSkip("BINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, true, chip::NullOptional); } - case 7: { - LogStep(7, "Query User Location"); + case 18: { + LogStep(18, "TH writes NodeLabel from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newnodegarbage: not in length on purpose", 7); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 19: { + LogStep(19, "TH reads NodeLabel from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, "TH reads Location from the DUT."); VerifyOrDo(!ShouldSkip("BINFO.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::Location::Id, true, chip::NullOptional); } - case 8: { - LogStep(8, "Query HardwareVersion"); + case 21: { + LogStep(21, "TH write Location from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("ingarbage: not in length on purpose", 2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::Location::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 22: { + LogStep(22, "TH reads Location from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::Location::Id, true, + chip::NullOptional); + } + case 23: { + LogStep(23, "TH reads HardwareVersion from the DUT"); VerifyOrDo(!ShouldSkip("BINFO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::HardwareVersion::Id, true, chip::NullOptional); } - case 9: { - LogStep(9, "Query HardwareVersionString"); + case 24: { + LogStep(24, "TH writes HardwareVersion from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint16_t value; + value = 17713U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::HardwareVersion::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 25: { + LogStep(25, "TH reads HardwareVersion from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::HardwareVersion::Id, true, + chip::NullOptional); + } + case 26: { + LogStep(26, "TH reads HardwareVersionString from the DUT."); VerifyOrDo(!ShouldSkip("BINFO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::HardwareVersionString::Id, true, chip::NullOptional); } - case 10: { - LogStep(10, "TH reads SoftwareVersionString from the DUT and Verify it is of type string and verify the format"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BINFO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 27: { + LogStep(27, "TH writes HardwareVersionString from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newhardwareversiongarbage: not in length on purpose", 18); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::HardwareVersionString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 28: { + LogStep(28, "TH reads HardwareVersionString from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::HardwareVersionString::Id, true, + chip::NullOptional); + } + case 29: { + LogStep(29, "TH reads SoftwareVersion from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::SoftwareVersion::Id, true, + chip::NullOptional); + } + case 30: { + LogStep(30, + "Verify that the SoftwareVersion is not displayed to the end-user through any device specific means (ex: " + "screen, audio)"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); @@ -9990,8 +10498,50 @@ class Test_TC_BINFO_2_1Suite : public TestCommand value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt(kIdentityAlpha, value); } - case 11: { - LogStep(11, "TH reads ManufacturingDate from the DUT and Verify it is of type string and verify the format"); + case 31: { + LogStep(31, "TH writes SoftwareVersion from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint32_t value; + value = 33299UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::SoftwareVersion::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 32: { + LogStep(32, "TH reads SoftwareVersion from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::SoftwareVersion::Id, true, + chip::NullOptional); + } + case 33: { + LogStep(33, "TH reads SoftwareVersionString from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::SoftwareVersionString::Id, true, + chip::NullOptional); + } + case 34: { + LogStep(34, "TH writes SoftwareVersionString from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("1.0garbage: not in length on purpose", 3); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::SoftwareVersionString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 35: { + LogStep(35, "TH reads SoftwareVersionString from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::SoftwareVersionString::Id, true, + chip::NullOptional); + } + case 36: { + LogStep(36, "TH reads ManufacturingDate from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::ManufacturingDate::Id, true, + chip::NullOptional); + } + case 37: { + LogStep(37, "Verify if the first 8 characters specify date according to ISO 8601, i.e, YYYYMMDD"); VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; @@ -10000,14 +10550,52 @@ class Test_TC_BINFO_2_1Suite : public TestCommand value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt(kIdentityAlpha, value); } - case 12: { - LogStep(12, "Query PartNumber"); + case 38: { + LogStep(38, "TH writes ManufacturingDate from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("20210814789452INgarbage: not in length on purpose", 16); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::ManufacturingDate::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 39: { + LogStep(39, "TH reads ManufacturingDate from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::ManufacturingDate::Id, true, + chip::NullOptional); + } + case 40: { + LogStep(40, "TH reads PartNumber from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000c && PART_NUM"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::PartNumber::Id, true, + chip::NullOptional); + } + case 41: { + LogStep(41, "TH writes PartNumber from the DUT."); VerifyOrDo(!ShouldSkip("BINFO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newpartgarbage: not in length on purpose", 7); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::PartNumber::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 42: { + LogStep(42, "TH reads PartNumber from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000c && PART_NUM"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::PartNumber::Id, true, chip::NullOptional); } - case 13: { - LogStep(13, "TH reads ProductURL from the DUT and Verify it is of type string and verify the format"); + case 43: { + LogStep(43, "TH reads ProductURL from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::ProductURL::Id, true, + chip::NullOptional); + } + case 44: { + LogStep(44, + "Verify that it specifies a link to a specific web page, Verify that it follows the syntax rules specified in " + "RFC 3986."); VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; @@ -10016,36 +10604,165 @@ class Test_TC_BINFO_2_1Suite : public TestCommand value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt(kIdentityAlpha, value); } - case 14: { - LogStep(14, "Query ProductLabel"); + case 45: { + LogStep(45, "TH writes ProductURL from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("https://www.example.comgarbage: not in length on purpose", 23); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::ProductURL::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 46: { + LogStep(46, "TH reads ProductURL from the DUT"); + VerifyOrDo(!ShouldSkip("BINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::ProductURL::Id, true, + chip::NullOptional); + } + case 47: { + LogStep(47, "TH reads ProductLabel from the DUT."); VerifyOrDo(!ShouldSkip("BINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::ProductLabel::Id, true, chip::NullOptional); } - case 15: { - LogStep(15, "Query SerialNumber"); + case 48: { + LogStep(48, "Verify that it does not include the name of the vendor as defined within the VendorName attribute"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 49: { + LogStep(49, "TH writes ProductLabel from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newproductlabelgarbage: not in length on purpose", 15); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::ProductLabel::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 50: { + LogStep(50, "TH reads ProductLabel from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::ProductLabel::Id, true, + chip::NullOptional); + } + case 51: { + LogStep(51, "TH reads SerialNumber from the DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::SerialNumber::Id, true, + chip::NullOptional); + } + case 52: { + LogStep(52, "TH writes SerialNumber from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newserialnumbergarbage: not in length on purpose", 15); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::SerialNumber::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 53: { + LogStep(53, "TH reads SerialNumber from the DUT."); VerifyOrDo(!ShouldSkip("BINFO.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::SerialNumber::Id, true, chip::NullOptional); } - case 16: { - LogStep(16, "Query LocalConfigDisabled"); + case 54: { + LogStep(54, "TH reads LocalConfigDisabled from the DUT."); VerifyOrDo(!ShouldSkip("BINFO.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id, true, chip::NullOptional); } - case 17: { - LogStep(17, "Query Reachable"); + case 55: { + LogStep(55, "TH sets LocalConfigDisabled to True"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + bool value; + value = true; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 56: { + LogStep(56, "TH reads LocalConfigDisabled from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id, true, + chip::NullOptional); + } + case 57: { + LogStep(57, "TH reads Reachable from the DUT."); VerifyOrDo(!ShouldSkip("BINFO.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::Reachable::Id, true, chip::NullOptional); } - case 18: { - LogStep(18, "Query UniqueID"); + case 58: { + LogStep(58, "TH sends Write request message to DUT to change value of Reachable to false"); + VerifyOrDo(!ShouldSkip("BINFO.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + bool value; + value = false; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::Reachable::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 59: { + LogStep(59, "TH reads UniqueID from the DUT."); VerifyOrDo(!ShouldSkip("BINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::UniqueID::Id, true, chip::NullOptional); } + case 60: { + LogStep(60, "TH writes UniqueID from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newidgarbage: not in length on purpose", 5); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::UniqueID::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 61: { + LogStep(61, "TH reads UniqueID from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::UniqueID::Id, true, + chip::NullOptional); + } + case 62: { + LogStep(62, "TH reads CapabilityMinima attribute from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::CapabilityMinima::Id, true, + chip::NullOptional); + } + case 63: { + LogStep(63, + "Step 56 is implicitly validating the attribute(CapabilityMinima) constraints, as long as the payload is being " + "parsed successfully"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BINFO.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 64: { + LogStep(64, "TH writes CapabilityMinima from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::Basic::Structs::CapabilityMinimaStruct::Type value; + + value.caseSessionsPerFabric = 4U; + value.subscriptionsPerFabric = 4U; + + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::CapabilityMinima::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 65: { + LogStep(65, "TH reads CapabilityMinima attribute from the DUT."); + VerifyOrDo(!ShouldSkip("BINFO.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::CapabilityMinima::Id, true, + chip::NullOptional); + } } return CHIP_NO_ERROR; } @@ -10747,29 +11464,16 @@ class Test_TC_FLW_1_1Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); - VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); - VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); - VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); - VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 3UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); - VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65528UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); - VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 65529UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); - VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 65531UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 7)); - VerifyOrReturn(CheckValue("attributeList[7]", iter_0.GetValue(), 65532UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 8)); - VerifyOrReturn(CheckValue("attributeList[8]", iter_0.GetValue(), 65533UL)); - VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 9)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); } break; case 5: @@ -11076,17 +11780,10 @@ class Test_TC_CGEN_1_1Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); - VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 2UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 2)); - VerifyOrReturn(CheckValue("acceptedCommandList[2]", iter_0.GetValue(), 4UL)); - VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 3)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); } break; case 5: @@ -11094,17 +11791,10 @@ class Test_TC_CGEN_1_1Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 1UL)); - VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 1)); - VerifyOrReturn(CheckValue("generatedCommandList[1]", iter_0.GetValue(), 3UL)); - VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 2)); - VerifyOrReturn(CheckValue("generatedCommandList[2]", iter_0.GetValue(), 5UL)); - VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 3)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); } break; case 6: @@ -11177,7 +11867,7 @@ class Test_TC_CGEN_1_1Suite : public TestCommand class Test_TC_CGEN_2_1Suite : public TestCommand { public: - Test_TC_CGEN_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CGEN_2_1", 9, credsIssuerConfig) + Test_TC_CGEN_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CGEN_2_1", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -11259,10 +11949,6 @@ class Test_TC_CGEN_2_1Suite : public TestCommand } break; case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -11334,19 +12020,7 @@ class Test_TC_CGEN_2_1Suite : public TestCommand GeneralCommissioning::Attributes::BasicCommissioningInfo::Id, true, chip::NullOptional); } case 7: { - LogStep(7, - "Step 6 is implicitly validating the attribute(BasicCommissioningInfo) constraints, as long as the payload is " - "being parsed successfully"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); - } - case 8: { - LogStep(8, "TH1 reads SupportsConcurrentConnection attribute from the DUT"); + LogStep(7, "TH1 reads SupportsConcurrentConnection attribute from the DUT"); VerifyOrDo(!ShouldSkip("CGEN.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), GeneralCommissioning::Id, GeneralCommissioning::Attributes::SupportsConcurrentConnection::Id, true, chip::NullOptional); @@ -11434,13 +12108,8 @@ class Test_TC_DGGEN_1_1Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); - VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 1)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); } break; case 5: @@ -11793,7 +12462,7 @@ class Test_TC_DGGEN_2_1Suite : public TestCommand class Test_TC_I_1_1Suite : public TestCommand { public: - Test_TC_I_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_1_1", 7, credsIssuerConfig) + Test_TC_I_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_1_1", 8, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -11868,18 +12537,21 @@ class Test_TC_I_1_1Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); - VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 64UL)); - VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 2)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); } break; case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 64UL)); + } + break; + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -11891,7 +12563,7 @@ class Test_TC_I_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 6: + case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; @@ -11934,16 +12606,23 @@ class Test_TC_I_1_1Suite : public TestCommand } case 4: { LogStep(4, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip(" !I.C.C40.Tx "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 5: { - LogStep(5, "Read the global attribute: GeneratedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::GeneratedCommandList::Id, true, + LogStep(5, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("I.C.C40.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 6: { - LogStep(6, + LogStep(6, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -13185,7 +13864,6 @@ class Test_TC_LVL_2_1Suite : public TestCommand { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("currentLevel", value, 254U)); VerifyOrReturn(CheckConstraintType("value", "", "uint8")); CurrentLevelValue = value; } @@ -13195,7 +13873,6 @@ class Test_TC_LVL_2_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("remainingTime", value, 0U)); VerifyOrReturn(CheckConstraintType("value", "", "uint16")); } break; @@ -13206,8 +13883,6 @@ class Test_TC_LVL_2_1Suite : public TestCommand VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("minLevel", value, 1U)); VerifyOrReturn(CheckConstraintType("value", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); MinLevelValue = value; } break; @@ -13229,8 +13904,7 @@ class Test_TC_LVL_2_1Suite : public TestCommand VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("maxLevel", value, 254U)); VerifyOrReturn(CheckConstraintType("value", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinLevelValue)); MaxLevelValue = value; } break; @@ -13240,7 +13914,7 @@ class Test_TC_LVL_2_1Suite : public TestCommand uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinLevelValue1)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); MaxLevelValue1 = value; } @@ -13427,25 +14101,25 @@ class Test_TC_LVL_2_1Suite : public TestCommand } case 5: { LogStep(5, "Reads the MinLevel attribute"); - VerifyOrDo(!ShouldSkip("LVL.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("LVL.S.A0002 && LVL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MinLevel::Id, true, chip::NullOptional); } case 6: { LogStep(6, "Reads the MinLevel attribute"); - VerifyOrDo(!ShouldSkip("LVL.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("LVL.S.A0002 && !LVL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MinLevel::Id, true, chip::NullOptional); } case 7: { LogStep(7, "Reads the MaxLevel attribute"); - VerifyOrDo(!ShouldSkip("LVL.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("LVL.S.A0003 && LVL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MaxLevel::Id, true, chip::NullOptional); } case 8: { LogStep(8, "Reads the MaxLevel attribute"); - VerifyOrDo(!ShouldSkip("LVL.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("LVL.S.A0003 && !LVL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MaxLevel::Id, true, chip::NullOptional); } @@ -13481,7 +14155,7 @@ class Test_TC_LVL_2_1Suite : public TestCommand } case 14: { LogStep(14, "Step 7b & 7C Reads the CurrentFrequency attribute"); - VerifyOrDo(!ShouldSkip("LVL.S.A0004 && LVL.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("LVL.S.A0004 && LVL.S.A0005 && LVL.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentFrequency::Id, true, chip::NullOptional); } @@ -13493,13 +14167,13 @@ class Test_TC_LVL_2_1Suite : public TestCommand } case 16: { LogStep(16, "Reads the OnLevel attribute "); - VerifyOrDo(!ShouldSkip("LVL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("LVL.S.F01 && LVL.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnLevel::Id, true, chip::NullOptional); } case 17: { LogStep(17, "Reads the OnLevel attribute "); - VerifyOrDo(!ShouldSkip(" !LVL.S.F01 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("LVL.S.A0011 && !LVL.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::OnLevel::Id, true, chip::NullOptional); } @@ -13892,7 +14566,7 @@ class Test_TC_LVL_2_2Suite : public TestCommand class Test_TC_LVL_3_1Suite : public TestCommand { public: - Test_TC_LVL_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_3_1", 19, credsIssuerConfig) + Test_TC_LVL_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_3_1", 18, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -13913,6 +14587,8 @@ class Test_TC_LVL_3_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; + uint16_t OnOffTransitionTimeValue; + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } // @@ -13977,20 +14653,12 @@ class Test_TC_LVL_3_1Suite : public TestCommand break; case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); - } break; case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 12: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -13998,22 +14666,23 @@ class Test_TC_LVL_3_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentLevel", value, 128U)); } break; - case 13: + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + OnOffTransitionTimeValue = value; } break; - case 14: + case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 15: + case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 16: + case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -14021,319 +14690,6 @@ class Test_TC_LVL_3_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentLevel", value, 64U)); } break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - case 0: { - LogStep(0, "Wait for the commissioned device to be retrieved"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee(kIdentityAlpha, value); - } - case 1: { - LogStep(1, "Reads the MinLevel attribute"); - VerifyOrDo(!ShouldSkip("LVL.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MinLevel::Id, true, - chip::NullOptional); - } - case 2: { - LogStep(2, "Reads the MaxLevel attribute"); - VerifyOrDo(!ShouldSkip("LVL.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MaxLevel::Id, true, - chip::NullOptional); - } - case 3: { - LogStep(3, "sends a Move to level command"); - VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; - value.level = 64U; - value.transitionTime = 0U; - value.optionMask = 1U; - value.optionOverride = 1U; - return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, - chip::NullOptional - - ); - } - case 4: { - LogStep(4, "Wait 100ms"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 100UL; - return WaitForMs(kIdentityAlpha, value); - } - case 5: { - LogStep(5, "Reads CurrentLevel attribute from DUT"); - VerifyOrDo(!ShouldSkip("LVL.S.C04.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, - chip::NullOptional); - } - case 6: { - LogStep(6, "sends a Move to level command"); - VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; - value.level = 100U; - value.transitionTime = 0U; - value.optionMask = 1U; - value.optionOverride = 1U; - return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, - chip::NullOptional - - ); - } - case 7: { - LogStep(7, "Wait 100 second"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 100UL; - return WaitForMs(kIdentityAlpha, value); - } - case 8: { - LogStep(8, "Reads CurrentLevel attribute from DUT"); - VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, - chip::NullOptional); - } - case 9: { - LogStep(9, "Reads On Off Transition Time attribute from DUT"); - VerifyOrDo(!ShouldSkip("LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, - LevelControl::Attributes::OnOffTransitionTime::Id, true, chip::NullOptional); - } - case 10: { - LogStep(10, "sends a Move to level command"); - VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; - value.level = 128U; - value.transitionTime = 100U; - value.optionMask = 1U; - value.optionOverride = 1U; - return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, - chip::NullOptional - - ); - } - case 11: { - LogStep(11, "Wait 11000ms"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 11000UL; - return WaitForMs(kIdentityAlpha, value); - } - case 12: { - LogStep(12, "Reads CurrentLevel attribute from DUT"); - VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, - chip::NullOptional); - } - case 13: { - LogStep(13, "Reads the OnOffTransitionTime attribute from the DUT"); - VerifyOrDo(!ShouldSkip("LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, - LevelControl::Attributes::OnOffTransitionTime::Id, true, chip::NullOptional); - } - case 14: { - LogStep(14, "sends a Move to level command"); - VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; - value.level = 64U; - value.transitionTime = 0U; - value.optionMask = 1U; - value.optionOverride = 1U; - return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, - chip::NullOptional - - ); - } - case 15: { - LogStep(15, "Wait 1000ms"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 1000UL; - return WaitForMs(kIdentityAlpha, value); - } - case 16: { - LogStep(16, "Reads CurrentLevel attribute from DUT"); - VerifyOrDo(!ShouldSkip("LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, - chip::NullOptional); - } - case 17: { - LogStep(17, "Reset level to 254"); - VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; - value.level = 254U; - value.transitionTime = 0U; - value.optionMask = 1U; - value.optionOverride = 1U; - return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, - chip::NullOptional - - ); - } - case 18: { - LogStep(18, "Wait 100ms"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 100UL; - return WaitForMs(kIdentityAlpha, value); - } - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_LVL_4_1Suite : public TestCommand -{ -public: - Test_TC_LVL_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_4_1", 18, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_LVL_4_1Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - uint8_t MinlevelValue; - uint8_t MaxlevelValue; - chip::app::DataModel::Nullable DefaultMoveRateValue; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint8_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint8")); - MinlevelValue = value; - } - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint8_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint8")); - MaxlevelValue = value; - } - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint8_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("currentLevel", value, MaxlevelValue)); - } - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint8_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("currentLevel", value, MinlevelValue)); - VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); - } - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::Nullable value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint8")); - DefaultMoveRateValue = value; - } - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; @@ -14364,17 +14720,48 @@ class Test_TC_LVL_4_1Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Reads Minlevel attribute from DUT"); + LogStep(1, "Reads the MinLevel attribute"); VerifyOrDo(!ShouldSkip("LVL.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MinLevel::Id, true, chip::NullOptional); } case 2: { - LogStep(2, "sends a Move to level command"); + LogStep(2, "Reads the MaxLevel attribute"); + VerifyOrDo(!ShouldSkip("LVL.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MaxLevel::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "sends a MoveToLevelWithOnOff command"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Type value; + value.level = 64U; + value.transitionTime = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevelWithOnOff::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 5: { + LogStep(5, "Reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C04.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "sends a Move to level command"); VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; - value.level = 1U; + value.level = 100U; value.transitionTime = 0U; value.optionMask = 1U; value.optionOverride = 1U; @@ -14383,6 +14770,278 @@ class Test_TC_LVL_4_1Suite : public TestCommand ); } + case 7: { + LogStep(7, "Wait 100 second"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "sends a Move to level command"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 128U; + value.transitionTime = 100U; + value.optionMask = 1U; + value.optionOverride = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Wait 11000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 11000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Reads the OnOffTransitionTime attribute from the DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, + LevelControl::Attributes::OnOffTransitionTime::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "sends a Move to level command"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 64U; + value.transitionTime = 65535U; + value.optionMask = 1U; + value.optionOverride = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Wait 1000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 1000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 15: { + LogStep(15, "Reads CurrentLevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Reset level to 254"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type value; + value.level = 254U; + value.transitionTime = 0U; + value.optionMask = 1U; + value.optionOverride = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevel::Id, value, + chip::NullOptional + + ); + } + case 17: { + LogStep(17, "Wait 100ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 100UL; + return WaitForMs(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LVL_4_1Suite : public TestCommand +{ +public: + Test_TC_LVL_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_4_1", 18, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_LVL_4_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint8_t MinlevelValue; + uint8_t MaxlevelValue; + chip::app::DataModel::Nullable DefaultMoveRateValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + MinlevelValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + MaxlevelValue = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentLevel", value, MaxlevelValue)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentLevel", value, MinlevelValue)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + DefaultMoveRateValue = value; + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Reads Minlevel attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::MinLevel::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "sends a MoveToLevelWithOnOff command"); + VerifyOrDo(!ShouldSkip("LVL.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Type value; + value.level = 1U; + value.transitionTime = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::MoveToLevelWithOnOff::Id, + value, chip::NullOptional + + ); + } case 3: { LogStep(3, "reads max level attribute from DUT"); VerifyOrDo(!ShouldSkip("LVL.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); @@ -14842,8 +15501,8 @@ class Test_TC_LVL_6_1Suite : public TestCommand { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value", value, 23U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 27U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 22U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 28U)); VerifyOrReturn(CheckConstraintNotValue("value", value, CurrentLevelValue)); } break; @@ -14866,8 +15525,8 @@ class Test_TC_LVL_6_1Suite : public TestCommand { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value", value, 48U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 52U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 45U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 55U)); VerifyOrReturn(CheckConstraintNotValue("value", value, CurrentLevelValue)); } break; @@ -14950,8 +15609,8 @@ class Test_TC_LVL_6_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("LVL.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LevelControl::Commands::Stop::Type value; - value.optionMask = 0U; - value.optionOverride = 0U; + value.optionMask = 1U; + value.optionOverride = 1U; return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::Stop::Id, value, chip::NullOptional @@ -14999,8 +15658,8 @@ class Test_TC_LVL_6_1Suite : public TestCommand LogStep(11, "Sends stop command to DUT"); ListFreer listFreer; chip::app::Clusters::LevelControl::Commands::Stop::Type value; - value.optionMask = 0U; - value.optionOverride = 0U; + value.optionMask = 1U; + value.optionOverride = 1U; return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::Stop::Id, value, chip::NullOptional @@ -15288,21 +15947,12 @@ class Test_TC_KEYPADINPUT_1_2Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); - VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 65528UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); - VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 65529UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); - VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65531UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); - VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65532UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); - VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65533UL)); - VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 5)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); } break; case 4: @@ -15310,13 +15960,8 @@ class Test_TC_KEYPADINPUT_1_2Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); - VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 1)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); } break; case 5: @@ -15324,13 +15969,8 @@ class Test_TC_KEYPADINPUT_1_2Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 1UL)); - VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); } break; case 6: @@ -15479,17 +16119,10 @@ class Test_TC_APPLAUNCHER_1_3Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); - VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 1UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 2)); - VerifyOrReturn(CheckValue("acceptedCommandList[2]", iter_0.GetValue(), 2UL)); - VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 3)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); } break; case 5: @@ -15497,13 +16130,8 @@ class Test_TC_APPLAUNCHER_1_3Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 3UL)); - VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; case 6: @@ -15653,19 +16281,11 @@ class Test_TC_MEDIAINPUT_1_4Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); - VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 1UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 2)); - VerifyOrReturn(CheckValue("acceptedCommandList[2]", iter_0.GetValue(), 2UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 3)); - VerifyOrReturn(CheckValue("acceptedCommandList[3]", iter_0.GetValue(), 3UL)); - VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 4)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; case 5: @@ -15991,17 +16611,10 @@ class Test_TC_CHANNEL_1_6Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); - VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 2UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 2)); - VerifyOrReturn(CheckValue("acceptedCommandList[2]", iter_0.GetValue(), 3UL)); - VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 3)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; case 5: @@ -16172,13 +16785,8 @@ class Test_TC_MEDIAPLAYBACK_1_7Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 10UL)); - VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); } break; case 6: @@ -16475,25 +17083,14 @@ class Test_TC_TGTNAV_1_9Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); - VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); - VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); - VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65528UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); - VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65529UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); - VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65531UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); - VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 65532UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); - VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 65533UL)); - VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 7)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); } break; case 4: @@ -16501,23 +17098,13 @@ class Test_TC_TGTNAV_1_9Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); - VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); - VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 65528UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); - VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65529UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); - VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65531UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); - VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65532UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); - VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 65533UL)); - VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 6)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); } break; case 5: @@ -16525,13 +17112,8 @@ class Test_TC_TGTNAV_1_9Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); - VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 1)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); } break; case 6: @@ -16539,13 +17121,8 @@ class Test_TC_TGTNAV_1_9Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 1UL)); - VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); } break; case 7: @@ -16592,7 +17169,7 @@ class Test_TC_TGTNAV_1_9Suite : public TestCommand } case 4: { LogStep(4, "Read the global attribute: AttributeList"); - VerifyOrDo(!ShouldSkip("!MC_TGTNAV.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip(" !MC_TGTNAV.S.A0001 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TargetNavigator::Id, TargetNavigator::Attributes::AttributeList::Id, true, chip::NullOptional); } @@ -16879,13 +17456,8 @@ class Test_TC_CONTENTLAUNCHER_1_11Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 2UL)); - VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); } break; case 6: @@ -17023,21 +17595,12 @@ class Test_TC_ALOGIN_1_12Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); - VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 65528UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); - VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 65529UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); - VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 65531UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); - VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 65532UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); - VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 65533UL)); - VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 5)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); } break; case 4: @@ -17045,17 +17608,10 @@ class Test_TC_ALOGIN_1_12Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); - VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 2UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 2)); - VerifyOrReturn(CheckValue("acceptedCommandList[2]", iter_0.GetValue(), 3UL)); - VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 3)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; case 5: @@ -17063,13 +17619,8 @@ class Test_TC_ALOGIN_1_12Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("generatedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("generatedCommandList[0]", iter_0.GetValue(), 1UL)); - VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 1)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); } break; case 6: @@ -20686,13 +21237,8 @@ class Test_TC_MOD_1_1Suite : public TestCommand { chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); - VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 1)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); } break; case 5: @@ -21927,7 +22473,7 @@ class Test_TC_OCC_2_1Suite : public TestCommand class Test_TC_OO_1_1Suite : public TestCommand { public: - Test_TC_OO_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OO_1_1", 7, credsIssuerConfig) + Test_TC_OO_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OO_1_1", 9, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -22003,28 +22549,43 @@ class Test_TC_OO_1_1Suite : public TestCommand case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 0)); - VerifyOrReturn(CheckValue("acceptedCommandList[0]", iter_0.GetValue(), 0UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 1)); - VerifyOrReturn(CheckValue("acceptedCommandList[1]", iter_0.GetValue(), 1UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 2)); - VerifyOrReturn(CheckValue("acceptedCommandList[2]", iter_0.GetValue(), 2UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 3)); - VerifyOrReturn(CheckValue("acceptedCommandList[3]", iter_0.GetValue(), 64UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 4)); - VerifyOrReturn(CheckValue("acceptedCommandList[4]", iter_0.GetValue(), 65UL)); - VerifyOrReturn(CheckNextListItemDecodes("acceptedCommandList", iter_0, 5)); - VerifyOrReturn(CheckValue("acceptedCommandList[5]", iter_0.GetValue(), 66UL)); - VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 6)); - } VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); } break; case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 64UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 66UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -22036,7 +22597,7 @@ class Test_TC_OO_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 6: + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; @@ -22069,28 +22630,41 @@ class Test_TC_OO_1_1Suite : public TestCommand } case 2: { LogStep(2, "read the optional global attribute: FeatureMap"); - VerifyOrDo(!ShouldSkip("OO_LT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("OO.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::FeatureMap::Id, true, chip::NullOptional); } case 3: { LogStep(3, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("OO.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::AttributeList::Id, true, chip::NullOptional); } case 4: { - LogStep(4, "Read the global attribute: AcceptedCommandList"); - VerifyOrDo(!ShouldSkip("OO_LT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::AcceptedCommandList::Id, true, + LogStep(4, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip(" !OO.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::AttributeList::Id, true, chip::NullOptional); } case 5: { - LogStep(5, "Read the global attribute: GeneratedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::GeneratedCommandList::Id, true, + LogStep(5, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("OO.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 6: { - LogStep(6, + LogStep(6, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip(" !OO.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Read EventList attribute from the DUT and Verify that the DUT response provides a list of supported events."); VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -27238,8 +27812,6 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand } case 2: { LogStep(2, "Read the optional global attribute constraints: FeatureMap"); - VerifyOrDo(!ShouldSkip("( TSTAT_HEAT || TSTAT_COOL || TSTAT_OCC || TSTAT_SCH || TSTAT_SB || TSTAT_AUTO )"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::FeatureMap::Id, true, chip::NullOptional); } @@ -27324,14 +27896,22 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - int16_t value; + chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 700)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); } break; case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } + break; + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -27341,11 +27921,17 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); } break; - case 4: - if (IsUnsupported(status.mStatus)) + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - return; + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 700)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); } + break; + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -27355,11 +27941,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); } break; - case 5: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -27369,19 +27951,47 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); } break; - case 6: + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 100U)); + } + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "map8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 63U)); + } break; - case 7: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 8: - if (IsUnsupported(status.mStatus)) { - return; + int8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "int8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 25)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, -25)); } + break; + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -27391,7 +28001,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 2600)); } break; - case 9: + case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -27401,25 +28011,31 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 2600)); } break; - case 10: + case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "int16")); + } break; - case 11: + case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "int16")); + } break; - case 12: + case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 700)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); } break; - case 13: + case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -27429,11 +28045,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); } break; - case 14: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -27443,11 +28055,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); } break; - case 15: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -27457,59 +28065,45 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); } break; - case 16: + case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::Clusters::Thermostat::ThermostatControlSequence value; + int8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 5U)); + VerifyOrReturn(CheckConstraintType("value", "", "int8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 25)); } break; - case 17: + case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "enum8")); + VerifyOrReturn(CheckConstraintType("value", "", "map8")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); } break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; case 22: - if (IsUnsupported(status.mStatus)) - { - return; - } VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - int8_t value; + chip::app::Clusters::Thermostat::ThermostatControlSequence value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "int8")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 25)); + VerifyOrReturn(CheckConstraintType("value", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 5U)); } break; case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 9U)); + } break; case 24: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -27517,13 +28111,15 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand break; case 25: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 26: - if (IsUnsupported(status.mStatus)) { - return; + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); } + break; + case 26: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -27534,10 +28130,6 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand } break; case 27: - if (IsUnsupported(status.mStatus)) - { - return; - } VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -27546,10 +28138,6 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand } break; case 28: - if (IsUnsupported(status.mStatus)) - { - return; - } VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -27559,91 +28147,198 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand break; case 29: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1U)); + } break; case 30: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1440U)); + } break; case 31: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "map8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } break; case 32: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "map16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 127U)); + } break; case 33: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } break; case 34: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "int16")); + } break; case 35: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "utc")); + } break; case 36: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + } break; case 37: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + } break; case 38: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + } break; case 39: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + } break; case 40: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + } break; case 41: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + } break; case 42: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + } break; case 43: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } break; case 44: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } break; case 45: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } break; case 46: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); + } break; case 47: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "map32")); + } break; case 48: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 5U)); + } break; case 49: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "int16")); + } break; case 50: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("ACCapacityformat", value, 0U)); + VerifyOrReturn(CheckConstraintType("value", "", "enum8")); + } break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); @@ -27668,182 +28363,148 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Reads constraints of mandatory attributes from DUT: LocalTemperature"); + LogStep(1, "Reads mandatory attributes from DUT: LocalTemperature"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::LocalTemperature::Id, true, chip::NullOptional); } case 2: { - LogStep(2, "Reads constraints of mandatory attributes from DUT: AbsMinHeatSetpointLimit"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, - Thermostat::Attributes::AbsMinHeatSetpointLimit::Id, true, chip::NullOptional); + LogStep(2, "Read OutdoorTemperature attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OutdoorTemperature::Id, + true, chip::NullOptional); } case 3: { - LogStep(3, "Reads constraints of mandatory attributes from DUT: AbsMaxHeatSetpointLimit"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, - Thermostat::Attributes::AbsMaxHeatSetpointLimit::Id, true, chip::NullOptional); + LogStep(3, "Read Occupancy attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::Occupancy::Id, true, + chip::NullOptional); } case 4: { - LogStep(4, "Reads constraints of optional attributes from DUT: AbsMinCoolSetpointLimit"); + LogStep(4, "Reads mandatory attributes from DUT: AbsMinHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, - Thermostat::Attributes::AbsMinCoolSetpointLimit::Id, true, chip::NullOptional); + Thermostat::Attributes::AbsMinHeatSetpointLimit::Id, true, chip::NullOptional); } case 5: { - LogStep(5, "Reads constraints of optional attributes from DUT: AbsMaxCoolSetpointLimit"); + LogStep(5, "Reads mandatory attributes from DUT: AbsMaxHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, - Thermostat::Attributes::AbsMaxCoolSetpointLimit::Id, true, chip::NullOptional); + Thermostat::Attributes::AbsMaxHeatSetpointLimit::Id, true, chip::NullOptional); } case 6: { - LogStep(6, - "Read PICoolingDemand attribute from the DUT Verify that the DUT responds with a uint8 value.The value has to " - "be in the range of 0 to 100"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(6, "Reads optional attributes from DUT: AbsMinCoolSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::AbsMinCoolSetpointLimit::Id, true, chip::NullOptional); } case 7: { - LogStep(7, - "Read PIHeatingDemand attribute from the DUT and Verify that the DUT responds with a uint8 value.The value has " - "to be in the range of 0 to 100"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(7, "Reads optional attributes from DUT: AbsMaxCoolSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::AbsMaxCoolSetpointLimit::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Reads constraints of optional attributes from DUT: OccupiedCoolingSetpoint"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, - Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); + LogStep(8, "Read PICoolingDemand attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::PICoolingDemand::Id, true, + chip::NullOptional); } case 9: { - LogStep(9, "Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, - Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); + LogStep(9, "Read PIHeatingDemand attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::PIHeatingDemand::Id, true, + chip::NullOptional); } case 10: { - LogStep(10, - "Read UnoccupiedCoolingSetpoint attribute from the DUT and Verify that the DUT responds with an int16 value"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(10, "Read HVACSystemTypeConfiguration attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::HVACSystemTypeConfiguration::Id, true, chip::NullOptional); } case 11: { - LogStep(11, - "Read UnoccupiedHeatingSetpoint attribute from the DUT and Verify that the DUT responds with an int16 value"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(11, "Read LocalTemperatureCalibration attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0010"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::LocalTemperatureCalibration::Id, true, chip::NullOptional); } case 12: { - LogStep(12, "Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, - true, chip::NullOptional); + LogStep(12, "Reads optional attributes from DUT: OccupiedCoolingSetpoint"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); } case 13: { - LogStep(13, "Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, - true, chip::NullOptional); + LogStep(13, "Reads mandatory attributes from DUT: OccupiedHeatingSetpoint"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); } case 14: { - LogStep(14, "Reads constraints of optional attributes from DUT: MinCoolSetpointLimit"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, - true, chip::NullOptional); + LogStep(14, "Read UnoccupiedCoolingSetpoint attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0013"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id, true, chip::NullOptional); } case 15: { - LogStep(15, "Reads constraints of optional attributes from DUT: MaxCoolSetpointLimit"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, - true, chip::NullOptional); + LogStep(15, "Read UnoccupiedHeatingSetpoint attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id, true, chip::NullOptional); } case 16: { - LogStep(16, "Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, - Thermostat::Attributes::ControlSequenceOfOperation::Id, true, chip::NullOptional); + LogStep(16, "Reads mandatory attributes from DUT: MinHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, + true, chip::NullOptional); } case 17: { - LogStep(17, "Reads constraints of mandatory attributes from DUT: SystemMode"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::SystemMode::Id, true, - chip::NullOptional); + LogStep(17, "Reads mandatory attributes from DUT: MaxHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, + true, chip::NullOptional); } case 18: { - LogStep(18, "Read OutdoorTemperature attribute from the DUT and Verify the datatype"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(18, "Reads optional attributes from DUT: MinCoolSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0017"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, + true, chip::NullOptional); } case 19: { - LogStep(19, "Read Occupancy attribute from the DUT and Verify the datatype and response value"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(19, "Reads optional attributes from DUT: MaxCoolSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0018"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, + true, chip::NullOptional); } case 20: { - LogStep(20, - "Read HVACSystemTypeConfiguration attribute from the DUT and Verify that the DUT responds with a map8 value. " - "The value has to be in the range of 0x00 to 0x3f"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(20, "Reads optional attributes from DUT: MinSetpointDeadBand"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0019"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, + true, chip::NullOptional); } case 21: { - LogStep(21, - "Read LocalTemperatureCalibration attribute from the DUT and Verify that the DUT responds with an int8 " - "value.The value has to be in the range of -25 to 25"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(21, "Read RemoteSensing attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A001a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::RemoteSensing::Id, true, + chip::NullOptional); } case 22: { - LogStep(22, "Reads constraints of optional attributes from DUT: MinSetpointDeadBand"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, - true, chip::NullOptional); + LogStep(22, "Reads mandatory attributes from DUT: ControlSequenceOfOperation"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A001b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::ControlSequenceOfOperation::Id, true, chip::NullOptional); } case 23: { - LogStep(23, - "Read RemoteSensing attribute from the DUT and Verify that the DUT responds with a map8 value. The value has " - "to be in the range of 0x00 to 0x07"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(23, "Reads mandatory attributes from DUT: SystemMode"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A001c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::SystemMode::Id, true, + chip::NullOptional); } case 24: { LogStep(24, "Read AlarmMask attribute from the DUT and Verify that the DUT responds with a map8 value.The value has to be " "in the range of 0x00 to 0x07."); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A001d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); @@ -27852,281 +28513,160 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand return UserPrompt(kIdentityAlpha, value); } case 25: { - LogStep(25, - "Read ThermostatRunningMode attribute from the DUT and Verify that the DUT responds with an enum8 value.The " - "value has to be 0, 3 or 4"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(25, "Read ThermostatRunningMode attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A001e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ThermostatRunningMode::Id, + true, chip::NullOptional); } case 26: { LogStep(26, "Reads constraints of optional attributes from DUT: StartOfWeek"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0020"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::StartOfWeek::Id, true, chip::NullOptional); } case 27: { - LogStep(27, "Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions"); + LogStep(27, "Reads optional attributes from DUT: NumberOfWeeklyTransitions"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0021"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::NumberOfWeeklyTransitions::Id, true, chip::NullOptional); } case 28: { - LogStep(28, "Reads constraints of optional attributes from DUT: NumberOfDailyTransitions"); + LogStep(28, "Reads optional attributes from DUT: NumberOfDailyTransitions"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0022"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::NumberOfDailyTransitions::Id, true, chip::NullOptional); } case 29: { - LogStep(29, - "Read TemperatureSetpointHold attribute from the DUT and Verify that the DUT responds with an enum8 value.The " - "value has to 0 or 1"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(29, "Read TemperatureSetpointHold attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0023"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::TemperatureSetpointHold::Id, true, chip::NullOptional); } case 30: { - LogStep(30, - "Read TemperatureSetpointHoldDuration attribute from the DUT and Verify that the DUT responds with a uint16 " - "value or NULL.The value has to be in the range of 0 to 1440"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(30, "Read TemperatureSetpointHoldDuration attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0024"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::TemperatureSetpointHoldDuration::Id, true, chip::NullOptional); } case 31: { - LogStep(31, - "Read ThermostatProgrammingOperationMode attribute from the DUT and Verify that the DUT responds with a map8 " - "value.The value has to be in the range of 0x00 to 0x07"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(31, "Read ThermostatProgrammingOperationMode attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0025"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::ThermostatProgrammingOperationMode::Id, true, chip::NullOptional); } case 32: { - LogStep(32, - "Read ThermostatRunningState attribute from the DUT and Verify that the DUT responds with a map16 value.The " - "value has to be in the range of 0x00 to 0x7F"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(32, "Read ThermostatRunningState attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0029"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ThermostatRunningState::Id, + true, chip::NullOptional); } case 33: { - LogStep(33, - "Read SetpointChangeSource attribute from the DUT and Verify that the DUT responds with an enum8 value. The " - "value has to be in the range of 0 to 2"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(33, "Read SetpointChangeSource attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0030"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::SetpointChangeSource::Id, + true, chip::NullOptional); } case 34: { - LogStep( - 34, - "Read SetpointChangeAmount attribute from the DUT and Verify that the DUT responds with an int16 value or NULL"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(34, "Read SetpointChangeAmount attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0031"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::SetpointChangeAmount::Id, + true, chip::NullOptional); } case 35: { - LogStep(35, - "Read SetpointChangeSourceTimestamp attribute from the DUT and Verify that the DUT responds with a utc value"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(35, "Read SetpointChangeSourceTimestamp attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0032"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::SetpointChangeSourceTimestamp::Id, true, chip::NullOptional); } case 36: { - LogStep(36, "Read OccupiedSetback attribute from the DUT and Verify that the DUT responds with a uint8 value or NULL"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(36, "Read OccupiedSetback attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0034"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedSetback::Id, true, + chip::NullOptional); } case 37: { - LogStep(37, - "Read OccupiedSetbackMin attribute from the DUT and Verify that the DUT responds with a uint8 value or NULL"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(37, "Read OccupiedSetbackMin attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0035"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedSetbackMin::Id, + true, chip::NullOptional); } case 38: { - LogStep(38, - "Read OccupiedSetbackMax attribute from the DUT and Verify that the DUT responds with a uint8 value or NULL"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(38, "Read OccupiedSetbackMax attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0036"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedSetbackMax::Id, + true, chip::NullOptional); } case 39: { - LogStep(39, - "Read UnoccupiedSetback attribute from the DUT and Verify that the DUT responds with a uint8 value or NULL"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(39, "Read UnoccupiedSetback attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0037"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedSetback::Id, + true, chip::NullOptional); } - case 40: { - LogStep(40, - "Read UnoccupiedSetbackMin attribute from the DUT and Verify that the DUT responds with a uint8 value or NULL"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + case 40: { + LogStep(40, "Read UnoccupiedSetbackMin attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0038"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedSetbackMin::Id, + true, chip::NullOptional); } case 41: { - LogStep(41, - "Read UnoccupiedSetbackMax attribute from the DUT and Verify that the DUT responds with a uint8 value or NULL"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(41, "Read UnoccupiedSetbackMax attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0039"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedSetbackMax::Id, + true, chip::NullOptional); } case 42: { - LogStep(42, - "Read EmergencyHeatDelta attribute from the DUT and Verify that the DUT responds with a uint8 value or NULL"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(42, "Read EmergencyHeatDelta attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A003a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::EmergencyHeatDelta::Id, + true, chip::NullOptional); } case 43: { - LogStep(43, - "Read ACType attribute from the DUT and Verify that the DUT responds with an enum8 value. The value has to be " - "in the range of 0 to 4"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(43, "Read ACType attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0040"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACType::Id, true, + chip::NullOptional); } case 44: { - LogStep(44, "Read ACCapacity attribute from the DUT and Verify that the DUT responds with a uint16 value"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(44, "Read ACCapacity attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0041"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACCapacity::Id, true, + chip::NullOptional); } case 45: { - LogStep(45, - "Read ACRefrigerantType attribute from the DUT and VVerify that the DUT responds with an enum8 value.The value " - "has to be in the range of 0 to 3"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(45, "Read ACRefrigerantType attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0042"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACRefrigerantType::Id, + true, chip::NullOptional); } case 46: { - LogStep(46, - "Read ACCompressorType attribute from the DUT and Verify that the DUT responds with an enum8 value.The value " - "has to be in the range of 0 to 3"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(46, "Read ACCompressorType attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0043"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACCompressorType::Id, true, + chip::NullOptional); } case 47: { - LogStep(47, "Read ACErrorCode attribute from the DUT and Verify that the DUT responds with a map32 value"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(47, "Read ACErrorCode attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0044"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACErrorCode::Id, true, + chip::NullOptional); } case 48: { - LogStep(48, - "Read ACLouverPosition attribute from the DUT and Verify that the DUT responds with an enum8 value.The value " - "has to be in the range of 1 to 5"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(48, "Read ACLouverPosition attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0045"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACLouverPosition::Id, true, + chip::NullOptional); } case 49: { - LogStep(49, - "Read ACCoilTemperature attribute from the DUT and Verify that the DUT responds with an int16 value or NULL"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(49, "Read ACCoilTemperature attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0046"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACCoilTemperature::Id, + true, chip::NullOptional); } case 50: { - LogStep(50, - "Read ACCapacityFormat attribute from the DUT and Verify that the DUT responds with an enum8 value.The value " - "has to be 0."); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(50, "Read ACCapacityFormat attribute from the DUT"); + VerifyOrDo(!ShouldSkip("TSTAT.S.A0047"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ACCapacityformat::Id, true, + chip::NullOptional); } } return CHIP_NO_ERROR; @@ -28136,7 +28676,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand class Test_TC_TSTAT_2_2Suite : public TestCommand { public: - Test_TC_TSTAT_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_2_2", 78, credsIssuerConfig) + Test_TC_TSTAT_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_2_2", 102, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -28174,37 +28714,24 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand shouldContinue = true; break; case 1: - if (IsUnsupported(status.mStatus)) - { - return; - } VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", value, 2600)); VerifyOrReturn(CheckConstraintType("value", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("value", value, 1600)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 2600)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); } break; case 2: - if (IsUnsupported(status.mStatus)) - { - return; - } VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 3: - if (IsUnsupported(status.mStatus)) - { - return; - } VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", value, 2250)); + VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", value, 2500)); } break; case 4: @@ -28214,39 +28741,28 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 6: - if (IsUnsupported(status.mStatus)) - { - return; - } VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 7: - if (IsUnsupported(status.mStatus)) - { - return; - } + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", value, 2000)); VerifyOrReturn(CheckConstraintType("value", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("value", value, 700)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); } break; - case 8: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 9: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -28254,24 +28770,30 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", value, 2100)); } break; - case 10: + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 11: + case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 12: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 13: - if (IsUnsupported(status.mStatus)) + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - return; + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", value, 700)); } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -28282,18 +28804,10 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); } break; - case 14: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 15: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -28301,31 +28815,19 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("unoccupiedCoolingSetpoint", value, 2500)); } break; - case 16: + case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 17: + case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 18: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 19: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 24: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 20: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 25: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -28336,18 +28838,10 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); } break; - case 21: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 26: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 22: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 27: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -28355,31 +28849,19 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("unoccupiedHeatingSetpoint", value, 2500)); } break; - case 23: + case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 24: + case 29: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 25: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 30: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 26: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 31: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 27: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 32: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -28390,56 +28872,73 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); } break; - case 28: + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("minHeatSetpointLimit", value, 800)); + } + break; + case 35: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 29: + case 36: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 30: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 38: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 31: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 39: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 32: - if (IsUnsupported(status.mStatus)) + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - return; + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("maxHeatSetpointLimit", value, 3000)); + VerifyOrReturn(CheckConstraintType("value", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 700)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("maxHeatSetpointLimit", value, 2000)); + VerifyOrReturn(CheckValue("maxHeatSetpointLimit", value, 2900)); } break; - case 33: + case 45: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 34: + case 46: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 35: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 47: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 36: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -28450,18 +28949,10 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); } break; - case 37: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 50: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 38: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 51: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -28469,31 +28960,22 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("minCoolSetpointLimit", value, 2000)); } break; - case 39: + case 52: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 40: + case 53: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 41: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 54: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 42: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 55: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 43: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 57: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -28504,45 +28986,45 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); } break; - case 44: + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("maxCoolSetpointLimit", value, 2000)); + } + break; + case 60: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 45: + case 61: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 46: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 62: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 47: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 63: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 48: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 64: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 49: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 65: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 50: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 67: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 69: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int8_t value; @@ -28553,18 +29035,10 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 25)); } break; - case 51: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 70: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 52: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 71: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int8_t value; @@ -28572,27 +29046,19 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("minSetpointDeadBand", value, 5)); } break; - case 53: + case 72: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 54: + case 73: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; - case 55: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 74: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 56: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 75: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 57: + case 76: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::Thermostat::ThermostatControlSequence value; @@ -28603,10 +29069,10 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 5U)); } break; - case 58: + case 77: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 59: + case 78: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::Thermostat::ThermostatControlSequence value; @@ -28614,146 +29080,113 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("controlSequenceOfOperation", value, 2U)); } break; - case 60: + case 79: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 61: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 80: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - int16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", value, -30)); - } break; - case 62: + case 81: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 63: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 82: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 83: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", value, 30)); + VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", value, 1700)); } break; - case 64: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 84: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 65: + case 85: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 66: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 86: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", value, -30)); + VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", value, 2300)); } break; - case 67: - if (IsUnsupported(status.mStatus)) + case 87: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 88: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - return; + int16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", value, 2300)); } + break; + case 89: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 68: + case 90: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 69: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 91: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", value, 30)); + VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", value, 2900)); } break; - case 70: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 92: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 71: + case 93: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 72: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 94: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 95: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", value, -30)); + VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", value, 2300)); } break; - case 73: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 96: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", value, -30)); + VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", value, 1700)); } break; - case 74: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 97: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 75: + case 98: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 76: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 99: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 100: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", value, 30)); + VerifyOrReturn(CheckValue("occupiedCoolingSetpoint", value, 2900)); } break; - case 77: - if (IsUnsupported(status.mStatus)) - { - return; - } + case 101: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", value, 30)); + VerifyOrReturn(CheckValue("occupiedHeatingSetpoint", value, 2300)); } break; default: @@ -28780,29 +29213,29 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 1: { LogStep(1, "Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); } case 2: { LogStep(2, "Writes a value back that is different but valid for OccupiedCoolingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; - value = 2250; + value = 2500; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedCoolingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } case 3: { LogStep(3, "Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); } case 4: { - LogStep(4, "Writes OccupiedCoolingSetpoint to value below the MinCoolSetpointLimit"); - VerifyOrDo(!ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(4, "Writes OccupiedCoolingSetpoint to value below the ABSMinCoolSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 30; @@ -28812,7 +29245,7 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand } case 5: { LogStep(5, "Writes OccupiedCoolingSetpoint to value above the MaxCoolSetpointLimit"); - VerifyOrDo(!ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 4000; @@ -28821,24 +29254,44 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand chip::NullOptional); } case 6: { - LogStep(6, "Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(6, "Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && !TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; - value = 2600; + value = 1600; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedCoolingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } case 7: { - LogStep(7, "Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("A_OCCUPIEDHEATINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(7, "Writes the CoolingSetpoint below the HeatingSetpoint when auto is enabled"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 1600; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedCoolingSetpoint::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 8: { + LogStep(8, "Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 3200; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedCoolingSetpoint::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 9: { + LogStep(9, "Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is within range"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); } - case 8: { - LogStep(8, "Writes a value back that is different but valid for OccupiedHeatingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("A_OCCUPIEDHEATINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 10: { + LogStep(10, "Writes a value back that is different but valid for OccupiedHeatingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2100; @@ -28846,15 +29299,15 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::OccupiedHeatingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 9: { - LogStep(9, "Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("A_OCCUPIEDHEATINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 11: { + LogStep(11, "Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); } - case 10: { - LogStep(10, "Writes OccupiedHeatingSetpoint to value below the MinHeatSetpointLimit"); - VerifyOrDo(!ShouldSkip("A_OCCUPIEDHEATINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 12: { + LogStep(12, "Writes OccupiedHeatingSetpoint to value below the MinHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 600; @@ -28862,9 +29315,9 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::OccupiedHeatingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 11: { - LogStep(11, "Writes OccupiedHeatingSetpoint to value above the MaxHeatSetpointLimit"); - VerifyOrDo(!ShouldSkip("A_OCCUPIEDHEATINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 13: { + LogStep(13, "Writes OccupiedHeatingSetpoint to value above the MaxHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 4010; @@ -28872,9 +29325,9 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::OccupiedHeatingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 12: { - LogStep(12, "Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("A_OCCUPIEDHEATINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 14: { + LogStep(14, "Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 700; @@ -28882,15 +29335,41 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::OccupiedHeatingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 13: { - LogStep(13, "Reads UnoccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("A_UNOCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 15: { + LogStep(15, "Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && !TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 3000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedHeatingSetpoint::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 17: { + LogStep(17, "Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 3000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedHeatingSetpoint::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 18: { + LogStep(18, "Reads UnoccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is within range"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id, true, chip::NullOptional); } - case 14: { - LogStep(14, "Writes a value back that is different but valid for UnoccupiedCoolingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("A_UNOCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 19: { + LogStep(19, "Writes a value back that is different but valid for UnoccupiedCoolingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2500; @@ -28898,15 +29377,15 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 15: { - LogStep(15, "Reads it back again to confirm the successful write of UnoccupiedCoolingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("A_UNOCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 20: { + LogStep(20, "Reads it back again to confirm the successful write of UnoccupiedCoolingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id, true, chip::NullOptional); } - case 16: { - LogStep(16, "Writes UnoccupiedCoolingSetpoint to value below the MinHeatSetpointLimit"); - VerifyOrDo(!ShouldSkip("A_UNOCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 21: { + LogStep(21, "Writes UnoccupiedCoolingSetpoint to value below the MinCoolSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 1002; @@ -28914,9 +29393,9 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 17: { - LogStep(17, "Writes UnoccupiedCoolingSetpoint to value above the MaxHeatSetpointLimit"); - VerifyOrDo(!ShouldSkip("A_UNOCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 22: { + LogStep(22, "Writes UnoccupiedCoolingSetpoint to value above the MaxCoolSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 4010; @@ -28924,9 +29403,9 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 18: { - LogStep(18, "Writes the limit of MinCoolSetpointLimit to UnoccupiedCoolingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("A_UNOCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 23: { + LogStep(23, "Writes the limit of MinCoolSetpointLimit to UnoccupiedCoolingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 1800; @@ -28934,9 +29413,9 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 19: { - LogStep(19, "Writes the limit of MaxCoolSetpointLimit to UnoccupiedCoolingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("A_UNOCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 24: { + LogStep(24, "Writes the limit of MaxCoolSetpointLimit to UnoccupiedCoolingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 3000; @@ -28944,15 +29423,15 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 20: { - LogStep(20, "Reads UnoccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("A_UNOCCUPIEDHEATINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 25: { + LogStep(25, "Reads UnoccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is within range"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id, true, chip::NullOptional); } - case 21: { - LogStep(21, "Writes a value back that is different but valid for UnoccupiedHeatingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("A_UNOCCUPIEDHEATINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 26: { + LogStep(26, "Writes a value back that is different but valid for UnoccupiedHeatingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2500; @@ -28960,15 +29439,15 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 22: { - LogStep(22, "Reads it back again to confirm the successful write of UnoccupiedHeatingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("A_UNOCCUPIEDHEATINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 27: { + LogStep(27, "Reads it back again to confirm the successful write of UnoccupiedHeatingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id, true, chip::NullOptional); } - case 23: { - LogStep(23, "Writes UnoccupiedHeatingSetpoint to value below the MinHeatSetpointLimit"); - VerifyOrDo(!ShouldSkip("A_UNOCCUPIEDHEATINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 28: { + LogStep(28, "Writes UnoccupiedHeatingSetpoint to value below the MinHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 500; @@ -28976,9 +29455,9 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 24: { - LogStep(24, "Writes UnoccupiedHeatingSetpoint to value above the MaxHeatSetpointLimit"); - VerifyOrDo(!ShouldSkip("A_UNOCCUPIEDHEATINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 29: { + LogStep(29, "Writes UnoccupiedHeatingSetpoint to value above the MaxHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 4010; @@ -28986,9 +29465,9 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 25: { - LogStep(25, "Writes the limit of MinHeatSetpointLimit to UnoccupiedHeatingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("A_UNOCCUPIEDHEATINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 30: { + LogStep(30, "Writes the limit of MinHeatSetpointLimit to UnoccupiedHeatingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 1800; @@ -28996,9 +29475,9 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 26: { - LogStep(26, "Writes the limit of MaxHeatSetpointLimit to UnoccupiedHeatingSetpoint attribute"); - VerifyOrDo(!ShouldSkip("A_UNOCCUPIEDHEATINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 31: { + LogStep(31, "Writes the limit of MaxHeatSetpointLimit to UnoccupiedHeatingSetpoint attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 3000; @@ -29006,264 +29485,390 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 27: { - LogStep(27, "Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("A_MINHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 32: { + LogStep(32, "Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within range"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, true, chip::NullOptional); } - case 28: { - LogStep(28, "Writes MinHeatSetpointLimit to value below the AbsMinHeatSetpointLimit "); - VerifyOrDo(!ShouldSkip("A_MINHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 33: { + LogStep(33, "Writes a value back that is different but valid for MinHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 800; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 34: { + LogStep(34, "Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, + true, chip::NullOptional); + } + case 35: { + LogStep(35, "Writes a value back that is different but violates the deadband"); + VerifyOrDo(!ShouldSkip("A_MINHEATSETPOINTLIMIT && TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 2000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 36: { + LogStep(36, "Writes MinHeatSetpointLimit to value below the AbsMinHeatSetpointLimit "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 650; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 29: { - LogStep(29, "Writes MinHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit "); - VerifyOrDo(!ShouldSkip("A_MINHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 37: { + LogStep(37, "Writes MinHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 4050; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 30: { - LogStep(30, "Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("A_MINHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 38: { + LogStep(38, "Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 700; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 31: { - LogStep(31, "Writes a value back that is different but valid for MaxHeatSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("A_MAXHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 39: { + LogStep(39, "Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT && !TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; - value = 2000; + value = 3000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 40: { + LogStep(40, "Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within range"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT && !TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, + true, chip::NullOptional); + } + case 41: { + LogStep(41, "Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 700; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 42: { + LogStep(42, "Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("A_MINHEATSETPOINTLIMIT && TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 3000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 43: { + LogStep(43, "Writes a value back that is different but valid for MaxHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT && !TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 2900; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 32: { - LogStep(32, "Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("A_MAXHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 44: { + LogStep(44, "Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT && !TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, true, chip::NullOptional); } - case 33: { - LogStep(33, "Writes MaxHeatSetpointLimit to value below the AbsMinHeatSetpointLimit "); - VerifyOrDo(!ShouldSkip("A_MAXHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 45: { + LogStep(45, "Writes MaxHeatSetpointLimit to value below the AbsMinHeatSetpointLimit "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 500; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 34: { - LogStep(34, "Writes MaxHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit "); - VerifyOrDo(!ShouldSkip("A_MAXHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 46: { + LogStep(46, "Writes MaxHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 4000; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 35: { - LogStep(35, "Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("A_MAXHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 47: { + LogStep(47, "Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 700; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 36: { - LogStep(36, "Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 48: { + LogStep(48, "Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT && !TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 3000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 49: { + LogStep(49, "Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within range"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, true, chip::NullOptional); } - case 37: { - LogStep(37, "Writes a value back that is different but valid for MinCoolSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 50: { + LogStep(50, "Writes a value back that is different but valid for MinCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2000; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 38: { - LogStep(38, "Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 51: { + LogStep(51, "Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, true, chip::NullOptional); } - case 39: { - LogStep(39, "Writes MinCoolSetpointLimit to value below the AbsMinCoolSetpointLimit "); - VerifyOrDo(!ShouldSkip("A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 52: { + LogStep(52, "Writes MinCoolSetpointLimit to value below the AbsMinCoolSetpointLimit "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 1000; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 40: { - LogStep(40, "Writes MinCoolSetpointLimit to value above the MaxCoolSetpointLimit "); - VerifyOrDo(!ShouldSkip("A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 53: { + LogStep(53, "Writes MinCoolSetpointLimit to value above the MaxCoolSetpointLimit "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 4000; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 41: { - LogStep(41, "Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 54: { + LogStep(54, "Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 1600; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 42: { - LogStep(42, "Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 55: { + LogStep(55, "Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 3200; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 43: { - LogStep(43, "Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("A_MAXCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 56: { + LogStep(56, "Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 1600; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 57: { + LogStep(57, "Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within range"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, true, chip::NullOptional); } - case 44: { - LogStep(44, "Writes MaxCoolSetpointLimit to value below the AbsMinCoolSetpointLimit "); - VerifyOrDo(!ShouldSkip("A_MAXCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 58: { + LogStep(58, "Writes a value back that is different but valid for MaxCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT && !TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 2000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 59: { + LogStep(59, "Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT && !TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, + true, chip::NullOptional); + } + case 60: { + LogStep(60, "Writes MaxCoolSetpointLimit to value below the AbsMinCoolSetpointLimit "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 1000; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 45: { - LogStep(45, "Writes MaxCoolSetpointLimit to value above the MaxCoolSetpointLimit "); - VerifyOrDo(!ShouldSkip("A_MAXCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 61: { + LogStep(61, "Writes MaxCoolSetpointLimit to value above the MaxCoolSetpointLimit "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 4000; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 46: { - LogStep(46, "Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute"); - VerifyOrDo(!ShouldSkip("A_MAXCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 62: { + LogStep(62, "Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 1600; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 63: { + LogStep(63, "Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 3200; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 47: { - LogStep(47, "Writes (sets back) default value of MinHeatSetpointLimit"); - VerifyOrDo(!ShouldSkip("A_MINHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 64: { + LogStep(64, "Writes (sets back) default value of MinHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MINHEATSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 700; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 48: { - LogStep(48, "Writes (sets back) default value of MinCoolSetpointLimit"); - VerifyOrDo(!ShouldSkip("A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 65: { + LogStep(65, "Writes (sets back)default value of MaxHeatSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MAXHEATSETPOINTLIMIT &&!TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 3000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 66: { + LogStep(66, "Writes MaxHeatSetpointLimit That meets the deadband of 2.5C"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MAXHEATSETPOINTLIMIT &&!TSTAT.S.F05"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 2950; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 67: { + LogStep(67, "Writes (sets back) default value of MinCoolSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 1600; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 49: { - LogStep(49, "Writes (sets back) default value of MaxCoolSetpointLimit"); - VerifyOrDo(!ShouldSkip("A_MAXCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 68: { + LogStep(68, "Writes (sets back) default value of MaxCoolSetpointLimit"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 3200; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 50: { - LogStep(50, "Reads MinSetpointDeadBand attribute from Server DUT and verifies that the value is within range"); - VerifyOrDo(!ShouldSkip("A_MINSETPOINTDEADBAND"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 69: { + LogStep(69, "Reads MinSetpointDeadBand attribute from Server DUT and verifies that the value is within range"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, true, chip::NullOptional); } - case 51: { - LogStep(51, "Writes a value back that is different but valid for MinSetpointDeadBand attribute"); - VerifyOrDo(!ShouldSkip("A_MINSETPOINTDEADBAND"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 70: { + LogStep(70, "Writes a value back that is different but valid for MinSetpointDeadBand attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int8_t value; value = 5; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, value, chip::NullOptional, chip::NullOptional); } - case 52: { - LogStep(52, "Reads it back again to confirm the successful write of MinSetpointDeadBand attribute"); - VerifyOrDo(!ShouldSkip("A_MINSETPOINTDEADBAND"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 71: { + LogStep(71, "Reads it back again to confirm the successful write of MinSetpointDeadBand attribute"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, true, chip::NullOptional); } - case 53: { - LogStep(53, "Writes the value below MinSetpointDeadBand"); - VerifyOrDo(!ShouldSkip("A_MINSETPOINTDEADBAND"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 72: { + LogStep(72, "Writes the value below MinSetpointDeadBand"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int8_t value; value = -1; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, value, chip::NullOptional, chip::NullOptional); } - case 54: { - LogStep(54, "Writes the value above MinSetpointDeadBand "); - VerifyOrDo(!ShouldSkip("A_MINSETPOINTDEADBAND"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 73: { + LogStep(73, "Writes the value above MinSetpointDeadBand "); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int8_t value; value = 30; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, value, chip::NullOptional, chip::NullOptional); } - case 55: { - LogStep(55, "Writes the min limit of MinSetpointDeadBand"); - VerifyOrDo(!ShouldSkip("A_MINSETPOINTDEADBAND"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 74: { + LogStep(74, "Writes the min limit of MinSetpointDeadBand"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int8_t value; value = 0; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, value, chip::NullOptional, chip::NullOptional); } - case 56: { - LogStep(56, "Writes the max limit of MinSetpointDeadBand"); - VerifyOrDo(!ShouldSkip("A_MINSETPOINTDEADBAND"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 75: { + LogStep(75, "Writes the max limit of MinSetpointDeadBand"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int8_t value; value = 25; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, value, chip::NullOptional, chip::NullOptional); } - case 57: { - LogStep(57, "Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid"); - VerifyOrDo(!ShouldSkip("A_CONTROLSEQUENCEOFOPERATION"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 76: { + LogStep(76, "Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ControlSequenceOfOperation::Id, true, chip::NullOptional); } - case 58: { - LogStep(58, "Write Attribute command for ControlSequenceOfOperation with a new valid value"); - VerifyOrDo(!ShouldSkip("A_CONTROLSEQUENCEOFOPERATION"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 77: { + LogStep(77, "Write Attribute command for ControlSequenceOfOperation with a new valid value"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::Thermostat::ThermostatControlSequence value; value = static_cast(2); @@ -29271,17 +29876,46 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::ControlSequenceOfOperation::Id, value, chip::NullOptional, chip::NullOptional); } - case 59: { - LogStep(59, "Read it back again to confirm the successful write"); - VerifyOrDo(!ShouldSkip("A_CONTROLSEQUENCEOFOPERATION"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 78: { + LogStep(78, "Read it back again to confirm the successful write"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ControlSequenceOfOperation::Id, true, chip::NullOptional); } - case 60: { - LogStep(60, "Sends SetpointRaise Command"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower"), + case 79: { + LogStep(79, "Writes MaxHeatSetpointLimit attribute to default value of 2950 to meet deadband constraint"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT && TSTAT.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; + int16_t value; + value = 2950; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 80: { + LogStep(80, "Sets OccupiedCoolingSetpoint to default value"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 2600; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedCoolingSetpoint::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 81: { + LogStep(81, "Sets OccupiedHeatingSetpoint to default value"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 2000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedHeatingSetpoint::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 82: { + LogStep(82, "Sends SetpointRaise Command Heat Only"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type value; value.mode = static_cast(0); value.amount = -30; @@ -29290,17 +29924,25 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand ); } - case 61: { - LogStep(61, "Reads back OccupiedHeatingSetpoint to confirm the success of the write"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && A_OCCUPIEDHEATINGSETPOINT"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 83: { + LogStep(83, "Reads back OccupiedHeatingSetpoint to confirm the success of the write"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); } - case 62: { - LogStep(62, "Sends SetpointRaise Command"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 84: { + LogStep(84, "Sets OccupiedHeatingSetpoint to default value"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 2000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedHeatingSetpoint::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 85: { + LogStep(85, "Sends SetpointRaise Command Heat Only"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type value; value.mode = static_cast(0); @@ -29310,27 +29952,15 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand ); } - case 63: { - LogStep(63, "Reads back OccupiedHeatingSetpoint to confirm the success of the write"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && A_OCCUPIEDCOOLINGSETPOINT"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 86: { + LogStep(86, "Reads back OccupiedHeatingSetpoint to confirm the success of the write"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); } - case 64: { - LogStep(64, "Sets OccupiedCoolingSetpoint to default value"); - VerifyOrDo(!ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - int16_t value; - value = 2600; - return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, - Thermostat::Attributes::OccupiedCoolingSetpoint::Id, value, chip::NullOptional, - chip::NullOptional); - } - case 65: { - LogStep(65, "Sends SetpointRaise Command"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 87: { + LogStep(87, "Sends SetpointRaise Command Cool Only"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type value; value.mode = static_cast(1); @@ -29340,16 +29970,15 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand ); } - case 66: { - LogStep(66, "Reads back OccupiedCoolingSetpoint to confirm the success of the write"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && A_OCCUPIEDCOOLINGSETPOINT"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 88: { + LogStep(88, "Reads back OccupiedCoolingSetpoint to confirm the success of the write"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); } - case 67: { - LogStep(67, "Sets OccupiedCoolingSetpoint to default value"); - VerifyOrDo(!ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 89: { + LogStep(89, "Sets OccupiedCoolingSetpoint to default value"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2600; @@ -29357,10 +29986,9 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::OccupiedCoolingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 68: { - LogStep(68, "Sends SetpointRaise Command"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 90: { + LogStep(90, "Sends SetpointRaise Command Cool Only"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type value; value.mode = static_cast(1); @@ -29370,16 +29998,15 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand ); } - case 69: { - LogStep(69, "Reads back OccupiedCoolingSetpoint to confirm the success of the write"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && A_OCCUPIEDCOOLINGSETPOINT"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 91: { + LogStep(91, "Reads back OccupiedCoolingSetpoint to confirm the success of the write"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); } - case 70: { - LogStep(70, "Sets OccupiedCoolingSetpoint to default value"); - VerifyOrDo(!ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 92: { + LogStep(92, "Sets OccupiedCoolingSetpoint to default value"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2600; @@ -29387,10 +30014,19 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::OccupiedCoolingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 71: { - LogStep(71, "Sends SetpointRaise Command"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 93: { + LogStep(93, "Sets OccupiedHeatingSetpoint to default value"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 2000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedHeatingSetpoint::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 94: { + LogStep(94, "Sends SetpointRaise Command Heat & Cool"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type value; value.mode = static_cast(2); @@ -29400,22 +30036,21 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand ); } - case 72: { - LogStep(72, "Reads back OccupiedCoolingSetpoint to confirm the success of the write"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 95: { + LogStep(95, "Reads back OccupiedCoolingSetpoint to confirm the success of the write"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); } - case 73: { - LogStep(73, "Reads back OccupiedHeatingSetpoint to confirm the success of the write"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && A_OCCUPIEDHEATINGSETPOINT"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 96: { + LogStep(96, "Reads back OccupiedHeatingSetpoint to confirm the success of the write"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); } - case 74: { - LogStep(74, "Sets OccupiedCoolingSetpoint to default value"); - VerifyOrDo(!ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 97: { + LogStep(97, "Sets OccupiedCoolingSetpoint to default value"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; int16_t value; value = 2600; @@ -29423,10 +30058,19 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand Thermostat::Attributes::OccupiedCoolingSetpoint::Id, value, chip::NullOptional, chip::NullOptional); } - case 75: { - LogStep(75, "Sends SetpointRaise Command"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 98: { + LogStep(98, "Sets OccupiedHeatingSetpoint to default value"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + int16_t value; + value = 2000; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, + Thermostat::Attributes::OccupiedHeatingSetpoint::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 99: { + LogStep(99, "Sends SetpointRaise Command Heat & Cool"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type value; value.mode = static_cast(2); @@ -29436,17 +30080,15 @@ class Test_TC_TSTAT_2_2Suite : public TestCommand ); } - case 76: { - LogStep(76, "Reads back OccupiedCoolingSetpoint to confirm the success of the write"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && A_OCCUPIEDCOOLINGSETPOINT"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 100: { + LogStep(100, "Reads back OccupiedCoolingSetpoint to confirm the success of the write"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); } - case 77: { - LogStep(77, "Reads back OccupiedHeatingSetpoint to confirm the success of the write"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && A_OCCUPIEDHEATINGSETPOINT"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 101: { + LogStep(101, "Reads back OccupiedHeatingSetpoint to confirm the success of the write"); + VerifyOrDo(!ShouldSkip("TSTAT.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); } @@ -31890,10 +32532,10 @@ class Test_TC_ULABEL_2_3Suite : public TestCommand shouldContinue = true; break; case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); @@ -33215,7 +33857,7 @@ class Test_TC_WNCV_2_1Suite : public TestCommand class Test_TC_WNCV_2_2Suite : public TestCommand { public: - Test_TC_WNCV_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_2_2", 3, credsIssuerConfig) + Test_TC_WNCV_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_WNCV_2_2", 2, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -33256,10 +33898,6 @@ class Test_TC_WNCV_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -33295,17 +33933,6 @@ class Test_TC_WNCV_2_2Suite : public TestCommand value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt(kIdentityAlpha, value); } - case 2: { - LogStep(2, "Reads ConfigStatus attribute from DUT, value of bit 0 must be 1b operational"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && WNCV.S.A0007 && WNCV.S.F01 && WNCV.S.F04"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); - } } return CHIP_NO_ERROR; } @@ -49394,349 +50021,522 @@ class TestDescriptorClusterSuite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Read attribute Device list"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::DeviceList::Id, true, - chip::NullOptional); + LogStep(1, "Read attribute Device list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::DeviceList::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Read attribute Server list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::ServerList::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Read attribute Client list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::ClientList::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Read attribute Parts list"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::PartsList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestBasicInformationSuite : public TestCommand +{ +public: + TestBasicInformationSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestBasicInformation", 18, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestBasicInformationSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("location", value, chip::CharSpan("XX", 2))); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("location", value, chip::CharSpan("US", 2))); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); + VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); + VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); + VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); + VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 3UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); + VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 4UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); + VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 5UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); + VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 6UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 7)); + VerifyOrReturn(CheckValue("attributeList[7]", iter_0.GetValue(), 7UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 8)); + VerifyOrReturn(CheckValue("attributeList[8]", iter_0.GetValue(), 8UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 9)); + VerifyOrReturn(CheckValue("attributeList[9]", iter_0.GetValue(), 9UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 10)); + VerifyOrReturn(CheckValue("attributeList[10]", iter_0.GetValue(), 10UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 11)); + VerifyOrReturn(CheckValue("attributeList[11]", iter_0.GetValue(), 11UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 12)); + VerifyOrReturn(CheckValue("attributeList[12]", iter_0.GetValue(), 12UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 13)); + VerifyOrReturn(CheckValue("attributeList[13]", iter_0.GetValue(), 13UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 14)); + VerifyOrReturn(CheckValue("attributeList[14]", iter_0.GetValue(), 14UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 15)); + VerifyOrReturn(CheckValue("attributeList[15]", iter_0.GetValue(), 15UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 16)); + VerifyOrReturn(CheckValue("attributeList[16]", iter_0.GetValue(), 16UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 17)); + VerifyOrReturn(CheckValue("attributeList[17]", iter_0.GetValue(), 17UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 18)); + VerifyOrReturn(CheckValue("attributeList[18]", iter_0.GetValue(), 18UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 19)); + VerifyOrReturn(CheckValue("attributeList[19]", iter_0.GetValue(), 19UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 20)); + VerifyOrReturn(CheckValue("attributeList[20]", iter_0.GetValue(), 65528UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 21)); + VerifyOrReturn(CheckValue("attributeList[21]", iter_0.GetValue(), 65529UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 22)); + VerifyOrReturn(CheckValue("attributeList[22]", iter_0.GetValue(), 65531UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 23)); + VerifyOrReturn(CheckValue("attributeList[23]", iter_0.GetValue(), 65532UL)); + VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 24)); + VerifyOrReturn(CheckValue("attributeList[24]", iter_0.GetValue(), 65533UL)); + VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 25)); + } + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("", 0))); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("My node", 7))); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("localConfigDisabled", value, false)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("localConfigDisabled", value, true)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("My node", 7))); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("localConfigDisabled", value, true)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read location"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::Location::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Write location"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("USgarbage: not in length on purpose", 2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::Location::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "Read back location"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::Location::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Restore initial location value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("XXgarbage: not in length on purpose", 2); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::Location::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 5: { + LogStep(5, "Read AttributeList value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Read NodeLabel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Write NodeLabel"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("My nodegarbage: not in length on purpose", 7); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 8: { + LogStep(8, "Read back NodeLabel"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Read LocalConfigDisabled"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Write LocalConfigDisabled"); + ListFreer listFreer; + bool value; + value = true; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 11: { + LogStep(11, "Read back LocalConfigDisabled"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Reboot the device"); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "Connect to the device again"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "Read back NodeLabel after reboot"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Restore initial NodeLabel value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("garbage: not in length on purpose", 0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 16: { + LogStep(16, "Read back LocalConfigDisabled after reboot"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, "Restore initial LocalConfigDisabled value"); + ListFreer listFreer; + bool value; + value = false; + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id, value, + chip::NullOptional, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class TestFabricRemovalWhileSubscribedSuite : public TestCommand +{ +public: + TestFabricRemovalWhileSubscribedSuite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestFabricRemovalWhileSubscribed", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~TestFabricRemovalWhileSubscribedSuite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; + chip::Optional mTimeout; + + chip::FabricIndex ourFabricIndex; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commissionedFabrics", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::FabricIndex value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + ourFabricIndex = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "list")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read number of commissioned fabrics"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CommissionedFabrics::Id, true, chip::NullOptional); } case 2: { - LogStep(2, "Read attribute Server list"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::ServerList::Id, true, - chip::NullOptional); + LogStep(2, "Read current fabric index"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); } case 3: { - LogStep(3, "Read attribute Client list"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::ClientList::Id, true, - chip::NullOptional); - } - case 4: { - LogStep(4, "Read attribute Parts list"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::PartsList::Id, true, - chip::NullOptional); - } - } - return CHIP_NO_ERROR; - } -}; - -class TestBasicInformationSuite : public TestCommand -{ -public: - TestBasicInformationSuite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("TestBasicInformation", 18, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~TestBasicInformationSuite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::CharSpan value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValueAsString("location", value, chip::CharSpan("XX", 2))); - } - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::CharSpan value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValueAsString("location", value, chip::CharSpan("US", 2))); - } - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::DecodableList value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 0)); - VerifyOrReturn(CheckValue("attributeList[0]", iter_0.GetValue(), 0UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 1)); - VerifyOrReturn(CheckValue("attributeList[1]", iter_0.GetValue(), 1UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 2)); - VerifyOrReturn(CheckValue("attributeList[2]", iter_0.GetValue(), 2UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 3)); - VerifyOrReturn(CheckValue("attributeList[3]", iter_0.GetValue(), 3UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 4)); - VerifyOrReturn(CheckValue("attributeList[4]", iter_0.GetValue(), 4UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 5)); - VerifyOrReturn(CheckValue("attributeList[5]", iter_0.GetValue(), 5UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 6)); - VerifyOrReturn(CheckValue("attributeList[6]", iter_0.GetValue(), 6UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 7)); - VerifyOrReturn(CheckValue("attributeList[7]", iter_0.GetValue(), 7UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 8)); - VerifyOrReturn(CheckValue("attributeList[8]", iter_0.GetValue(), 8UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 9)); - VerifyOrReturn(CheckValue("attributeList[9]", iter_0.GetValue(), 9UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 10)); - VerifyOrReturn(CheckValue("attributeList[10]", iter_0.GetValue(), 10UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 11)); - VerifyOrReturn(CheckValue("attributeList[11]", iter_0.GetValue(), 11UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 12)); - VerifyOrReturn(CheckValue("attributeList[12]", iter_0.GetValue(), 12UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 13)); - VerifyOrReturn(CheckValue("attributeList[13]", iter_0.GetValue(), 13UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 14)); - VerifyOrReturn(CheckValue("attributeList[14]", iter_0.GetValue(), 14UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 15)); - VerifyOrReturn(CheckValue("attributeList[15]", iter_0.GetValue(), 15UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 16)); - VerifyOrReturn(CheckValue("attributeList[16]", iter_0.GetValue(), 16UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 17)); - VerifyOrReturn(CheckValue("attributeList[17]", iter_0.GetValue(), 17UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 18)); - VerifyOrReturn(CheckValue("attributeList[18]", iter_0.GetValue(), 18UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 19)); - VerifyOrReturn(CheckValue("attributeList[19]", iter_0.GetValue(), 19UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 20)); - VerifyOrReturn(CheckValue("attributeList[20]", iter_0.GetValue(), 65528UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 21)); - VerifyOrReturn(CheckValue("attributeList[21]", iter_0.GetValue(), 65529UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 22)); - VerifyOrReturn(CheckValue("attributeList[22]", iter_0.GetValue(), 65531UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 23)); - VerifyOrReturn(CheckValue("attributeList[23]", iter_0.GetValue(), 65532UL)); - VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter_0, 24)); - VerifyOrReturn(CheckValue("attributeList[24]", iter_0.GetValue(), 65533UL)); - VerifyOrReturn(CheckNoMoreListItems("attributeList", iter_0, 25)); - } - } - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::CharSpan value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("", 0))); - } - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::CharSpan value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("My node", 7))); - } - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - bool value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("localConfigDisabled", value, false)); - } - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - bool value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("localConfigDisabled", value, true)); - } - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::CharSpan value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValueAsString("nodeLabel", value, chip::CharSpan("My node", 7))); - } - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - bool value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("localConfigDisabled", value, true)); - } - break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - case 0: { - LogStep(0, "Wait for the commissioned device to be retrieved"); + LogStep(3, "Open commissioning window from alpha"); ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee(kIdentityAlpha, value); - } - case 1: { - LogStep(1, "Read location"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::Location::Id, true, - chip::NullOptional); - } - case 2: { - LogStep(2, "Write location"); - ListFreer listFreer; - chip::CharSpan value; - value = chip::Span("USgarbage: not in length on purpose", 2); - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::Location::Id, value, - chip::NullOptional, chip::NullOptional); - } - case 3: { - LogStep(3, "Read back location"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::Location::Id, true, - chip::NullOptional); + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); } case 4: { - LogStep(4, "Restore initial location value"); + LogStep(4, "Commission from beta"); ListFreer listFreer; - chip::CharSpan value; - value = chip::Span("XXgarbage: not in length on purpose", 2); - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::Location::Id, value, - chip::NullOptional, chip::NullOptional); + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = 74565ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode(kIdentityBeta, value); } case 5: { - LogStep(5, "Read AttributeList value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::AttributeList::Id, true, - chip::NullOptional); - } - case 6: { - LogStep(6, "Read NodeLabel"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, true, - chip::NullOptional); - } - case 7: { - LogStep(7, "Write NodeLabel"); - ListFreer listFreer; - chip::CharSpan value; - value = chip::Span("My nodegarbage: not in length on purpose", 7); - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value, - chip::NullOptional, chip::NullOptional); - } - case 8: { - LogStep(8, "Read back NodeLabel"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, true, - chip::NullOptional); - } - case 9: { - LogStep(9, "Read LocalConfigDisabled"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id, true, - chip::NullOptional); - } - case 10: { - LogStep(10, "Write LocalConfigDisabled"); - ListFreer listFreer; - bool value; - value = true; - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id, value, - chip::NullOptional, chip::NullOptional); - } - case 11: { - LogStep(11, "Read back LocalConfigDisabled"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id, true, - chip::NullOptional); - } - case 12: { - LogStep(12, "Reboot the device"); - ListFreer listFreer; - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot(kIdentityAlpha, value); - } - case 13: { - LogStep(13, "Connect to the device again"); + LogStep(5, "Wait for the commissioned device to be retrieved for beta"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee(kIdentityAlpha, value); - } - case 14: { - LogStep(14, "Read back NodeLabel after reboot"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, true, - chip::NullOptional); - } - case 15: { - LogStep(15, "Restore initial NodeLabel value"); - ListFreer listFreer; - chip::CharSpan value; - value = chip::Span("garbage: not in length on purpose", 0); - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::NodeLabel::Id, value, - chip::NullOptional, chip::NullOptional); + value.nodeId = 74565ULL; + return WaitForCommissionee(kIdentityBeta, value); } - case 16: { - LogStep(16, "Read back LocalConfigDisabled after reboot"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id, true, - chip::NullOptional); + case 6: { + LogStep(6, "Subscribe Fabrics Attribute from beta"); + return SubscribeAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::Fabrics::Id, 2, 5, true, chip::NullOptional, + chip::NullOptional); } - case 17: { - LogStep(17, "Restore initial LocalConfigDisabled value"); + case 7: { + LogStep(7, "Remove single own fabric"); ListFreer listFreer; - bool value; - value = false; - return WriteAttribute(kIdentityAlpha, GetEndpoint(0), Basic::Id, Basic::Attributes::LocalConfigDisabled::Id, value, - chip::NullOptional, chip::NullOptional); + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; + value.fabricIndex = ourFabricIndex; + return SendCommand(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Commands::RemoveFabric::Id, value, chip::NullOptional + + ); } } return CHIP_NO_ERROR; @@ -51936,10 +52736,10 @@ class TestUserLabelClusterConstraintsSuite : public TestCommand shouldContinue = true; break; case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); @@ -59257,7 +60057,7 @@ class DL_SchedulesSuite : public TestCommand class Test_TC_DRLK_2_2Suite : public TestCommand { public: - Test_TC_DRLK_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_2", 16, credsIssuerConfig) + Test_TC_DRLK_2_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_2", 23, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59298,28 +60098,60 @@ class Test_TC_DRLK_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("xxx", 3))); + VerifyOrReturn(CheckValueNonNull("userUniqueId", value.userUniqueId)); + VerifyOrReturn(CheckValue("userUniqueId.Value()", value.userUniqueId.Value(), 6452UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, true)); VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); - VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); - VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -59328,10 +60160,15 @@ class Test_TC_DRLK_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("requirePINforRemoteOperation", value, true)); + } break; case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); @@ -59340,17 +60177,38 @@ class Test_TC_DRLK_2_2Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("userCodeTemporaryDisableTime", value, 5U)); + VerifyOrReturn(CheckValue("userCodeTemporaryDisableTime", value, 15U)); } break; - case 14: + case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 15: + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; default: @@ -59376,7 +60234,72 @@ class Test_TC_DRLK_2_2Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "TH writes the RequirePINforRemoteOperation attribute value as False on the DUT"); + LogStep(1, "Create new user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 1U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("xxxgarbage: not in length on purpose", 3); + value.userUniqueId.SetNonNull(); + value.userUniqueId.Value() = 6452UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Read the user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Create new PIN credential and lock/unlock user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(0); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Verify created PIN credential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "TH writes the RequirePINforRemoteOperation attribute value as False on the DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.A0033"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; bool value; @@ -59385,20 +60308,30 @@ class Test_TC_DRLK_2_2Suite : public TestCommand DoorLock::Attributes::RequirePINforRemoteOperation::Id, value, chip::NullOptional, chip::NullOptional); } - case 2: { - LogStep(2, "TH sends Lock Door Command to the DUT without PINCode"); + case 6: { + LogStep(6, "TH sends Lock Door Command to the DUT without PINCode"); + VerifyOrDo(!ShouldSkip("DRLK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 7: { + LogStep(7, "TH sends Lock Door Command to the DUT with valid PINCode"); VerifyOrDo(!ShouldSkip("DRLK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; value.pinCode.Emplace(); - value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, chip::Optional(10000), chip::NullOptional ); } - case 3: { - LogStep(3, "TH writes the RequirePINforRemoteOperation attribute value as True on the DUT"); + case 8: { + LogStep(8, "TH writes the RequirePINforRemoteOperation attribute value as True on the DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.A0033"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; bool value; @@ -59407,39 +60340,38 @@ class Test_TC_DRLK_2_2Suite : public TestCommand DoorLock::Attributes::RequirePINforRemoteOperation::Id, value, chip::NullOptional, chip::NullOptional); } - case 4: { - LogStep(4, "Create new PIN credential and lock/unlock user"); - VerifyOrDo(!ShouldSkip("DRLK.S.C22.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 9: { + LogStep(9, "TH reads the RequirePINforRemoteOperation attribute from the DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::RequirePINforRemoteOperation::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH sends Lock Door Command to the DUT with valid PINCode"); + VerifyOrDo(!ShouldSkip("DRLK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; - value.operationType = static_cast(0); - - value.credential.credentialType = static_cast(1); - value.credential.credentialIndex = 1U; - - value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); - value.userIndex.SetNull(); - value.userStatus.SetNull(); - value.userType.SetNull(); - return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, chip::Optional(10000), chip::NullOptional ); } - case 5: { - LogStep(5, "TH sends Lock Door Command to the DUT with valid PINCode"); + case 11: { + LogStep(11, "TH sends Lock Door Command to the DUT without valid PINCode"); VerifyOrDo(!ShouldSkip("DRLK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; value.pinCode.Emplace(); - value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("645321garbage: not in length on purpose"), 6); return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, chip::Optional(10000), chip::NullOptional ); } - case 6: { - LogStep(6, "TH sends Lock Door Command to the DUT without any argument PINCode"); + case 12: { + LogStep(12, "TH sends Lock Door Command to the DUT without any argument PINCode"); VerifyOrDo(!ShouldSkip("DRLK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; @@ -59450,8 +60382,8 @@ class Test_TC_DRLK_2_2Suite : public TestCommand ); } - case 7: { - LogStep(7, "TH writes WrongCodeEntryLimit attribute value as 3 on the DUT"); + case 13: { + LogStep(13, "TH writes WrongCodeEntryLimit attribute value as 3 on the DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.A0030"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; uint8_t value; @@ -59459,18 +60391,18 @@ class Test_TC_DRLK_2_2Suite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::WrongCodeEntryLimit::Id, value, chip::NullOptional, chip::NullOptional); } - case 8: { - LogStep(8, "TH writes UserCodeTemporaryDisableTime attribute value as 5 seconds on the DUT"); + case 14: { + LogStep(14, "TH writes UserCodeTemporaryDisableTime attribute value as 5 seconds on the DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.A0031"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; uint8_t value; - value = 5U; + value = 15U; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::UserCodeTemporaryDisableTime::Id, value, chip::NullOptional, chip::NullOptional); } - case 9: { - LogStep(9, "TH sends Lock Door Command to the DUT with invalid PINCode"); + case 15: { + LogStep(15, "TH sends Lock Door Command to the DUT with invalid PINCode"); VerifyOrDo(!ShouldSkip("DRLK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; @@ -59481,8 +60413,8 @@ class Test_TC_DRLK_2_2Suite : public TestCommand ); } - case 10: { - LogStep(10, "TH sends Lock Door Command to the DUT with invalid PINCode"); + case 16: { + LogStep(16, "TH sends Lock Door Command to the DUT with invalid PINCode"); VerifyOrDo(!ShouldSkip("DRLK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; @@ -59493,8 +60425,8 @@ class Test_TC_DRLK_2_2Suite : public TestCommand ); } - case 11: { - LogStep(11, "TH sends Lock Door Command to the DUT with invalid PINCode"); + case 17: { + LogStep(17, "TH sends Lock Door Command to the DUT with invalid PINCode"); VerifyOrDo(!ShouldSkip("DRLK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; @@ -59505,8 +60437,8 @@ class Test_TC_DRLK_2_2Suite : public TestCommand ); } - case 12: { - LogStep(12, "TH sends Lock Door Command to the DUT with invalid PINCode"); + case 18: { + LogStep(18, "TH sends Lock Door Command to the DUT with invalid PINCode"); VerifyOrDo(!ShouldSkip("DRLK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; @@ -59517,14 +60449,14 @@ class Test_TC_DRLK_2_2Suite : public TestCommand ); } - case 13: { - LogStep(13, "TH reads UserCodeTemporaryDisableTime attribute from DUT"); + case 19: { + LogStep(19, "TH reads UserCodeTemporaryDisableTime attribute from DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.A0031"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::UserCodeTemporaryDisableTime::Id, true, chip::NullOptional); } - case 14: { - LogStep(14, "TH sends Lock Door Command to the DUT with valid PINCode"); + case 20: { + LogStep(20, "TH sends Lock Door Command to the DUT with valid PINCode"); VerifyOrDo(!ShouldSkip("DRLK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; @@ -59535,8 +60467,18 @@ class Test_TC_DRLK_2_2Suite : public TestCommand ); } - case 15: { - LogStep(15, "Clean the created credential"); + case 21: { + LogStep(21, "Clean the created user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 22: { + LogStep(22, "Cleanup the created credential"); VerifyOrDo(!ShouldSkip("DRLK.S.C26.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; @@ -59558,7 +60500,7 @@ class Test_TC_DRLK_2_2Suite : public TestCommand class Test_TC_DRLK_2_3Suite : public TestCommand { public: - Test_TC_DRLK_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_3", 9, credsIssuerConfig) + Test_TC_DRLK_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_3", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59596,48 +60538,84 @@ class Test_TC_DRLK_2_3Suite : public TestCommand shouldContinue = true; break; case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("xxx", 3))); + VerifyOrReturn(CheckValueNonNull("userUniqueId", value.userUniqueId)); + VerifyOrReturn(CheckValue("userUniqueId.Value()", value.userUniqueId.Value(), 6452UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); + } + break; + case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("status", value.status, 0U)); - VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); - VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); } break; - case 2: + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, true)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + } break; - case 3: + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 4: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 5: + case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint32_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("autoRelockTime", value, 10UL)); - } break; - case 6: + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 7: + case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValueNonNull("lockState", value)); - VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1U)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 2U)); } break; - case 8: + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; default: @@ -59663,8 +60641,38 @@ class Test_TC_DRLK_2_3Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Create new PIN credential and lock/unlock user"); - VerifyOrDo(!ShouldSkip("DRLK.S.C22.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(1, "Create new user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 1U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("xxxgarbage: not in length on purpose", 3); + value.userUniqueId.SetNonNull(); + value.userUniqueId.Value() = 6452UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Read the user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Create new PIN credential and lock/unlock user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -59673,16 +60681,32 @@ class Test_TC_DRLK_2_3Suite : public TestCommand value.credential.credentialIndex = 1U; value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); - value.userIndex.SetNull(); - value.userStatus.SetNull(); - value.userType.SetNull(); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(0); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, chip::Optional(10000), chip::NullOptional ); } - case 2: { - LogStep(2, "Precondition: Door is in locked state"); + case 4: { + LogStep(4, "Verify created PIN credential"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Precondition: Door is in locked state"); VerifyOrDo(!ShouldSkip("DRLK.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; @@ -59693,17 +60717,17 @@ class Test_TC_DRLK_2_3Suite : public TestCommand ); } - case 3: { - LogStep(3, "TH writes AutoRelockTime attribute value as 10 seconds on the DUT"); + case 6: { + LogStep(6, "TH writes AutoRelockTime attribute value as 10 seconds on the DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.A0023"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; uint32_t value; - value = 10UL; + value = 60UL; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AutoRelockTime::Id, value, chip::NullOptional, chip::NullOptional); } - case 4: { - LogStep(4, "TH sends the unlock Door command to the DUT with valid PINCode"); + case 7: { + LogStep(7, "TH sends the unlock Door command to the DUT with valid PINCode"); VerifyOrDo(!ShouldSkip("DRLK.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; @@ -59714,27 +60738,31 @@ class Test_TC_DRLK_2_3Suite : public TestCommand ); } - case 5: { - LogStep(5, "TH reads AutoRelockTime attribute from DUT"); - VerifyOrDo(!ShouldSkip("DRLK.S.A0023"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AutoRelockTime::Id, true, - chip::NullOptional); - } - case 6: { - LogStep(6, "Wait 10000ms"); + case 8: { + LogStep(8, "Wait 10000ms"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 10000UL; return WaitForMs(kIdentityAlpha, value); } - case 7: { - LogStep(7, "TH reads LockState attribute"); + case 9: { + LogStep(9, "TH reads LockState attribute"); VerifyOrDo(!ShouldSkip("DRLK.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, chip::NullOptional); } - case 8: { - LogStep(8, "Clean the created credential"); + case 10: { + LogStep(10, "Cleanup the created user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Clean the created credential"); VerifyOrDo(!ShouldSkip("DRLK.S.C26.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; @@ -59937,7 +60965,7 @@ class Test_TC_DRLK_2_4Suite : public TestCommand class Test_TC_DRLK_2_5Suite : public TestCommand { public: - Test_TC_DRLK_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_5", 10, credsIssuerConfig) + Test_TC_DRLK_2_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_5", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -59978,45 +61006,65 @@ class Test_TC_DRLK_2_5Suite : public TestCommand shouldContinue = true; break; case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("status", value.status, 0U)); - VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); - VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); - VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); - VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("xxx", 3))); + VerifyOrReturn(CheckValueNonNull("userUniqueId", value.userUniqueId)); + VerifyOrReturn(CheckValue("userUniqueId.Value()", value.userUniqueId.Value(), 6452UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); } break; - case 2: + case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("numberOfWeekDaySchedulesSupportedPerUser", value, 10U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); NumberOfWeekDaySchedulesSupportedPerUser = value; } break; - case 3: + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("numberOfTotalUsersSupported", value, 10U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); NumberOfTotalUsersSupported = value; } break; - case 4: + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 5: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintMinValue("value.weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn( + CheckConstraintMaxValue("value.weekDayIndex", value.weekDayIndex, NumberOfWeekDaySchedulesSupportedPerUser)); VerifyOrReturn(CheckConstraintMinValue("value.userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value.userIndex", value.userIndex, NumberOfTotalUsersSupported)); VerifyOrReturn(CheckValue("status", value.status, 0U)); VerifyOrReturn(CheckConstraintHasValue("value.daysMask", value.daysMask, true)); VerifyOrReturn(CheckConstraintMinValue("value.daysMask.Value()", value.daysMask.Value(), 0U)); @@ -60035,10 +61083,10 @@ class Test_TC_DRLK_2_5Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value.endMinute.Value()", value.endMinute.Value(), 59U)); } break; - case 6: + case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; - case 7: + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; @@ -60053,10 +61101,10 @@ class Test_TC_DRLK_2_5Suite : public TestCommand VerifyOrReturn(CheckConstraintHasValue("value.endMinute", value.endMinute, false)); } break; - case 8: + case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 9: + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; @@ -60071,6 +61119,9 @@ class Test_TC_DRLK_2_5Suite : public TestCommand VerifyOrReturn(CheckConstraintHasValue("value.endMinute", value.endMinute, false)); } break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -60094,38 +61145,50 @@ class Test_TC_DRLK_2_5Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Create new PIN credential and lock/unlock user"); - VerifyOrDo(!ShouldSkip("DRLK.S.C22.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(1, "Create new user"); ListFreer listFreer; - chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; value.operationType = static_cast(0); - - value.credential.credentialType = static_cast(1); - value.credential.credentialIndex = 1U; - - value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); - value.userIndex.SetNull(); - value.userStatus.SetNull(); - value.userType.SetNull(); - return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + value.userIndex = 1U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("xxxgarbage: not in length on purpose", 3); + value.userUniqueId.SetNonNull(); + value.userUniqueId.Value() = 6452UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, chip::Optional(10000), chip::NullOptional ); } case 2: { - LogStep(2, "Get Max number of Week Day schedules for user"); + LogStep(2, "Read the user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Get Max number of Week Day schedules for user"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::NumberOfWeekDaySchedulesSupportedPerUser::Id, true, chip::NullOptional); } - case 3: { - LogStep(3, "Get number of supported users"); + case 4: { + LogStep(4, "Get number of supported users"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::NumberOfTotalUsersSupported::Id, true, chip::NullOptional); } - case 4: { - LogStep(4, "Send Set Week Day Schedule Command to DUT"); + case 5: { + LogStep(5, "Send Set Week Day Schedule Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0B.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; @@ -60141,8 +61204,8 @@ class Test_TC_DRLK_2_5Suite : public TestCommand ); } - case 5: { - LogStep(5, "send GetWeekDay Schedule Command "); + case 6: { + LogStep(6, "send GetWeekDay Schedule Command "); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0C.Rsp && DRLK.S.C0C.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -60154,8 +61217,8 @@ class Test_TC_DRLK_2_5Suite : public TestCommand ); } - case 6: { - LogStep(6, "Send Set Week Day Schedule Command to DUT and verify INVALID_COMMAND response"); + case 7: { + LogStep(7, "Send Set Week Day Schedule Command to DUT and verify INVALID_COMMAND response"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0B.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; @@ -60171,8 +61234,8 @@ class Test_TC_DRLK_2_5Suite : public TestCommand ); } - case 7: { - LogStep(7, "send GetWeekDay Schedule Command to DUT and verify INVALID_COMMAND response"); + case 8: { + LogStep(8, "send GetWeekDay Schedule Command to DUT and verify INVALID_COMMAND response"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0C.Rsp && DRLK.S.C0C.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -60184,20 +61247,20 @@ class Test_TC_DRLK_2_5Suite : public TestCommand ); } - case 8: { - LogStep(8, "Clear all week day schedules for the first user"); + case 9: { + LogStep(9, "Clear all week day schedules for the first user"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0D.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearWeekDaySchedule::Type value; - value.weekDayIndex = 254U; + value.weekDayIndex = 1U; value.userIndex = 1U; return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearWeekDaySchedule::Id, value, chip::NullOptional ); } - case 9: { - LogStep(9, "send GetWeekDay Schedule Command "); + case 10: { + LogStep(10, "send GetWeekDay Schedule Command "); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0C.Rsp && DRLK.S.C0C.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -60209,6 +61272,16 @@ class Test_TC_DRLK_2_5Suite : public TestCommand ); } + case 11: { + LogStep(11, "Cleanup the created user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } } return CHIP_NO_ERROR; } @@ -60217,7 +61290,7 @@ class Test_TC_DRLK_2_5Suite : public TestCommand class Test_TC_DRLK_2_7Suite : public TestCommand { public: - Test_TC_DRLK_2_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_7", 13, credsIssuerConfig) + Test_TC_DRLK_2_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_7", 16, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -60259,26 +61332,29 @@ class Test_TC_DRLK_2_7Suite : public TestCommand break; case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("status", value.status, 0U)); - VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); - VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); - VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); - VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); - } break; case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("status", value.status, 0U)); - VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); - VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 2U)); - VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); - VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("xxx", 3))); + VerifyOrReturn(CheckValueNonNull("userUniqueId", value.userUniqueId)); + VerifyOrReturn(CheckValue("userUniqueId.Value()", value.userUniqueId.Value(), 6452UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); } break; case 3: @@ -60286,7 +61362,8 @@ class Test_TC_DRLK_2_7Suite : public TestCommand { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("numberOfYearDaySchedulesSupportedPerUser", value, 10U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); NumberOfYearDaySchedulesSupportedPerUser = value; } break; @@ -60295,7 +61372,8 @@ class Test_TC_DRLK_2_7Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("numberOfTotalUsersSupported", value, 10U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); NumberOfTotalUsersSupported = value; } break; @@ -60308,7 +61386,10 @@ class Test_TC_DRLK_2_7Suite : public TestCommand chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintMinValue("value.yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn( + CheckConstraintMaxValue("value.yearDayIndex", value.yearDayIndex, NumberOfYearDaySchedulesSupportedPerUser)); VerifyOrReturn(CheckConstraintMinValue("value.userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value.userIndex", value.userIndex, NumberOfTotalUsersSupported)); VerifyOrReturn(CheckValue("status", value.status, 0U)); VerifyOrReturn(CheckConstraintHasValue("value.localStartTime", value.localStartTime, true)); VerifyOrReturn(CheckConstraintType("value.localStartTime.Value()", "", "epoch-s")); @@ -60344,34 +61425,43 @@ class Test_TC_DRLK_2_7Suite : public TestCommand } break; case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 2U)); - VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); - VerifyOrReturn(CheckValue("status", value.status, 139U)); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 1U)); VerifyOrReturn(CheckConstraintHasValue("value.localStartTime", value.localStartTime, false)); VerifyOrReturn(CheckConstraintHasValue("value.localEndTime", value.localEndTime, false)); } break; - case 11: + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 12: + case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 2U)); - VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); VerifyOrReturn(CheckValue("status", value.status, 0U)); VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); - VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 10UL)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 1080UL)); VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); - VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 20UL)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 2100UL)); } break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -60395,38 +61485,33 @@ class Test_TC_DRLK_2_7Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Create new PIN credential and lock/unlock user"); + LogStep(1, "Create new user"); ListFreer listFreer; - chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; value.operationType = static_cast(0); - - value.credential.credentialType = static_cast(1); - value.credential.credentialIndex = 1U; - - value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); - value.userIndex.SetNull(); - value.userStatus.SetNull(); - value.userType.SetNull(); - return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + value.userIndex = 1U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("xxxgarbage: not in length on purpose", 3); + value.userUniqueId.SetNonNull(); + value.userUniqueId.Value() = 6452UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, chip::Optional(10000), chip::NullOptional ); } case 2: { - LogStep(2, "Create new PIN credential and lock/unlock for second user"); + LogStep(2, "Read the user back and verify its fields"); ListFreer listFreer; - chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; - value.operationType = static_cast(0); - - value.credential.credentialType = static_cast(1); - value.credential.credentialIndex = 2U; - - value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123457garbage: not in length on purpose"), 6); - value.userIndex.SetNull(); - value.userStatus.SetNull(); - value.userType.SetNull(); - return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, - chip::Optional(10000), chip::NullOptional + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional ); } @@ -60449,8 +61534,8 @@ class Test_TC_DRLK_2_7Suite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; value.yearDayIndex = 1U; value.userIndex = 1U; - value.localStartTime = 10UL; - value.localEndTime = 20UL; + value.localStartTime = 960UL; + value.localEndTime = 1980UL; return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, chip::NullOptional @@ -60475,9 +61560,9 @@ class Test_TC_DRLK_2_7Suite : public TestCommand ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; value.yearDayIndex = 0U; - value.userIndex = 10U; - value.localStartTime = 30UL; - value.localEndTime = 10UL; + value.userIndex = 15U; + value.localStartTime = 1020UL; + value.localEndTime = 2040UL; return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, chip::NullOptional @@ -60510,45 +61595,79 @@ class Test_TC_DRLK_2_7Suite : public TestCommand ); } case 10: { - LogStep(10, "send Get Year Day Schedule Command to DUT and verify NOT_FOUND response "); - VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0F.Rsp && DRLK.S.C0F.Tx"), + LogStep(10, "Clear a year day schedule for the first user"); + VerifyOrDo(!ShouldSkip("DRLK.S.C10.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "send Get Year Day Schedule Command to DUT and verify NOT_FOUND response"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0F.Rsp && DRLK.S.C0F.Tx && DRLK.S.C10.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; - value.yearDayIndex = 2U; - value.userIndex = 2U; + value.yearDayIndex = 1U; + value.userIndex = 1U; return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, chip::NullOptional ); } - case 11: { - LogStep(11, "Send Set Year Day Schedule Command to DUT"); + case 12: { + LogStep(12, "Send Set Year Day Schedule Command to DUT "); VerifyOrDo(!ShouldSkip("DRLK.S.C0E.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; - value.yearDayIndex = 2U; - value.userIndex = 2U; - value.localStartTime = 10UL; - value.localEndTime = 20UL; + value.yearDayIndex = 1U; + value.userIndex = 1U; + value.localStartTime = 1080UL; + value.localEndTime = 2100UL; return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, chip::NullOptional ); } - case 12: { - LogStep(12, "send Get Year Day Schedule Command "); + case 13: { + LogStep(13, "send Get Year Day Schedule Command"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0F.Rsp && DRLK.S.C0F.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; - value.yearDayIndex = 2U; - value.userIndex = 2U; + value.yearDayIndex = 1U; + value.userIndex = 1U; return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, chip::NullOptional ); } + case 14: { + LogStep(14, "Clear a year day schedule for the first user"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C10.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Type value; + value.yearDayIndex = 1U; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 15: { + LogStep(15, "Cleanup the created user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } } return CHIP_NO_ERROR; } @@ -60557,7 +61676,7 @@ class Test_TC_DRLK_2_7Suite : public TestCommand class Test_TC_DRLK_2_9Suite : public TestCommand { public: - Test_TC_DRLK_2_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_9", 17, credsIssuerConfig) + Test_TC_DRLK_2_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_9", 18, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -60598,27 +61717,39 @@ class Test_TC_DRLK_2_9Suite : public TestCommand break; case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("numberOfTotalUsersSupported", value, 10U)); - NumberOfTotalUsersSupported = value; - } break; case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValueNonNull("userName", value.userName)); + VerifyOrReturn(CheckValueAsString("userName.Value()", value.userName.Value(), chip::CharSpan("xxx", 3))); + VerifyOrReturn(CheckValueNonNull("userUniqueId", value.userUniqueId)); + VerifyOrReturn(CheckValue("userUniqueId.Value()", value.userUniqueId.Value(), 6452UL)); + VerifyOrReturn(CheckValueNonNull("userStatus", value.userStatus)); + VerifyOrReturn(CheckValue("userStatus.Value()", value.userStatus.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("userType", value.userType)); + VerifyOrReturn(CheckValue("userType.Value()", value.userType.Value(), 0U)); + VerifyOrReturn(CheckValueNonNull("credentialRule", value.credentialRule)); + VerifyOrReturn(CheckValue("credentialRule.Value()", value.credentialRule.Value(), 0U)); + VerifyOrReturn(CheckValueNull("credentials", value.credentials)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); } break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value.credentialExists", "", "boolean")); - VerifyOrReturn(CheckConstraintMinValue("value.userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + NumberOfTotalUsersSupported = value; } break; case 4: @@ -60626,13 +61757,25 @@ class Test_TC_DRLK_2_9Suite : public TestCommand { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); } break; case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value.credentialExists", "", "boolean")); + VerifyOrReturn(CheckConstraintMinValue("value.userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value.userIndex", value.userIndex, NumberOfTotalUsersSupported)); + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex.Value()", value.lastModifiedFabricIndex.Value(), 1U)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; case 6: @@ -60640,6 +61783,10 @@ class Test_TC_DRLK_2_9Suite : public TestCommand { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); } break; case 7: @@ -60647,6 +61794,10 @@ class Test_TC_DRLK_2_9Suite : public TestCommand { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 2U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); } break; case 8: @@ -60654,47 +61805,71 @@ class Test_TC_DRLK_2_9Suite : public TestCommand { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 2U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); } break; case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 2U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 4U)); } break; - case 11: + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 12: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 13: + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 14: + case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 4U)); } break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 16: + case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; default: @@ -60720,13 +61895,44 @@ class Test_TC_DRLK_2_9Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "TH reads NumberOfTotalUsersSupported attribute and saves for future use."); + LogStep(1, "Create new user with default parameters"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 1U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("xxxgarbage: not in length on purpose", 3); + value.userUniqueId.SetNonNull(); + value.userUniqueId.Value() = 6452UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Read the user back and verify its fields"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetUser::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "TH reads NumberOfTotalUsersSupported attribute and saves for future use."); VerifyOrDo(!ShouldSkip("DRLK.C.F08 && DRLK.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::NumberOfTotalUsersSupported::Id, true, chip::NullOptional); } - case 2: { - LogStep(2, "TH sends Set Credential Command to DUT"); + case 4: { + LogStep(4, "TH sends Set Credential Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -60748,8 +61954,8 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 3: { - LogStep(3, "TH sends Get Credential Status Command"); + case 5: { + LogStep(5, "TH sends Get Credential Status Command"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -60763,8 +61969,8 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 4: { - LogStep(4, "TH sends Set Credential Command to DUT"); + case 6: { + LogStep(6, "TH sends Set Credential Command to DUT and verify the INVALID_COMMAND if any of the fields are invalid"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -60772,7 +61978,7 @@ class Test_TC_DRLK_2_9Suite : public TestCommand value.operationType = static_cast(0); value.credential.credentialType = static_cast(1); - value.credential.credentialIndex = 1U; + value.credential.credentialIndex = 2U; value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("1234garbage: not in length on purpose"), 4); value.userIndex.SetNonNull(); @@ -60786,8 +61992,8 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 5: { - LogStep(5, "TH sends Set Credential Command to DUT"); + case 7: { + LogStep(7, "TH sends Set Credential Command to DUT and verify response as DUPLICATE if CredentialData is repeated"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -60795,7 +62001,7 @@ class Test_TC_DRLK_2_9Suite : public TestCommand value.operationType = static_cast(0); value.credential.credentialType = static_cast(1); - value.credential.credentialIndex = 1U; + value.credential.credentialIndex = 2U; value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); value.userIndex.SetNonNull(); @@ -60809,8 +62015,8 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 6: { - LogStep(6, "TH sends Set Credential Command to DUT"); + case 8: { + LogStep(8, "TH sends Set Credential Command to DUT and verify response as OCCUPIED if CredentialIndex is repeated"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -60832,31 +62038,10 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 7: { - LogStep(7, "TH sends Set Credential Command to DUT"); - VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; - value.operationType = static_cast(0); - - value.credential.credentialType = static_cast(1); - value.credential.credentialIndex = 2U; - - value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); - value.userIndex.SetNonNull(); - value.userIndex.Value() = 3U; - value.userStatus.SetNonNull(); - value.userStatus.Value() = static_cast(0); - value.userType.SetNonNull(); - value.userType.Value() = static_cast(0); - return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, - chip::Optional(10000), chip::NullOptional - - ); - } - case 8: { - LogStep(8, "TH sends Set Credential Command to DUT"); + case 9: { + LogStep(9, + "TH sends Set Credential Command to DUT and verify the DUT response as OCCUPIED if the CredentialIndex is not " + "associated with the UserIndex"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -60868,7 +62053,7 @@ class Test_TC_DRLK_2_9Suite : public TestCommand value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); value.userIndex.SetNonNull(); - value.userIndex.Value() = 3U; + value.userIndex.Value() = 2U; value.userStatus.SetNonNull(); value.userStatus.Value() = static_cast(0); value.userType.SetNonNull(); @@ -60878,8 +62063,8 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 9: { - LogStep(9, "TH sends Clear Credential Command to DUT"); + case 10: { + LogStep(10, "TH sends Clear Credential Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C26.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; @@ -60893,46 +62078,46 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 10: { - LogStep(10, "TH sends Set Credential Command to DUT"); - VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), + case 11: { + LogStep(11, + "TH sends Get Credential Status Command and verify that the CredentialType and CredentialIndex for the " + "provided value is cleared"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; - value.operationType = static_cast(0); + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; value.credential.credentialType = static_cast(1); value.credential.credentialIndex = 1U; - value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); - value.userIndex.SetNonNull(); - value.userIndex.Value() = 2U; - value.userStatus.SetNonNull(); - value.userStatus.Value() = static_cast(0); - value.userType.SetNonNull(); - value.userType.Value() = static_cast(0); - return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, - chip::Optional(10000), chip::NullOptional + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional ); } - case 11: { - LogStep(11, "TH sends Clear Credential Command to DUT"); - VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C26.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + case 12: { + LogStep(12, "TH sends Set User Command to DUT"); ListFreer listFreer; - chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; - value.credential.SetNonNull(); - - value.credential.Value().credentialType = static_cast(1); - value.credential.Value().credentialIndex = 65534U; - - return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearCredential::Id, value, + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 2U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("xxxgarbage: not in length on purpose", 3); + value.userUniqueId.SetNonNull(); + value.userUniqueId.Value() = 6452UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, chip::Optional(10000), chip::NullOptional ); } - case 12: { - LogStep(12, "TH sends Set Credential Command to DUT"); + case 13: { + LogStep(13, "TH sends Set Credential Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -60940,7 +62125,7 @@ class Test_TC_DRLK_2_9Suite : public TestCommand value.operationType = static_cast(0); value.credential.credentialType = static_cast(1); - value.credential.credentialIndex = 1U; + value.credential.credentialIndex = 3U; value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); value.userIndex.SetNonNull(); @@ -60954,8 +62139,8 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 13: { - LogStep(13, "TH sends Clear Credential Command to DUT"); + case 14: { + LogStep(14, "TH sends Clear Credential Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C26.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; @@ -60969,46 +62154,38 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 14: { - LogStep(14, "TH sends Get Credential Status Command"); + case 15: { + LogStep(15, "TH sends Get Credential Status Command"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; value.credential.credentialType = static_cast(1); - value.credential.credentialIndex = 1U; + value.credential.credentialIndex = 65534U; return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, chip::NullOptional ); } - case 15: { - LogStep(15, "TH sends Set Credential Command to DUT"); - VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), + case 16: { + LogStep(16, "TH sends Get Credential Status Command"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; - value.operationType = static_cast(0); + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; value.credential.credentialType = static_cast(1); value.credential.credentialIndex = 1U; - value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); - value.userIndex.SetNonNull(); - value.userIndex.Value() = 2U; - value.userStatus.SetNonNull(); - value.userStatus.Value() = static_cast(0); - value.userType.SetNonNull(); - value.userType.Value() = static_cast(0); - return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, - chip::Optional(10000), chip::NullOptional + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, + chip::NullOptional ); } - case 16: { - LogStep(16, "TH sends Clear Credential Command to DUT"); + case 17: { + LogStep(17, "TH sends Clear Credential Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C26.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; @@ -79253,7 +80430,6 @@ class Test_TC_CC_9_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); ColorLoopStartEnhancedHue = value; } break; @@ -79297,7 +80473,6 @@ class Test_TC_CC_9_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); ColorLoopStoredEnhancedHueValue1 = value; } break; @@ -79348,7 +80523,6 @@ class Test_TC_CC_9_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); ColorLoopStartEnhancedHue2 = value; } break; @@ -79392,7 +80566,6 @@ class Test_TC_CC_9_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); ColorLoopStoredEnhancedHueValue2 = value; } break; @@ -79458,7 +80631,6 @@ class Test_TC_CC_9_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); ColorLoopStartEnhancedHue3 = value; } break; @@ -79502,7 +80674,6 @@ class Test_TC_CC_9_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); ColorLoopStoredEnhancedHueValue3 = value; } break; @@ -79553,7 +80724,6 @@ class Test_TC_CC_9_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); ColorLoopStartEnhancedHue4 = value; } break; @@ -79597,7 +80767,6 @@ class Test_TC_CC_9_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); ColorLoopStoredEnhancedHue4 = value; } break; @@ -80388,7 +81557,6 @@ class Test_TC_CC_9_2Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); ColorLoopStartEnhancedHueValue = value; } break; @@ -80436,7 +81604,6 @@ class Test_TC_CC_9_2Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); ColorLoopStartEnhancedHue1 = value; } break; @@ -80480,7 +81647,6 @@ class Test_TC_CC_9_2Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); ColorLoopStoredEnhancedHueValue = value; } break; @@ -80889,7 +82055,6 @@ class Test_TC_CC_9_3Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); ColorLoopStartEnhancedHueValue = value; } break; @@ -80972,7 +82137,6 @@ class Test_TC_CC_9_3Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); ColorLoopStoredEnhancedHueValue = value; } break; @@ -82283,8 +83447,8 @@ class Test_TC_OO_2_3Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value", value, 295U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 305U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 270U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 320U)); } break; case 37: @@ -82332,8 +83496,8 @@ class Test_TC_OO_2_3Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value", value, 295U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 305U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 270U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 325U)); } break; case 47: @@ -82372,8 +83536,8 @@ class Test_TC_OO_2_3Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value", value, 295U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 305U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 270U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 320U)); } break; case 53: @@ -82404,8 +83568,8 @@ class Test_TC_OO_2_3Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value", value, 195U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 205U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 180U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 220U)); } break; case 58: @@ -82473,8 +83637,8 @@ class Test_TC_OO_2_3Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value", value, 295U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 305U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 270U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 320U)); } break; case 70: @@ -82621,8 +83785,8 @@ class Test_TC_OO_2_3Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value", value, 295U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 305U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 270U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 320U)); } break; case 93: @@ -82660,8 +83824,8 @@ class Test_TC_OO_2_3Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value", value, 195U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 205U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 180U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 220U)); } break; case 100: @@ -82696,8 +83860,8 @@ class Test_TC_OO_2_3Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value", value, 295U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 305U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 270U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 320U)); } break; case 105: @@ -82724,8 +83888,8 @@ class Test_TC_OO_2_3Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value", value, 195U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 205U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 180U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 220U)); } break; case 109: @@ -82786,8 +83950,8 @@ class Test_TC_OO_2_3Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value", value, 295U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 305U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 270U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 320U)); } break; case 119: @@ -82835,8 +83999,8 @@ class Test_TC_OO_2_3Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value", value, 295U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 305U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, 270U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 320U)); } break; case 126: @@ -86741,6 +87905,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index f362b1d0e9e37f..1331531e268026 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -367,6 +367,12 @@ typedef void (*ColorControlAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ColorControlAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*BallastConfigurationGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*BallastConfigurationAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*BallastConfigurationAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*IlluminanceMeasurementGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*IlluminanceMeasurementAcceptedCommandListListAttributeCallback)( diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h index 7b515c2ba51d21..e4c2c1c4541b62 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h @@ -439,6 +439,15 @@ class DLL_EXPORT ColorControlCluster : public ClusterBase ~ColorControlCluster() {} }; +class DLL_EXPORT BallastConfigurationCluster : public ClusterBase +{ +public: + BallastConfigurationCluster(Messaging::ExchangeManager & exchangeManager, const SessionHandle & session, EndpointId endpoint) : + ClusterBase(exchangeManager, session, app::Clusters::BallastConfiguration::Id, endpoint) + {} + ~BallastConfigurationCluster() {} +}; + class DLL_EXPORT IlluminanceMeasurementCluster : public ClusterBase { public: diff --git a/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h index 2a939f3d431dd2..8deaa031f571d6 100644 --- a/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h @@ -66,6 +66,7 @@ MatterFanControlPluginClientInitCallback(); \ MatterThermostatUserInterfaceConfigurationPluginClientInitCallback(); \ MatterColorControlPluginClientInitCallback(); \ + MatterBallastConfigurationPluginClientInitCallback(); \ MatterIlluminanceMeasurementPluginClientInitCallback(); \ MatterTemperatureMeasurementPluginClientInitCallback(); \ MatterPressureMeasurementPluginClientInitCallback(); \ diff --git a/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp b/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp index 43d9fce595d6bb..f8dee5d0e42608 100644 --- a/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp +++ b/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp @@ -47,6 +47,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_AUDIO_OUTPUT_CLUSTER_ID: emberAfAudioOutputClusterInitCallback(endpoint); break; + case ZCL_BALLAST_CONFIGURATION_CLUSTER_ID: + emberAfBallastConfigurationClusterInitCallback(endpoint); + break; case ZCL_BARRIER_CONTROL_CLUSTER_ID: emberAfBarrierControlClusterInitCallback(endpoint); break; @@ -257,6 +260,11 @@ void __attribute__((weak)) emberAfAudioOutputClusterInitCallback(EndpointId endp // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfBallastConfigurationClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfBarrierControlClusterInitCallback(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 209cb7cda99b59..e4a89d5793365f 100644 --- a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h +++ b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h @@ -79,7 +79,7 @@ #define GENERATED_FUNCTION_ARRAYS #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 64 +#define GENERATED_CLUSTER_COUNT 65 // clang-format off #define GENERATED_CLUSTERS { \ @@ -567,6 +567,17 @@ .acceptedCommandList = nullptr ,\ .generatedCommandList = nullptr ,\ },\ + { \ + /* Endpoint: 1, Cluster: Ballast Configuration (client) */ \ + .clusterId = 0x00000301, \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .acceptedCommandList = nullptr ,\ + .generatedCommandList = nullptr ,\ + },\ { \ /* Endpoint: 1, Cluster: Illuminance Measurement (client) */ \ .clusterId = 0x00000400, \ @@ -798,7 +809,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 64, 0 }, \ + { ZAP_CLUSTER_INDEX(0), 65, 0 }, \ } // Largest attribute size is needed for various buffers diff --git a/zzz_generated/controller-clusters/zap-generated/gen_config.h b/zzz_generated/controller-clusters/zap-generated/gen_config.h index bcb14dfe6829c4..b10de1afafc777 100644 --- a/zzz_generated/controller-clusters/zap-generated/gen_config.h +++ b/zzz_generated/controller-clusters/zap-generated/gen_config.h @@ -73,6 +73,7 @@ #define EMBER_AF_FAN_CONTROL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_THERMOSTAT_UI_CONFIG_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_COLOR_CONTROL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_BALLAST_CONFIGURATION_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_ILLUMINANCE_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_PRESSURE_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) @@ -272,6 +273,10 @@ #define ZCL_USING_COLOR_CONTROL_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_COLOR_CONTROL_CLIENT +// Use this macro to check if the client side of the Ballast Configuration cluster is included +#define ZCL_USING_BALLAST_CONFIGURATION_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_BALLAST_CONFIGURATION_CLIENT + // Use this macro to check if the client side of the Illuminance Measurement cluster is included #define ZCL_USING_ILLUMINANCE_MEASUREMENT_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_ILLUMINANCE_MEASUREMENT_CLIENT diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index db233e74c9e811..d4790c3e65d354 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -142,7 +142,6 @@ | ApplicationLauncher | 0x050C | | ApplicationBasic | 0x050D | | AccountLogin | 0x050E | -| Messaging | 0x0703 | | ApplianceIdentification | 0x0B00 | | MeterIdentification | 0x0B01 | | ApplianceEventsAndAlert | 0x0B02 | @@ -59554,6 +59553,1732 @@ class SubscribeAttributeColorControlClusterRevision : public SubscribeAttribute } }; +/*----------------------------------------------------------------------------*\ +| Cluster BallastConfiguration | 0x0301 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * PhysicalMinLevel | 0x0000 | +| * PhysicalMaxLevel | 0x0001 | +| * BallastStatus | 0x0002 | +| * MinLevel | 0x0010 | +| * MaxLevel | 0x0011 | +| * IntrinsicBalanceFactor | 0x0014 | +| * BallastFactorAdjustment | 0x0015 | +| * LampQuantity | 0x0020 | +| * LampType | 0x0030 | +| * LampManufacturer | 0x0031 | +| * LampRatedHours | 0x0032 | +| * LampBurnHours | 0x0033 | +| * LampAlarmMode | 0x0034 | +| * LampBurnHoursTripPoint | 0x0035 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Attribute PhysicalMinLevel + */ +class ReadBallastConfigurationPhysicalMinLevel : public ReadAttribute { +public: + ReadBallastConfigurationPhysicalMinLevel() + : ReadAttribute("physical-min-level") + { + } + + ~ReadBallastConfigurationPhysicalMinLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributePhysicalMinLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.PhysicalMinLevel response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration PhysicalMinLevel read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationPhysicalMinLevel : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationPhysicalMinLevel() + : SubscribeAttribute("physical-min-level") + { + } + + ~SubscribeAttributeBallastConfigurationPhysicalMinLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributePhysicalMinLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.PhysicalMinLevel response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute PhysicalMaxLevel + */ +class ReadBallastConfigurationPhysicalMaxLevel : public ReadAttribute { +public: + ReadBallastConfigurationPhysicalMaxLevel() + : ReadAttribute("physical-max-level") + { + } + + ~ReadBallastConfigurationPhysicalMaxLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributePhysicalMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.PhysicalMaxLevel response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration PhysicalMaxLevel read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationPhysicalMaxLevel : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationPhysicalMaxLevel() + : SubscribeAttribute("physical-max-level") + { + } + + ~SubscribeAttributeBallastConfigurationPhysicalMaxLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributePhysicalMaxLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.PhysicalMaxLevel response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute BallastStatus + */ +class ReadBallastConfigurationBallastStatus : public ReadAttribute { +public: + ReadBallastConfigurationBallastStatus() + : ReadAttribute("ballast-status") + { + } + + ~ReadBallastConfigurationBallastStatus() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeBallastStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.BallastStatus response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration BallastStatus read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationBallastStatus : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationBallastStatus() + : SubscribeAttribute("ballast-status") + { + } + + ~SubscribeAttributeBallastConfigurationBallastStatus() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBallastStatusWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.BallastStatus response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute MinLevel + */ +class ReadBallastConfigurationMinLevel : public ReadAttribute { +public: + ReadBallastConfigurationMinLevel() + : ReadAttribute("min-level") + { + } + + ~ReadBallastConfigurationMinLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000010) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeMinLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.MinLevel response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration MinLevel read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationMinLevel : public WriteAttribute { +public: + WriteBallastConfigurationMinLevel() + : WriteAttribute("min-level") + { + AddArgument("attr-name", "min-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationMinLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000010) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeMinLevelWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration MinLevel write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeBallastConfigurationMinLevel : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationMinLevel() + : SubscribeAttribute("min-level") + { + } + + ~SubscribeAttributeBallastConfigurationMinLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000010) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMinLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.MinLevel response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute MaxLevel + */ +class ReadBallastConfigurationMaxLevel : public ReadAttribute { +public: + ReadBallastConfigurationMaxLevel() + : ReadAttribute("max-level") + { + } + + ~ReadBallastConfigurationMaxLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000011) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeMaxLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.MaxLevel response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration MaxLevel read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationMaxLevel : public WriteAttribute { +public: + WriteBallastConfigurationMaxLevel() + : WriteAttribute("max-level") + { + AddArgument("attr-name", "max-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationMaxLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000011) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeMaxLevelWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration MaxLevel write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeBallastConfigurationMaxLevel : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationMaxLevel() + : SubscribeAttribute("max-level") + { + } + + ~SubscribeAttributeBallastConfigurationMaxLevel() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000011) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeMaxLevelWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.MaxLevel response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute IntrinsicBalanceFactor + */ +class ReadBallastConfigurationIntrinsicBalanceFactor : public ReadAttribute { +public: + ReadBallastConfigurationIntrinsicBalanceFactor() + : ReadAttribute("intrinsic-balance-factor") + { + } + + ~ReadBallastConfigurationIntrinsicBalanceFactor() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000014) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeIntrinsicBalanceFactorWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.IntrinsicBalanceFactor response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration IntrinsicBalanceFactor read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationIntrinsicBalanceFactor : public WriteAttribute { +public: + WriteBallastConfigurationIntrinsicBalanceFactor() + : WriteAttribute("intrinsic-balance-factor") + { + AddArgument("attr-name", "intrinsic-balance-factor"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationIntrinsicBalanceFactor() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000014) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeIntrinsicBalanceFactorWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration IntrinsicBalanceFactor write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeBallastConfigurationIntrinsicBalanceFactor : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationIntrinsicBalanceFactor() + : SubscribeAttribute("intrinsic-balance-factor") + { + } + + ~SubscribeAttributeBallastConfigurationIntrinsicBalanceFactor() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000014) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeIntrinsicBalanceFactorWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.IntrinsicBalanceFactor response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute BallastFactorAdjustment + */ +class ReadBallastConfigurationBallastFactorAdjustment : public ReadAttribute { +public: + ReadBallastConfigurationBallastFactorAdjustment() + : ReadAttribute("ballast-factor-adjustment") + { + } + + ~ReadBallastConfigurationBallastFactorAdjustment() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000015) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster + readAttributeBallastFactorAdjustmentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.BallastFactorAdjustment response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration BallastFactorAdjustment read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationBallastFactorAdjustment : public WriteAttribute { +public: + WriteBallastConfigurationBallastFactorAdjustment() + : WriteAttribute("ballast-factor-adjustment") + { + AddArgument("attr-name", "ballast-factor-adjustment"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationBallastFactorAdjustment() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000015) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeBallastFactorAdjustmentWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration BallastFactorAdjustment write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeBallastConfigurationBallastFactorAdjustment : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationBallastFactorAdjustment() + : SubscribeAttribute("ballast-factor-adjustment") + { + } + + ~SubscribeAttributeBallastConfigurationBallastFactorAdjustment() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000015) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBallastFactorAdjustmentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.BallastFactorAdjustment response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute LampQuantity + */ +class ReadBallastConfigurationLampQuantity : public ReadAttribute { +public: + ReadBallastConfigurationLampQuantity() + : ReadAttribute("lamp-quantity") + { + } + + ~ReadBallastConfigurationLampQuantity() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000020) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeLampQuantityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampQuantity response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration LampQuantity read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationLampQuantity : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationLampQuantity() + : SubscribeAttribute("lamp-quantity") + { + } + + ~SubscribeAttributeBallastConfigurationLampQuantity() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000020) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLampQuantityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampQuantity response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute LampType + */ +class ReadBallastConfigurationLampType : public ReadAttribute { +public: + ReadBallastConfigurationLampType() + : ReadAttribute("lamp-type") + { + } + + ~ReadBallastConfigurationLampType() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000030) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeLampTypeWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampType response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration LampType read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationLampType : public WriteAttribute { +public: + WriteBallastConfigurationLampType() + : WriteAttribute("lamp-type") + { + AddArgument("attr-name", "lamp-type"); + AddArgument("attr-value", &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationLampType() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000030) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() + length:mValue.size() + encoding:NSUTF8StringEncoding]; + + [cluster writeAttributeLampTypeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration LampType write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + chip::ByteSpan mValue; +}; + +class SubscribeAttributeBallastConfigurationLampType : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationLampType() + : SubscribeAttribute("lamp-type") + { + } + + ~SubscribeAttributeBallastConfigurationLampType() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000030) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLampTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampType response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute LampManufacturer + */ +class ReadBallastConfigurationLampManufacturer : public ReadAttribute { +public: + ReadBallastConfigurationLampManufacturer() + : ReadAttribute("lamp-manufacturer") + { + } + + ~ReadBallastConfigurationLampManufacturer() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000031) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeLampManufacturerWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampManufacturer response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration LampManufacturer read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationLampManufacturer : public WriteAttribute { +public: + WriteBallastConfigurationLampManufacturer() + : WriteAttribute("lamp-manufacturer") + { + AddArgument("attr-name", "lamp-manufacturer"); + AddArgument("attr-value", &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationLampManufacturer() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000031) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSString * _Nonnull value = [[NSString alloc] initWithBytes:mValue.data() + length:mValue.size() + encoding:NSUTF8StringEncoding]; + + [cluster writeAttributeLampManufacturerWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration LampManufacturer write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + chip::ByteSpan mValue; +}; + +class SubscribeAttributeBallastConfigurationLampManufacturer : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationLampManufacturer() + : SubscribeAttribute("lamp-manufacturer") + { + } + + ~SubscribeAttributeBallastConfigurationLampManufacturer() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000031) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLampManufacturerWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampManufacturer response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute LampRatedHours + */ +class ReadBallastConfigurationLampRatedHours : public ReadAttribute { +public: + ReadBallastConfigurationLampRatedHours() + : ReadAttribute("lamp-rated-hours") + { + } + + ~ReadBallastConfigurationLampRatedHours() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000032) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeLampRatedHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampRatedHours response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration LampRatedHours read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationLampRatedHours : public WriteAttribute { +public: + WriteBallastConfigurationLampRatedHours() + : WriteAttribute("lamp-rated-hours") + { + AddArgument("attr-name", "lamp-rated-hours"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationLampRatedHours() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000032) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + + [cluster writeAttributeLampRatedHoursWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration LampRatedHours write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint32_t mValue; +}; + +class SubscribeAttributeBallastConfigurationLampRatedHours : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationLampRatedHours() + : SubscribeAttribute("lamp-rated-hours") + { + } + + ~SubscribeAttributeBallastConfigurationLampRatedHours() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000032) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLampRatedHoursWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampRatedHours response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute LampBurnHours + */ +class ReadBallastConfigurationLampBurnHours : public ReadAttribute { +public: + ReadBallastConfigurationLampBurnHours() + : ReadAttribute("lamp-burn-hours") + { + } + + ~ReadBallastConfigurationLampBurnHours() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000033) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeLampBurnHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampBurnHours response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration LampBurnHours read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationLampBurnHours : public WriteAttribute { +public: + WriteBallastConfigurationLampBurnHours() + : WriteAttribute("lamp-burn-hours") + { + AddArgument("attr-name", "lamp-burn-hours"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationLampBurnHours() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000033) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + + [cluster writeAttributeLampBurnHoursWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration LampBurnHours write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint32_t mValue; +}; + +class SubscribeAttributeBallastConfigurationLampBurnHours : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationLampBurnHours() + : SubscribeAttribute("lamp-burn-hours") + { + } + + ~SubscribeAttributeBallastConfigurationLampBurnHours() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000033) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLampBurnHoursWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampBurnHours response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute LampAlarmMode + */ +class ReadBallastConfigurationLampAlarmMode : public ReadAttribute { +public: + ReadBallastConfigurationLampAlarmMode() + : ReadAttribute("lamp-alarm-mode") + { + } + + ~ReadBallastConfigurationLampAlarmMode() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000034) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeLampAlarmModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampAlarmMode response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration LampAlarmMode read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationLampAlarmMode : public WriteAttribute { +public: + WriteBallastConfigurationLampAlarmMode() + : WriteAttribute("lamp-alarm-mode") + { + AddArgument("attr-name", "lamp-alarm-mode"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationLampAlarmMode() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000034) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeLampAlarmModeWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration LampAlarmMode write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeBallastConfigurationLampAlarmMode : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationLampAlarmMode() + : SubscribeAttribute("lamp-alarm-mode") + { + } + + ~SubscribeAttributeBallastConfigurationLampAlarmMode() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000034) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLampAlarmModeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampAlarmMode response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute LampBurnHoursTripPoint + */ +class ReadBallastConfigurationLampBurnHoursTripPoint : public ReadAttribute { +public: + ReadBallastConfigurationLampBurnHoursTripPoint() + : ReadAttribute("lamp-burn-hours-trip-point") + { + } + + ~ReadBallastConfigurationLampBurnHoursTripPoint() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x00000035) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeLampBurnHoursTripPointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampBurnHoursTripPoint response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration LampBurnHoursTripPoint read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBallastConfigurationLampBurnHoursTripPoint : public WriteAttribute { +public: + WriteBallastConfigurationLampBurnHoursTripPoint() + : WriteAttribute("lamp-burn-hours-trip-point") + { + AddArgument("attr-name", "lamp-burn-hours-trip-point"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteBallastConfigurationLampBurnHoursTripPoint() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) WriteAttribute (0x00000035) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRWriteParams * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + + [cluster writeAttributeLampBurnHoursTripPointWithValue:value + params:params + completionHandler:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BallastConfiguration LampBurnHoursTripPoint write Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint32_t mValue; +}; + +class SubscribeAttributeBallastConfigurationLampBurnHoursTripPoint : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationLampBurnHoursTripPoint() + : SubscribeAttribute("lamp-burn-hours-trip-point") + { + } + + ~SubscribeAttributeBallastConfigurationLampBurnHoursTripPoint() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x00000035) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeLampBurnHoursTripPointWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.LampBurnHoursTripPoint response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadBallastConfigurationGeneratedCommandList : public ReadAttribute { +public: + ReadBallastConfigurationGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadBallastConfigurationGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.GeneratedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration GeneratedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeBallastConfigurationGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeGeneratedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.GeneratedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadBallastConfigurationAcceptedCommandList : public ReadAttribute { +public: + ReadBallastConfigurationAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadBallastConfigurationAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.AcceptedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration AcceptedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeBallastConfigurationAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAcceptedCommandListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.AcceptedCommandList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AttributeList + */ +class ReadBallastConfigurationAttributeList : public ReadAttribute { +public: + ReadBallastConfigurationAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadBallastConfigurationAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.AttributeList response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration AttributeList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeBallastConfigurationAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeAttributeListWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.AttributeList response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute FeatureMap + */ +class ReadBallastConfigurationFeatureMap : public ReadAttribute { +public: + ReadBallastConfigurationFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadBallastConfigurationFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.FeatureMap response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration FeatureMap read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeBallastConfigurationFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeFeatureMapWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.FeatureMap response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadBallastConfigurationClusterRevision : public ReadAttribute { +public: + ReadBallastConfigurationClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadBallastConfigurationClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.ClusterRevision response %@", [value description]); + if (error != nil) { + LogNSError("BallastConfiguration ClusterRevision read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBallastConfigurationClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeBallastConfigurationClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeBallastConfigurationClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000301) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + MTRBaseClusterBallastConfiguration * cluster = [[MTRBaseClusterBallastConfiguration alloc] initWithDevice:device + endpoint:endpointId + queue:callbackQueue]; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeClusterRevisionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BallastConfiguration.ClusterRevision response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } +}; + /*----------------------------------------------------------------------------*\ | Cluster IlluminanceMeasurement | 0x0400 | |------------------------------------------------------------------------------| @@ -95786,6 +97511,69 @@ void registerClusterColorControl(Commands & commands) commands.Register(clusterName, clusterCommands); } +void registerClusterBallastConfiguration(Commands & commands) +{ + using namespace chip::app::Clusters::BallastConfiguration; + + const char * clusterName = "BallastConfiguration"; + + commands_list clusterCommands = { + make_unique(Id), // + make_unique(Id), // + make_unique(), // + make_unique(Id), // + make_unique(Id), // + 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(), // + 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(), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterIlluminanceMeasurement(Commands & commands) { using namespace chip::app::Clusters::IlluminanceMeasurement; @@ -97056,6 +98844,7 @@ void registerClusters(Commands & commands) registerClusterFanControl(commands); registerClusterThermostatUserInterfaceConfiguration(commands); registerClusterColorControl(commands); + registerClusterBallastConfiguration(commands); registerClusterIlluminanceMeasurement(commands); registerClusterTemperatureMeasurement(commands); registerClusterPressureMeasurement(commands); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 57ab8802b38cdd..57cceb1bfc1640 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -57,7 +57,6 @@ class TestList : public Command { printf("Test_TC_CC_7_3\n"); printf("Test_TC_CC_7_4\n"); printf("Test_TC_CC_8_1\n"); - printf("Test_TC_BINFO_2_1\n"); printf("Test_TC_DESC_1_1\n"); printf("Test_TC_DGETH_2_1\n"); printf("Test_TC_DGETH_2_2\n"); @@ -187,6 +186,7 @@ class TestList : public Command { printf("TestConfigVariables\n"); printf("TestDescriptorCluster\n"); printf("TestBasicInformation\n"); + printf("TestFabricRemovalWhileSubscribed\n"); printf("TestGeneralCommissioning\n"); printf("TestIdentifyCluster\n"); printf("TestOperationalCredentialsCluster\n"); @@ -3002,480 +3002,424 @@ class Test_TC_CC_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Validate constraints of attribute: CurrentHue\n"); - if (ShouldSkip("CC.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads CurrentHue attribute from DUT\n"); + if (ShouldSkip("CC.S.A0000 && CC.S.F00")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributeCurrentHue_1(); + err = TestThReadsCurrentHueAttributeFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Validate constraints of attribute: CurrentSaturation\n"); - if (ShouldSkip("CC.S.A0001")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads CurrentSaturation attribute from DUT\n"); + if (ShouldSkip("CC.S.A0001 && CC.S.F00")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributeCurrentSaturation_2(); + err = TestThReadsCurrentSaturationAttributeFromDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentX attribute from DUT\n"); - if (ShouldSkip("CC.S.A0003")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads RemainingTime attribute from DUT\n"); + if (ShouldSkip("CC.S.A0002")) { NextTest(); return; } - err = TestReadsCurrentXAttributeFromDut_3(); + err = TestThReadsRemainingTimeAttributeFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Validate constraints of attribute: CurrentX\n"); - if (ShouldSkip("CC.S.A0003")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads CurrentX attribute from DUT\n"); + if (ShouldSkip("CC.S.A0003 && CC.S.F03")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributeCurrentX_4(); + err = TestThReadsCurrentXAttributeFromDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reads CurrentY attribute from DUT\n"); - if (ShouldSkip("CC.S.A0004")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads CurrentY attribute from DUT\n"); + if (ShouldSkip("CC.S.A0004 && CC.S.F04")) { NextTest(); return; } - err = TestReadsCurrentYAttributeFromDut_5(); + err = TestThReadsCurrentYAttributeFromDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Validate constraints of attribute: CurrentY\n"); - if (ShouldSkip("CC.S.A0004")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads DriftCompensation attribute from DUT\n"); + if (ShouldSkip("CC.S.A0005")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributeCurrentY_6(); + err = TestThReadsDriftCompensationAttributeFromDut_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Reads ColorTemperatureMireds attribute from DUT\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads CompensationText attribute from DUT\n"); + if (ShouldSkip("CC.S.A0005")) { NextTest(); return; } - err = TestReadsColorTemperatureMiredsAttributeFromDut_7(); + err = TestThReadsCompensationTextAttributeFromDut_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Validate constraints of attribute: ColorTemperatureMireds\n"); - if (ShouldSkip("CC.S.A0007")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads ColorTemperatureMireds attribute from DUT\n"); + if (ShouldSkip("CC.S.A0007 && CC.S.F04")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributeColorTemperatureMireds_8(); + err = TestThReadsColorTemperatureMiredsAttributeFromDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Reads ColorMode attribute from DUT\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads ColorMode attribute from DUT\n"); + if (ShouldSkip("CC.S.A0008")) { NextTest(); return; } - err = TestReadsColorModeAttributeFromDut_9(); + err = TestThReadsColorModeAttributeFromDut_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Validate constraints of attribute: ColorMode\n"); - if (ShouldSkip("CC.S.A0008")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads Options attribute from DUT\n"); + if (ShouldSkip("CC.S.A000f")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributeColorMode_10(); + err = TestThReadsOptionsAttributeFromDut_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Validate constraints of attribute: Options\n"); - if (ShouldSkip("CC.S.A000f")) { + ChipLogProgress(chipTool, " ***** Test Step 11 : TH reads EnhancedCurrentHue attribute from DUT\n"); + if (ShouldSkip("CC.S.A4000 && CC.S.F01")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributeOptions_11(); + err = TestThReadsEnhancedCurrentHueAttributeFromDut_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Validate constraints of attribute: EnhancedCurrentHue\n"); - if (ShouldSkip("CC.S.A4000")) { + ChipLogProgress(chipTool, " ***** Test Step 12 : TH reads EnhancedColorMode attribute from DUT\n"); + if (ShouldSkip("CC.S.F02 && CC.S.A4001")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributeEnhancedCurrentHue_12(); + err = TestThReadsEnhancedColorModeAttributeFromDut_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Validate constraints of attribute: EnhancedColorMode\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads ColorLoopActive attribute from DUT\n"); + if (ShouldSkip("CC.S.A4002 && CC.S.F02")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributeEnhancedColorMode_13(); + err = TestThReadsColorLoopActiveAttributeFromDut_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Validate constraints of attribute: ColorLoopActive\n"); - if (ShouldSkip("CC.S.A4002")) { + ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads ColorLoopDirection attribute from DUT\n"); + if (ShouldSkip("CC.S.A4003 && CC.S.F02")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributeColorLoopActive_14(); + err = TestThReadsColorLoopDirectionAttributeFromDut_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Validate constraints of attribute: ColorLoopDirection\n"); - if (ShouldSkip("CC.S.A4003")) { + ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads ColorLoopTime attribute from DUT\n"); + if (ShouldSkip("CC.S.A4004 && CC.S.F02")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributeColorLoopDirection_15(); + err = TestThReadsColorLoopTimeAttributeFromDut_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Validate constraints of attribute: ColorLoopTime\n"); - if (ShouldSkip("CC.S.A4004")) { + ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads ColorLoopStartEnhancedHue attribute from DUT\n"); + if (ShouldSkip("CC.S.A4005 && CC.S.F02")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributeColorLoopTime_16(); + err = TestThReadsColorLoopStartEnhancedHueAttributeFromDut_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Validate constraints of attribute: ColorLoopStartEnhancedHue\n"); - if (ShouldSkip("CC.S.A4005")) { + ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads ColorLoopStoredEnhancedHue attribute from DUT\n"); + if (ShouldSkip("CC.S.A4006 && CC.S.F02")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributeColorLoopStartEnhancedHue_17(); + err = TestThReadsColorLoopStoredEnhancedHueAttributeFromDut_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Validate constraints of attribute: ColorLoopStoredEnhancedHue\n"); - if (ShouldSkip("CC.S.A4006")) { + ChipLogProgress(chipTool, " ***** Test Step 18 : TH reads FeatureMap attribute from DUT\n"); + err = TestThReadsFeatureMapAttributeFromDut_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : TH reads ColorCapabilities attribute from DUT\n"); + if (ShouldSkip("CC.S.A400a")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributeColorLoopStoredEnhancedHue_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : read the optional global attribute: FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeFeatureMap_19(); + err = TestThReadsColorCapabilitiesAttributeFromDut_19(); break; case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Reads ColorCapabilities attribute from DUT\n"); - if (ShouldSkip("CC.S.A400a")) { + ChipLogProgress(chipTool, " ***** Test Step 20 : TH reads ColorTempPhysicalMinMireds attribute from DUT\n"); + if (ShouldSkip("CC.S.A400b && CC.S.F04")) { NextTest(); return; } - err = TestReadsColorCapabilitiesAttributeFromDut_20(); + err = TestThReadsColorTempPhysicalMinMiredsAttributeFromDut_20(); break; case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Validate constraints of attribute: ColorCapabilities\n"); - if (ShouldSkip("CC.S.A400a")) { + ChipLogProgress(chipTool, " ***** Test Step 21 : TH reads ColorTempPhysicalMaxMireds attribute from DUT\n"); + if (ShouldSkip("CC.S.A400c && CC.S.F04")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributeColorCapabilities_21(); + err = TestThReadsColorTempPhysicalMaxMiredsAttributeFromDut_21(); break; case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Reads ColorTempPhysicalMinMireds attribute from DUT\n"); - if (ShouldSkip("CC.S.A400b")) { + ChipLogProgress(chipTool, " ***** Test Step 22 : TH reads CoupleColorTempToLevelMinMireds attribute from DUT\n"); + if (ShouldSkip("CC.S.A400d && CC.S.F04")) { NextTest(); return; } - err = TestReadsColorTempPhysicalMinMiredsAttributeFromDut_22(); + err = TestThReadsCoupleColorTempToLevelMinMiredsAttributeFromDut_22(); break; case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Validate constraints of attribute: ColorTempPhysicalMinMireds\n"); - if (ShouldSkip("CC.S.A400b")) { + ChipLogProgress(chipTool, " ***** Test Step 23 : TH reads StartUpColorTemperatureMireds attribute from DUT\n"); + if (ShouldSkip("CC.S.A4010 && CC.S.F04")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributeColorTempPhysicalMinMireds_23(); + err = TestThReadsStartUpColorTemperatureMiredsAttributeFromDut_23(); break; case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Read ColorTempPhysicalMaxMireds attribute from DUT\n"); - if (ShouldSkip("CC.S.A400c")) { - NextTest(); - return; - } - err = TestReadColorTempPhysicalMaxMiredsAttributeFromDut_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Validate constraints of attribute: ColorTempPhysicalMaxMireds\n"); - if (ShouldSkip("CC.S.A400c")) { - NextTest(); - return; - } - err = TestValidateConstraintsOfAttributeColorTempPhysicalMaxMireds_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Read the optional attribute: CoupleColorTempToLevelMinMireds\n"); - if (ShouldSkip("CC.S.A400d")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributeCoupleColorTempToLevelMinMireds_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Read the optional attribute: StartUpColorTemperatureMireds\n"); - if (ShouldSkip("CC.S.A4010")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributeStartUpColorTemperatureMireds_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Validate constraints of attribute: RemainingTime\n"); - if (ShouldSkip("CC.S.A0002")) { - NextTest(); - return; - } - err = TestValidateConstraintsOfAttributeRemainingTime_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Read the optional attribute: DriftCompensation\n"); - if (ShouldSkip("CC.S.A0005")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributeDriftCompensation_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Read the optional attribute: CompensationText\n"); - if (ShouldSkip("CC.S.A0005")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributeCompensationText_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Read the mandatory attribute: NumberOfPrimaries\n"); + ChipLogProgress(chipTool, " ***** Test Step 24 : TH reads NumberOfPrimaries attribute from DUT\n"); if (ShouldSkip("CC.S.A0010")) { NextTest(); return; } - err = TestReadTheMandatoryAttributeNumberOfPrimaries_31(); + err = TestThReadsNumberOfPrimariesAttributeFromDut_24(); break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : Read the mandatory attribute: Primary1X\n"); + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : TH reads Primary1X attribute from DUT\n"); if (ShouldSkip("CC.S.A0011")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary1X_32(); + err = TestThReadsPrimary1XAttributeFromDut_25(); break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : Read the mandatory attribute: Primary1Y\n"); + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : TH reads Primary1Y attribute from DUT\n"); if (ShouldSkip("CC.S.A0012")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary1Y_33(); + err = TestThReadsPrimary1YAttributeFromDut_26(); break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : Read the mandatory attribute: Primary1Intensity\n"); + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : TH reads Primary1Intensity attribute from DUT\n"); if (ShouldSkip("CC.S.A0013")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary1Intensity_34(); + err = TestThReadsPrimary1IntensityAttributeFromDut_27(); break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : Read the mandatory attribute: Primary2X\n"); + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : TH reads Primary2X attribute from DUT\n"); if (ShouldSkip("CC.S.A0015")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary2X_35(); + err = TestThReadsPrimary2XAttributeFromDut_28(); break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Read the mandatory attribute: Primary2Y\n"); + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : TH reads Primary2Y attribute from DUT\n"); if (ShouldSkip("CC.S.A0016")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary2Y_36(); + err = TestThReadsPrimary2YAttributeFromDut_29(); break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : Validate constraints of attribute: Primary2Intensity\n"); + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : TH reads Primary2Intensity attribute from DUT\n"); if (ShouldSkip("CC.S.A0017")) { NextTest(); return; } - err = TestValidateConstraintsOfAttributePrimary2Intensity_37(); + err = TestThReadsPrimary2IntensityAttributeFromDut_30(); break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Read the mandatory attribute: Primary3X\n"); + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : TH reads Primary3X attribute from DUT\n"); if (ShouldSkip("CC.S.A0019")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary3X_38(); + err = TestThReadsPrimary3XAttributeFromDut_31(); break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Read the mandatory attribute: Primary3Y\n"); + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : TH reads Primary3Y attribute from DUT\n"); if (ShouldSkip("CC.S.A001a")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary3Y_39(); + err = TestThReadsPrimary3YAttributeFromDut_32(); break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : Read the mandatory attribute: Primary3Intensity\n"); + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : TH reads Primary3Intensity attribute from DUT\n"); if (ShouldSkip("CC.S.A001b")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary3Intensity_40(); + err = TestThReadsPrimary3IntensityAttributeFromDut_33(); break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : Read the mandatory attribute: Primary4X\n"); + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : TH reads Primary4X attribute from DUT\n"); if (ShouldSkip("CC.S.A0020")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary4X_41(); + err = TestThReadsPrimary4XAttributeFromDut_34(); break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Read the mandatory attribute: Primary4Y\n"); + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : TH reads Primary4Y attribute from DUT\n"); if (ShouldSkip("CC.S.A0021")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary4Y_42(); + err = TestThReadsPrimary4YAttributeFromDut_35(); break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Read the mandatory attribute: Primary4Intensity\n"); + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : TH reads Primary4Intensity attribute from DUT\n"); if (ShouldSkip("CC.S.A0022")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary4Intensity_43(); + err = TestThReadsPrimary4IntensityAttributeFromDut_36(); break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Read the mandatory attribute: Primary5X\n"); + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : TH reads Primary5X attribute from DUT\n"); if (ShouldSkip("CC.S.A0024")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary5X_44(); + err = TestThReadsPrimary5XAttributeFromDut_37(); break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Read the mandatory attribute: Primary5Y\n"); + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : TH reads Primary5Y attribute from DUT\n"); if (ShouldSkip("CC.S.A0025")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary5Y_45(); + err = TestThReadsPrimary5YAttributeFromDut_38(); break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Read the mandatory attribute: Primary5Intensity\n"); + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : TH reads Primary5Intensity attribute from DUT\n"); if (ShouldSkip("CC.S.A0026")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary5Intensity_46(); + err = TestThReadsPrimary5IntensityAttributeFromDut_39(); break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Read the mandatory attribute: Primary6X\n"); + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : TH reads Primary6X attribute from DUT\n"); if (ShouldSkip("CC.S.A0028")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary6X_47(); + err = TestThReadsPrimary6XAttributeFromDut_40(); break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Read the mandatory attribute: Primary6Y\n"); + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : TH reads Primary6Y attribute from DUT\n"); if (ShouldSkip("CC.S.A0029")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary6Y_48(); + err = TestThReadsPrimary6YAttributeFromDut_41(); break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Read the mandatory attribute: Primary6Intensity\n"); + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : TH reads Primary6Intensity attribute from DUT\n"); if (ShouldSkip("CC.S.A002a")) { NextTest(); return; } - err = TestReadTheMandatoryAttributePrimary6Intensity_49(); + err = TestThReadsPrimary6IntensityAttributeFromDut_42(); break; - case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Read the optional attribute: WhitePointX\n"); + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : TH reads WhitePointX attribute from DUT\n"); if (ShouldSkip("CC.S.A0030")) { NextTest(); return; } - err = TestReadTheOptionalAttributeWhitePointX_50(); + err = TestThReadsWhitePointXAttributeFromDut_43(); break; - case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : Read the optional attribute: WhitePointY\n"); + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : TH reads WhitePointY attribute from DUT\n"); if (ShouldSkip("CC.S.A0031")) { NextTest(); return; } - err = TestReadTheOptionalAttributeWhitePointY_51(); + err = TestThReadsWhitePointYAttributeFromDut_44(); break; - case 52: - ChipLogProgress(chipTool, " ***** Test Step 52 : Read the optional attribute: ColorPointRX\n"); + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : TH reads ColorPointRX attribute from DUT\n"); if (ShouldSkip("CC.S.A0032")) { NextTest(); return; } - err = TestReadTheOptionalAttributeColorPointRX_52(); + err = TestThReadsColorPointRXAttributeFromDut_45(); break; - case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Read the optional attribute: ColorPointRY\n"); + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : TH reads ColorPointRY attribute from DUT\n"); if (ShouldSkip("CC.S.A0033")) { NextTest(); return; } - err = TestReadTheOptionalAttributeColorPointRY_53(); + err = TestThReadsColorPointRYAttributeFromDut_46(); break; - case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : Read the optional attribute: ColorPointRIntensity\n"); + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : TH reads ColorPointRIntensity attribute from DUT\n"); if (ShouldSkip("CC.S.A0034")) { NextTest(); return; } - err = TestReadTheOptionalAttributeColorPointRIntensity_54(); + err = TestThReadsColorPointRIntensityAttributeFromDut_47(); break; - case 55: - ChipLogProgress(chipTool, " ***** Test Step 55 : Read the optional attribute: ColorPointGX\n"); + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : TH reads ColorPointGX attribute from DUT\n"); if (ShouldSkip("CC.S.A0036")) { NextTest(); return; } - err = TestReadTheOptionalAttributeColorPointGX_55(); + err = TestThReadsColorPointGXAttributeFromDut_48(); break; - case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : Read the optional attribute: ColorPointGY\n"); + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : TH reads ColorPointGY attribute from DUT\n"); if (ShouldSkip("CC.S.A0037")) { NextTest(); return; } - err = TestReadTheOptionalAttributeColorPointGY_56(); + err = TestThReadsColorPointGYAttributeFromDut_49(); break; - case 57: - ChipLogProgress(chipTool, " ***** Test Step 57 : Read the optional attribute: ColorPointGIntensity\n"); + case 50: + ChipLogProgress(chipTool, " ***** Test Step 50 : TH reads ColorPointGIntensity attribute from DUT\n"); if (ShouldSkip("CC.S.A0038")) { NextTest(); return; } - err = TestReadTheOptionalAttributeColorPointGIntensity_57(); + err = TestThReadsColorPointGIntensityAttributeFromDut_50(); break; - case 58: - ChipLogProgress(chipTool, " ***** Test Step 58 : Read the optional attribute: ColorPointBX\n"); + case 51: + ChipLogProgress(chipTool, " ***** Test Step 51 : TH reads ColorPointBX attribute from DUT\n"); if (ShouldSkip("CC.S.A003a")) { NextTest(); return; } - err = TestReadTheOptionalAttributeColorPointBX_58(); + err = TestThReadsColorPointBXAttributeFromDut_51(); break; - case 59: - ChipLogProgress(chipTool, " ***** Test Step 59 : Read the optional attribute: ColorPointBY\n"); + case 52: + ChipLogProgress(chipTool, " ***** Test Step 52 : TH reads ColorPointBY attribute from DUT\n"); if (ShouldSkip("CC.S.A003b")) { NextTest(); return; } - err = TestReadTheOptionalAttributeColorPointBY_59(); + err = TestThReadsColorPointBYAttributeFromDut_52(); break; - case 60: - ChipLogProgress(chipTool, " ***** Test Step 60 : Read the optional attribute: ColorPointBIntensity\n"); + case 53: + ChipLogProgress(chipTool, " ***** Test Step 53 : TH reads ColorPointBIntensity attribute from DUT\n"); if (ShouldSkip("CC.S.A003c")) { NextTest(); return; } - err = TestReadTheOptionalAttributeColorPointBIntensity_60(); + err = TestThReadsColorPointBIntensityAttributeFromDut_53(); break; } @@ -3650,27 +3594,6 @@ class Test_TC_CC_2_1 : public TestCommandBridge { case 53: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 54: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 55: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 56: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 57: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 58: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 59: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 60: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -3684,7 +3607,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 61; + const uint16_t mTestCount = 54; chip::Optional mNodeId; chip::Optional mCluster; @@ -3698,7 +3621,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestValidateConstraintsOfAttributeCurrentHue_1() + CHIP_ERROR TestThReadsCurrentHueAttributeFromDut_1() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -3707,15 +3630,10 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: CurrentHue Error: %@", err); + NSLog(@"TH reads CurrentHue attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentHue", actualValue, 0U)); - } - VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); NextTest(); }]; @@ -3723,7 +3641,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeCurrentSaturation_2() + CHIP_ERROR TestThReadsCurrentSaturationAttributeFromDut_2() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -3732,15 +3650,10 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: CurrentSaturation Error: %@", err); + NSLog(@"TH reads CurrentSaturation attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentSaturation", actualValue, 0U)); - } - VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); NextTest(); }]; @@ -3748,7 +3661,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentXAttributeFromDut_3() + CHIP_ERROR TestThReadsRemainingTimeAttributeFromDut_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -3756,23 +3669,19 @@ class Test_TC_CC_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentX attribute from DUT Error: %@", err); + [cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads RemainingTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentX", actualValue, 24939U)); - } - + VerifyOrReturn(CheckConstraintType("remainingTime", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeCurrentX_4() + CHIP_ERROR TestThReadsCurrentXAttributeFromDut_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -3781,7 +3690,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: CurrentX Error: %@", err); + NSLog(@"TH reads CurrentX attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -3795,7 +3704,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentYAttributeFromDut_5() + CHIP_ERROR TestThReadsCurrentYAttributeFromDut_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -3804,14 +3713,13 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentY attribute from DUT Error: %@", err); + NSLog(@"TH reads CurrentY attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentY", actualValue, 24701U)); - } + VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("currentY", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("currentY", [value unsignedShortValue], 65279U)); NextTest(); }]; @@ -3819,7 +3727,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeCurrentY_6() + CHIP_ERROR TestThReadsDriftCompensationAttributeFromDut_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -3827,14 +3735,14 @@ class Test_TC_CC_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: CurrentY Error: %@", err); + [cluster readAttributeDriftCompensationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads DriftCompensation attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); - VerifyOrReturn(CheckConstraintMinValue("currentY", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("currentY", [value unsignedShortValue], 65279U)); + VerifyOrReturn(CheckConstraintType("driftCompensation", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("driftCompensation", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("driftCompensation", [value unsignedCharValue], 4U)); NextTest(); }]; @@ -3842,7 +3750,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsColorTemperatureMiredsAttributeFromDut_7() + CHIP_ERROR TestThReadsCompensationTextAttributeFromDut_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -3850,23 +3758,20 @@ class Test_TC_CC_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads ColorTemperatureMireds attribute from DUT Error: %@", err); + [cluster readAttributeCompensationTextWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads CompensationText attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ColorTemperature", actualValue, 250U)); - } - + VerifyOrReturn(CheckConstraintType("compensationText", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("compensationText", [value length], 254)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeColorTemperatureMireds_8() + CHIP_ERROR TestThReadsColorTemperatureMiredsAttributeFromDut_8() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -3875,7 +3780,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorTemperatureMireds Error: %@", err); + NSLog(@"TH reads ColorTemperatureMireds attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -3889,31 +3794,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsColorModeAttributeFromDut_9() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads ColorMode attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("ColorMode", actualValue, 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorMode_10() + CHIP_ERROR TestThReadsColorModeAttributeFromDut_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -3922,7 +3803,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorMode Error: %@", err); + NSLog(@"TH reads ColorMode attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -3936,7 +3817,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeOptions_11() + CHIP_ERROR TestThReadsOptionsAttributeFromDut_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -3945,23 +3826,21 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeOptionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: Options Error: %@", err); + NSLog(@"TH reads Options attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Options", actualValue, 0U)); - } + VerifyOrReturn(CheckConstraintType("options", "", "bitmap8")); + VerifyOrReturn(CheckConstraintMinValue("options", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("options", [value unsignedCharValue], 4U)); - VerifyOrReturn(CheckConstraintType("options", "", "map8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeEnhancedCurrentHue_12() + CHIP_ERROR TestThReadsEnhancedCurrentHueAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -3970,15 +3849,10 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: EnhancedCurrentHue Error: %@", err); + NSLog(@"TH reads EnhancedCurrentHue attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("EnhancedCurrentHue", actualValue, 0U)); - } - VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); NextTest(); }]; @@ -3986,7 +3860,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeEnhancedColorMode_13() + CHIP_ERROR TestThReadsEnhancedColorModeAttributeFromDut_12() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -3995,23 +3869,21 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeEnhancedColorModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: EnhancedColorMode Error: %@", err); + NSLog(@"TH reads EnhancedColorMode attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("EnhancedColorMode", actualValue, 1U)); - } - VerifyOrReturn(CheckConstraintType("enhancedColorMode", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("enhancedColorMode", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("enhancedColorMode", [value unsignedCharValue], 3U)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopActive_14() + CHIP_ERROR TestThReadsColorLoopActiveAttributeFromDut_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4020,15 +3892,10 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorLoopActive Error: %@", err); + NSLog(@"TH reads ColorLoopActive attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ColorLoopActive", actualValue, 0U)); - } - VerifyOrReturn(CheckConstraintType("colorLoopActive", "", "uint8")); NextTest(); }]; @@ -4036,7 +3903,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopDirection_15() + CHIP_ERROR TestThReadsColorLoopDirectionAttributeFromDut_14() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4045,15 +3912,10 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorLoopDirection Error: %@", err); + NSLog(@"TH reads ColorLoopDirection attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ColorLoopDirection", actualValue, 0U)); - } - VerifyOrReturn(CheckConstraintType("colorLoopDirection", "", "uint8")); NextTest(); }]; @@ -4061,7 +3923,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopTime_16() + CHIP_ERROR TestThReadsColorLoopTimeAttributeFromDut_15() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4070,15 +3932,10 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorLoopTime Error: %@", err); + NSLog(@"TH reads ColorLoopTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ColorLoopTime", actualValue, 25U)); - } - VerifyOrReturn(CheckConstraintType("colorLoopTime", "", "uint16")); NextTest(); }]; @@ -4086,7 +3943,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopStartEnhancedHue_17() + CHIP_ERROR TestThReadsColorLoopStartEnhancedHueAttributeFromDut_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4096,15 +3953,10 @@ class Test_TC_CC_2_1 : public TestCommandBridge { [cluster readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorLoopStartEnhancedHue Error: %@", err); + NSLog(@"TH reads ColorLoopStartEnhancedHue attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ColorLoopStartEnhancedHue", actualValue, 8960U)); - } - VerifyOrReturn(CheckConstraintType("colorLoopStartEnhancedHue", "", "uint16")); NextTest(); }]; @@ -4112,7 +3964,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeColorLoopStoredEnhancedHue_18() + CHIP_ERROR TestThReadsColorLoopStoredEnhancedHueAttributeFromDut_17() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4122,15 +3974,10 @@ class Test_TC_CC_2_1 : public TestCommandBridge { [cluster readAttributeColorLoopStoredEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorLoopStoredEnhancedHue Error: %@", err); + NSLog(@"TH reads ColorLoopStoredEnhancedHue attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ColorLoopStoredEnhancedHue", actualValue, 0U)); - } - VerifyOrReturn(CheckConstraintType("colorLoopStoredEnhancedHue", "", "uint16")); NextTest(); }]; @@ -4139,7 +3986,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { } NSNumber * _Nonnull FeatureMapValue; - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_19() + CHIP_ERROR TestThReadsFeatureMapAttributeFromDut_18() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4148,7 +3995,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional global attribute: FeatureMap Error: %@", err); + NSLog(@"TH reads FeatureMap attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4162,7 +4009,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsColorCapabilitiesAttributeFromDut_20() + CHIP_ERROR TestThReadsColorCapabilitiesAttributeFromDut_19() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4171,7 +4018,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeColorCapabilitiesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads ColorCapabilities attribute from DUT Error: %@", err); + NSLog(@"TH reads ColorCapabilities attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4180,25 +4027,6 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("ColorCapabilities", actualValue, FeatureMapValue)); } - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorCapabilities_21() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeColorCapabilitiesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorCapabilities Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("colorCapabilities", "", "map16")); VerifyOrReturn(CheckConstraintMinValue("colorCapabilities", [value unsignedShortValue], 0U)); VerifyOrReturn(CheckConstraintMaxValue("colorCapabilities", [value unsignedShortValue], 31U)); @@ -4209,32 +4037,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsColorTempPhysicalMinMiredsAttributeFromDut_22() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster - readAttributeColorTempPhysicalMinMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads ColorTempPhysicalMinMireds attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("ColorTempPhysicalMinMireds", actualValue, 0U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorTempPhysicalMinMireds_23() + CHIP_ERROR TestThReadsColorTempPhysicalMinMiredsAttributeFromDut_20() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4244,7 +4047,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { [cluster readAttributeColorTempPhysicalMinMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorTempPhysicalMinMireds Error: %@", err); + NSLog(@"TH reads ColorTempPhysicalMinMireds attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4258,7 +4061,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadColorTempPhysicalMaxMiredsAttributeFromDut_24() + CHIP_ERROR TestThReadsColorTempPhysicalMaxMiredsAttributeFromDut_21() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4268,32 +4071,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { [cluster readAttributeColorTempPhysicalMaxMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read ColorTempPhysicalMaxMireds attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("ColorTempPhysicalMaxMireds", actualValue, 65279U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestValidateConstraintsOfAttributeColorTempPhysicalMaxMireds_25() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster - readAttributeColorTempPhysicalMaxMiredsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: ColorTempPhysicalMaxMireds Error: %@", err); + NSLog(@"TH reads ColorTempPhysicalMaxMireds attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4307,7 +4085,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeCoupleColorTempToLevelMinMireds_26() + CHIP_ERROR TestThReadsCoupleColorTempToLevelMinMiredsAttributeFromDut_22() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4317,7 +4095,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { [cluster readAttributeCoupleColorTempToLevelMinMiredsWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: CoupleColorTempToLevelMinMireds Error: %@", err); + NSLog(@"TH reads CoupleColorTempToLevelMinMireds attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4332,7 +4110,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeStartUpColorTemperatureMireds_27() + CHIP_ERROR TestThReadsStartUpColorTemperatureMiredsAttributeFromDut_23() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4342,7 +4120,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { [cluster readAttributeStartUpColorTemperatureMiredsWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: StartUpColorTemperatureMireds Error: %@", err); + NSLog(@"TH reads StartUpColorTemperatureMireds attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4356,76 +4134,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributeRemainingTime_28() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeRemainingTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: RemainingTime Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("RemainingTime", actualValue, 0U)); - } - - VerifyOrReturn(CheckConstraintType("remainingTime", "", "uint16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalAttributeDriftCompensation_29() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeDriftCompensationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: DriftCompensation Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("driftCompensation", "", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("driftCompensation", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("driftCompensation", [value unsignedCharValue], 4U)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalAttributeCompensationText_30() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCompensationTextWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: CompensationText Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("compensationText", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("compensationText", [value length], 254)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheMandatoryAttributeNumberOfPrimaries_31() + CHIP_ERROR TestThReadsNumberOfPrimariesAttributeFromDut_24() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4434,7 +4143,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeNumberOfPrimariesWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: NumberOfPrimaries Error: %@", err); + NSLog(@"TH reads NumberOfPrimaries attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4451,7 +4160,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary1X_32() + CHIP_ERROR TestThReadsPrimary1XAttributeFromDut_25() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4460,7 +4169,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary1XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary1X Error: %@", err); + NSLog(@"TH reads Primary1X attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4474,7 +4183,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary1Y_33() + CHIP_ERROR TestThReadsPrimary1YAttributeFromDut_26() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4483,7 +4192,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary1YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary1Y Error: %@", err); + NSLog(@"TH reads Primary1Y attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4497,7 +4206,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary1Intensity_34() + CHIP_ERROR TestThReadsPrimary1IntensityAttributeFromDut_27() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4506,7 +4215,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary1IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary1Intensity Error: %@", err); + NSLog(@"TH reads Primary1Intensity attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4521,7 +4230,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary2X_35() + CHIP_ERROR TestThReadsPrimary2XAttributeFromDut_28() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4530,7 +4239,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary2XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary2X Error: %@", err); + NSLog(@"TH reads Primary2X attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4544,7 +4253,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary2Y_36() + CHIP_ERROR TestThReadsPrimary2YAttributeFromDut_29() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4553,7 +4262,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary2YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary2Y Error: %@", err); + NSLog(@"TH reads Primary2Y attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4567,7 +4276,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestValidateConstraintsOfAttributePrimary2Intensity_37() + CHIP_ERROR TestThReadsPrimary2IntensityAttributeFromDut_30() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4576,7 +4285,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary2IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Validate constraints of attribute: Primary2Intensity Error: %@", err); + NSLog(@"TH reads Primary2Intensity attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4591,7 +4300,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary3X_38() + CHIP_ERROR TestThReadsPrimary3XAttributeFromDut_31() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4600,7 +4309,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary3XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary3X Error: %@", err); + NSLog(@"TH reads Primary3X attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4614,7 +4323,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary3Y_39() + CHIP_ERROR TestThReadsPrimary3YAttributeFromDut_32() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4623,7 +4332,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary3YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary3Y Error: %@", err); + NSLog(@"TH reads Primary3Y attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4637,7 +4346,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary3Intensity_40() + CHIP_ERROR TestThReadsPrimary3IntensityAttributeFromDut_33() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4646,7 +4355,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary3IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary3Intensity Error: %@", err); + NSLog(@"TH reads Primary3Intensity attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4661,7 +4370,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary4X_41() + CHIP_ERROR TestThReadsPrimary4XAttributeFromDut_34() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4670,7 +4379,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary4XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary4X Error: %@", err); + NSLog(@"TH reads Primary4X attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4684,7 +4393,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary4Y_42() + CHIP_ERROR TestThReadsPrimary4YAttributeFromDut_35() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4693,7 +4402,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary4YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary4Y Error: %@", err); + NSLog(@"TH reads Primary4Y attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4707,7 +4416,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary4Intensity_43() + CHIP_ERROR TestThReadsPrimary4IntensityAttributeFromDut_36() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4716,7 +4425,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary4IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary4Intensity Error: %@", err); + NSLog(@"TH reads Primary4Intensity attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4731,7 +4440,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary5X_44() + CHIP_ERROR TestThReadsPrimary5XAttributeFromDut_37() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4740,7 +4449,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary5XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary5X Error: %@", err); + NSLog(@"TH reads Primary5X attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4754,7 +4463,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary5Y_45() + CHIP_ERROR TestThReadsPrimary5YAttributeFromDut_38() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4763,7 +4472,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary5YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary5Y Error: %@", err); + NSLog(@"TH reads Primary5Y attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4777,7 +4486,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary5Intensity_46() + CHIP_ERROR TestThReadsPrimary5IntensityAttributeFromDut_39() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4786,7 +4495,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary5IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary5Intensity Error: %@", err); + NSLog(@"TH reads Primary5Intensity attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4801,7 +4510,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary6X_47() + CHIP_ERROR TestThReadsPrimary6XAttributeFromDut_40() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4810,7 +4519,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary6XWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary6X Error: %@", err); + NSLog(@"TH reads Primary6X attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4824,7 +4533,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary6Y_48() + CHIP_ERROR TestThReadsPrimary6YAttributeFromDut_41() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4833,7 +4542,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary6YWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary6Y Error: %@", err); + NSLog(@"TH reads Primary6Y attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4847,7 +4556,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributePrimary6Intensity_49() + CHIP_ERROR TestThReadsPrimary6IntensityAttributeFromDut_42() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4856,7 +4565,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributePrimary6IntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: Primary6Intensity Error: %@", err); + NSLog(@"TH reads Primary6Intensity attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4871,7 +4580,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeWhitePointX_50() + CHIP_ERROR TestThReadsWhitePointXAttributeFromDut_43() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4880,7 +4589,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeWhitePointXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: WhitePointX Error: %@", err); + NSLog(@"TH reads WhitePointX attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4894,7 +4603,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeWhitePointY_51() + CHIP_ERROR TestThReadsWhitePointYAttributeFromDut_44() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4903,7 +4612,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeWhitePointYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: WhitePointY Error: %@", err); + NSLog(@"TH reads WhitePointY attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4917,7 +4626,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeColorPointRX_52() + CHIP_ERROR TestThReadsColorPointRXAttributeFromDut_45() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4926,7 +4635,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeColorPointRXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointRX Error: %@", err); + NSLog(@"TH reads ColorPointRX attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4940,7 +4649,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeColorPointRY_53() + CHIP_ERROR TestThReadsColorPointRYAttributeFromDut_46() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4949,7 +4658,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeColorPointRYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointRY Error: %@", err); + NSLog(@"TH reads ColorPointRY attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4963,7 +4672,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeColorPointRIntensity_54() + CHIP_ERROR TestThReadsColorPointRIntensityAttributeFromDut_47() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4972,7 +4681,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeColorPointRIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointRIntensity Error: %@", err); + NSLog(@"TH reads ColorPointRIntensity attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -4987,7 +4696,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeColorPointGX_55() + CHIP_ERROR TestThReadsColorPointGXAttributeFromDut_48() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -4996,7 +4705,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeColorPointGXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointGX Error: %@", err); + NSLog(@"TH reads ColorPointGX attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -5010,7 +4719,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeColorPointGY_56() + CHIP_ERROR TestThReadsColorPointGYAttributeFromDut_49() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -5019,7 +4728,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeColorPointGYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointGY Error: %@", err); + NSLog(@"TH reads ColorPointGY attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -5033,7 +4742,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeColorPointGIntensity_57() + CHIP_ERROR TestThReadsColorPointGIntensityAttributeFromDut_50() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -5042,7 +4751,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeColorPointGIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointGIntensity Error: %@", err); + NSLog(@"TH reads ColorPointGIntensity attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -5057,7 +4766,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeColorPointBX_58() + CHIP_ERROR TestThReadsColorPointBXAttributeFromDut_51() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -5066,7 +4775,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeColorPointBXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointBX Error: %@", err); + NSLog(@"TH reads ColorPointBX attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -5080,7 +4789,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeColorPointBY_59() + CHIP_ERROR TestThReadsColorPointBYAttributeFromDut_52() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -5089,7 +4798,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeColorPointBYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointBY Error: %@", err); + NSLog(@"TH reads ColorPointBY attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -5103,7 +4812,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeColorPointBIntensity_60() + CHIP_ERROR TestThReadsColorPointBIntensityAttributeFromDut_53() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterColorControl * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device @@ -5112,7 +4821,7 @@ class Test_TC_CC_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeColorPointBIntensityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ColorPointBIntensity Error: %@", err); + NSLog(@"TH reads ColorPointBIntensity attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -16772,11 +16481,282 @@ class Test_TC_CC_8_1 : public TestCommandBridge { } }; -class Test_TC_BINFO_2_1 : public TestCommandBridge { +class Test_TC_DESC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DESC_1_1() + : TestCommandBridge("Test_TC_DESC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_DESC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DESC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DESC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 7; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } +}; + +class Test_TC_DGETH_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_BINFO_2_1() - : TestCommandBridge("Test_TC_BINFO_2_1") + Test_TC_DGETH_2_1() + : TestCommandBridge("Test_TC_DGETH_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -16786,7 +16766,7 @@ class Test_TC_BINFO_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_BINFO_2_1() {} + ~Test_TC_DGETH_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -16794,11 +16774,11 @@ class Test_TC_BINFO_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BINFO_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGETH_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BINFO_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGETH_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -16815,153 +16795,146 @@ class Test_TC_BINFO_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Query Data Model Revision\n"); - if (ShouldSkip("BINFO.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : Read PHYRate attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0000")) { NextTest(); return; } - err = TestQueryDataModelRevision_1(); + err = TestReadPHYRateAttributeConstraints_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Query Vendor Name\n"); - if (ShouldSkip("BINFO.S.A0001")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Read FullDuplex attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0001")) { NextTest(); return; } - err = TestQueryVendorName_2(); + err = TestReadFullDuplexAttributeConstraints_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Query VendorID\n"); - if (ShouldSkip("BINFO.S.A0002")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Read PacketRxCount attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0002")) { NextTest(); return; } - err = TestQueryVendorID_3(); + err = TestReadPacketRxCountAttributeConstraints_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Query Product Name\n"); - if (ShouldSkip("BINFO.S.A0003")) { + ChipLogProgress(chipTool, + " ***** Test Step 4 : Read PacketRxCount value from DUT and verify the number of packets received on ethernet " + "network interface\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0002")) { NextTest(); return; } - err = TestQueryProductName_4(); + err = TestReadPacketRxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Query ProductID\n"); - if (ShouldSkip("BINFO.S.A0004")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Read PacketTxCount attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0003")) { NextTest(); return; } - err = TestQueryProductID_5(); + err = TestReadPacketTxCountAttributeConstraints_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Query Node Label\n"); - if (ShouldSkip("BINFO.S.A0005")) { + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read PacketTxCount value from DUT and verify the number of packets received on ethernet " + "network interface\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0003")) { NextTest(); return; } - err = TestQueryNodeLabel_6(); + err = TestReadPacketTxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Query User Location\n"); - if (ShouldSkip("BINFO.S.A0006")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : Read TxErrCount attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0004")) { NextTest(); return; } - err = TestQueryUserLocation_7(); + err = TestReadTxErrCountAttributeConstraints_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Query HardwareVersion\n"); - if (ShouldSkip("BINFO.S.A0007")) { + ChipLogProgress(chipTool, + " ***** Test Step 8 : Read TxErrCount value from DUT and verify value indicates the number of failed packet " + "transmission on ethernet network interface\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0004")) { NextTest(); return; } - err = TestQueryHardwareVersion_8(); + err = TestReadTxErrCountValueFromDutAndVerifyValueIndicatesTheNumberOfFailedPacketTransmissionOnEthernetNetworkInterface_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Query HardwareVersionString\n"); - if (ShouldSkip("BINFO.S.A0008")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : Read CollisionCount attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0005")) { NextTest(); return; } - err = TestQueryHardwareVersionString_9(); + err = TestReadCollisionCountAttributeConstraints_9(); break; case 10: ChipLogProgress(chipTool, - " ***** Test Step 10 : TH reads SoftwareVersionString from the DUT and Verify it is of type string and verify the " - "format\n"); - if (ShouldSkip("PICS_USER_PROMPT && BINFO.S.A000a")) { + " ***** Test Step 10 : Read CollisionCount value from DUT and verify value indicates the number of collision " + "occurred while transmitting packets on ethernet network interface\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0005")) { NextTest(); return; } - err = TestThReadsSoftwareVersionStringFromTheDutAndVerifyItIsOfTypeStringAndVerifyTheFormat_10(); + err = TestReadCollisionCountValueFromDutAndVerifyValueIndicatesTheNumberOfCollisionOccurredWhileTransmittingPacketsOnEthernetNetworkInterface_10(); break; case 11: - ChipLogProgress(chipTool, - " ***** Test Step 11 : TH reads ManufacturingDate from the DUT and Verify it is of type string and verify the " - "format\n"); - if (ShouldSkip("PICS_USER_PROMPT && BINFO.S.A000b")) { + ChipLogProgress(chipTool, " ***** Test Step 11 : Read OverrunCount attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0006")) { NextTest(); return; } - err = TestThReadsManufacturingDateFromTheDutAndVerifyItIsOfTypeStringAndVerifyTheFormat_11(); + err = TestReadOverrunCountAttributeConstraints_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Query PartNumber\n"); - if (ShouldSkip("BINFO.S.A000c")) { + ChipLogProgress(chipTool, + " ***** Test Step 12 : Read OverrunCount value from DUT and verify value indicates the number of packets dropped " + "due to lack of buffer memory on ethernet network interface\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0006")) { NextTest(); return; } - err = TestQueryPartNumber_12(); + err = TestReadOverrunCountValueFromDutAndVerifyValueIndicatesTheNumberOfPacketsDroppedDueToLackOfBufferMemoryOnEthernetNetworkInterface_12(); break; case 13: - ChipLogProgress(chipTool, - " ***** Test Step 13 : TH reads ProductURL from the DUT and Verify it is of type string and verify the format\n"); - if (ShouldSkip("PICS_USER_PROMPT && BINFO.S.A000d")) { + ChipLogProgress(chipTool, " ***** Test Step 13 : Read CarrierDetect attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0007")) { NextTest(); return; } - err = TestThReadsProductURLFromTheDutAndVerifyItIsOfTypeStringAndVerifyTheFormat_13(); + err = TestReadCarrierDetectAttributeConstraints_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Query ProductLabel\n"); - if (ShouldSkip("BINFO.S.A000e")) { + ChipLogProgress(chipTool, + " ***** Test Step 14 : Read CarrierDetect value from DUT and verify value indicates the presence of carrier detect " + "control signal on ethernet network interface\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0007")) { NextTest(); return; } - err = TestQueryProductLabel_14(); + err = TestReadCarrierDetectValueFromDutAndVerifyValueIndicatesThePresenceOfCarrierDetectControlSignalOnEthernetNetworkInterface_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Query SerialNumber\n"); - if (ShouldSkip("BINFO.S.A000f")) { + ChipLogProgress(chipTool, " ***** Test Step 15 : Read TimeSinceReset attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0008")) { NextTest(); return; } - err = TestQuerySerialNumber_15(); + err = TestReadTimeSinceResetAttributeConstraints_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Query LocalConfigDisabled\n"); - if (ShouldSkip("BINFO.S.A0010")) { - NextTest(); - return; - } - err = TestQueryLocalConfigDisabled_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Query Reachable\n"); - if (ShouldSkip("BINFO.S.A0011")) { - NextTest(); - return; - } - err = TestQueryReachable_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Query UniqueID\n"); - if (ShouldSkip("BINFO.S.A0012")) { + ChipLogProgress(chipTool, + " ***** Test Step 16 : Read TimeSinceReset value from DUT and verify the value indicates the duration of time, in " + "minutes\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0008")) { NextTest(); return; } - err = TestQueryUniqueID_18(); + err = TestReadTimeSinceResetValueFromDutAndVerifyTheValueIndicatesTheDurationOfTimeInMinutes_16(); break; } @@ -17025,12 +16998,6 @@ class Test_TC_BINFO_2_1 : public TestCommandBridge { case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 17: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -17044,7 +17011,7 @@ class Test_TC_BINFO_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 19; + const uint16_t mTestCount = 17; chip::Optional mNodeId; chip::Optional mCluster; @@ -17058,175 +17025,250 @@ class Test_TC_BINFO_2_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestQueryDataModelRevision_1() + CHIP_ERROR TestReadPHYRateAttributeConstraints_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeDataModelRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query Data Model Revision Error: %@", err); + [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read PHYRate attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("dataModelRevision", "", "uint16")); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("PHYRate", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestQueryVendorName_2() + CHIP_ERROR TestReadFullDuplexAttributeConstraints_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeVendorNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query Vendor Name Error: %@", err); + [cluster readAttributeFullDuplexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read FullDuplex attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("vendorName", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("vendorName", [value length], 32)); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("fullDuplex", "", "bool")); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestQueryVendorID_3() + CHIP_ERROR TestReadPacketRxCountAttributeConstraints_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeVendorIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query VendorID Error: %@", err); + [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read PacketRxCount attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("vendorID", "", "uint16")); + VerifyOrReturn(CheckConstraintType("packetRxCount", "", "uint64")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestQueryProductName_4() + CHIP_ERROR TestReadPacketRxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_4() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestReadPacketTxCountAttributeConstraints_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeProductNameWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query Product Name Error: %@", err); + [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read PacketTxCount attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("productName", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("productName", [value length], 32)); + VerifyOrReturn(CheckConstraintType("packetTxCount", "", "uint64")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestQueryProductID_5() + CHIP_ERROR TestReadPacketTxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_6() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestReadTxErrCountAttributeConstraints_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeProductIDWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query ProductID Error: %@", err); + [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read TxErrCount attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("productID", "", "uint16")); + VerifyOrReturn(CheckConstraintType("txErrCount", "", "uint64")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestQueryNodeLabel_6() + CHIP_ERROR + TestReadTxErrCountValueFromDutAndVerifyValueIndicatesTheNumberOfFailedPacketTransmissionOnEthernetNetworkInterface_8() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestReadCollisionCountAttributeConstraints_9() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNodeLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query Node Label Error: %@", err); + [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CollisionCount attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("nodeLabel", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("nodeLabel", [value length], 32)); + VerifyOrReturn(CheckConstraintType("collisionCount", "", "uint64")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestQueryUserLocation_7() + CHIP_ERROR + TestReadCollisionCountValueFromDutAndVerifyValueIndicatesTheNumberOfCollisionOccurredWhileTransmittingPacketsOnEthernetNetworkInterface_10() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestReadOverrunCountAttributeConstraints_11() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query User Location Error: %@", err); + [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read OverrunCount attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("location", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("location", [value length], 16)); + VerifyOrReturn(CheckConstraintType("overrunCount", "", "uint64")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestQueryHardwareVersion_8() + CHIP_ERROR + TestReadOverrunCountValueFromDutAndVerifyValueIndicatesTheNumberOfPacketsDroppedDueToLackOfBufferMemoryOnEthernetNetworkInterface_12() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestReadCarrierDetectAttributeConstraints_13() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeHardwareVersionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query HardwareVersion Error: %@", err); + [cluster readAttributeCarrierDetectWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read CarrierDetect attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("hardwareVersion", "", "uint16")); + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("carrierDetect", "", "bool")); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestQueryHardwareVersionString_9() + CHIP_ERROR + TestReadCarrierDetectValueFromDutAndVerifyValueIndicatesThePresenceOfCarrierDetectControlSignalOnEthernetNetworkInterface_14() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestReadTimeSinceResetAttributeConstraints_15() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeHardwareVersionStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query HardwareVersionString Error: %@", err); + [cluster readAttributeTimeSinceResetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read TimeSinceReset attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("hardwareVersionString", "", "string")); - VerifyOrReturn(CheckConstraintMinLength("hardwareVersionString", [value length], 1)); - VerifyOrReturn(CheckConstraintMaxLength("hardwareVersionString", [value length], 64)); + VerifyOrReturn(CheckConstraintType("timeSinceReset", "", "uint64")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsSoftwareVersionStringFromTheDutAndVerifyItIsOfTypeStringAndVerifyTheFormat_10() + CHIP_ERROR TestReadTimeSinceResetValueFromDutAndVerifyTheValueIndicatesTheDurationOfTimeInMinutes_16() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); @@ -17234,131 +17276,284 @@ class Test_TC_BINFO_2_1 : public TestCommandBridge { value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); } +}; + +class Test_TC_DGETH_2_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DGETH_2_2() + : TestCommandBridge("Test_TC_DGETH_2_2") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_DGETH_2_2() {} - CHIP_ERROR TestThReadsManufacturingDateFromTheDutAndVerifyItIsOfTypeStringAndVerifyTheFormat_11() + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGETH_2_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGETH_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Sends ResetCounts command\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP && DGETH.S.C00")) { + NextTest(); + return; + } + err = TestSendsResetCountsCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the PacketRxCount attribute\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP && DGETH.S.A0002")) { + NextTest(); + return; + } + err = TestReadThePacketRxCountAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the PacketTxCount attribute\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP && DGETH.S.A0003")) { + NextTest(); + return; + } + err = TestReadThePacketTxCountAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the TxErrCount attribute\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP && DGETH.S.A0004")) { + NextTest(); + return; + } + err = TestReadTheTxErrCountAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the CollisionCount attribute\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP && DGETH.S.A0005")) { + NextTest(); + return; + } + err = TestReadTheCollisionCountAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the OverrunCount attribute\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP && DGETH.S.A0006")) { + NextTest(); + return; + } + err = TestReadTheOverrunCountAttribute_6(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 7; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestQueryPartNumber_12() + CHIP_ERROR TestSendsResetCountsCommand_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePartNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query PartNumber Error: %@", err); + [cluster resetCountsWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Sends ResetCounts command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("partNumber", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("partNumber", [value length], 32)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsProductURLFromTheDutAndVerifyItIsOfTypeStringAndVerifyTheFormat_13() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestQueryProductLabel_14() + CHIP_ERROR TestReadThePacketRxCountAttribute_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeProductLabelWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query ProductLabel Error: %@", err); + [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the PacketRxCount attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("productLabel", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("productLabel", [value length], 64)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("PacketRxCount", actualValue, 0ULL)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestQuerySerialNumber_15() + CHIP_ERROR TestReadThePacketTxCountAttribute_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeSerialNumberWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query SerialNumber Error: %@", err); + [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the PacketTxCount attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("serialNumber", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("serialNumber", [value length], 32)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("PacketTxCount", actualValue, 0ULL)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestQueryLocalConfigDisabled_16() + CHIP_ERROR TestReadTheTxErrCountAttribute_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLocalConfigDisabledWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query LocalConfigDisabled Error: %@", err); + [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the TxErrCount attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("localConfigDisabled", "", "boolean")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxErrCount", actualValue, 0ULL)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestQueryReachable_17() + CHIP_ERROR TestReadTheCollisionCountAttribute_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeReachableWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query Reachable Error: %@", err); + [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the CollisionCount attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("reachable", "", "boolean")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("CollisionCount", actualValue, 0ULL)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestQueryUniqueID_18() + CHIP_ERROR TestReadTheOverrunCountAttribute_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterBasic * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterEthernetNetworkDiagnostics * cluster = + [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeUniqueIDWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Query UniqueID Error: %@", err); + [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the OverrunCount attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("uniqueID", "", "string")); - VerifyOrReturn(CheckConstraintMaxLength("uniqueID", [value length], 32)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OverrunCount", actualValue, 0ULL)); + } + NextTest(); }]; @@ -17366,11 +17561,11 @@ class Test_TC_BINFO_2_1 : public TestCommandBridge { } }; -class Test_TC_DESC_1_1 : public TestCommandBridge { +class Test_TC_FLW_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DESC_1_1() - : TestCommandBridge("Test_TC_DESC_1_1") + Test_TC_FLW_1_1() + : TestCommandBridge("Test_TC_FLW_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -17380,7 +17575,7 @@ class Test_TC_DESC_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DESC_1_1() {} + ~Test_TC_FLW_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -17388,11 +17583,11 @@ class Test_TC_DESC_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DESC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DESC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -17413,30 +17608,42 @@ class Test_TC_DESC_1_1 : public TestCommandBridge { err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - err = TestReadTheGlobalAttributeFeatureMap_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints : FeatureMap\n"); + err = TestReadTheGlobalAttributeConstraintsFeatureMap_2(); break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip(" !FLW.S.A0003 ")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("FLW.S.A0003")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); break; case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: ChipLogProgress(chipTool, - " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + " ***** Test Step 7 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " "supported events.\n"); if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_7(); break; } @@ -17470,6 +17677,9 @@ class Test_TC_DESC_1_1 : public TestCommandBridge { case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -17483,7 +17693,7 @@ class Test_TC_DESC_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -17500,9 +17710,9 @@ class Test_TC_DESC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { @@ -17512,7 +17722,7 @@ class Test_TC_DESC_1_1 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); } VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); @@ -17522,16 +17732,16 @@ class Test_TC_DESC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + NSLog(@"Read the global attribute constraints : FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -17550,9 +17760,38 @@ class Test_TC_DESC_1_1 : public TestCommandBridge { CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -17577,12 +17816,12 @@ class Test_TC_DESC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -17602,12 +17841,12 @@ class Test_TC_DESC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDescriptor * cluster = [[MTRBaseClusterDescriptor alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { @@ -17627,7 +17866,7 @@ class Test_TC_DESC_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_7() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); @@ -17637,11 +17876,11 @@ class Test_TC_DESC_1_1 : public TestCommandBridge { } }; -class Test_TC_DGETH_2_1 : public TestCommandBridge { +class Test_TC_FLW_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DGETH_2_1() - : TestCommandBridge("Test_TC_DGETH_2_1") + Test_TC_FLW_2_1() + : TestCommandBridge("Test_TC_FLW_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -17651,7 +17890,7 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DGETH_2_1() {} + ~Test_TC_FLW_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -17659,11 +17898,11 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGETH_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGETH_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -17680,146 +17919,36 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read PHYRate attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the mandatory attribute: MeasuredValue\n"); + if (ShouldSkip("FLW.S.A0000")) { NextTest(); return; } - err = TestReadPHYRateAttributeConstraints_1(); + err = TestReadTheMandatoryAttributeMeasuredValue_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read FullDuplex attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0001")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the mandatory attribute: MinMeasuredValue\n"); + if (ShouldSkip("FLW.S.A0001")) { NextTest(); return; } - err = TestReadFullDuplexAttributeConstraints_2(); + err = TestReadTheMandatoryAttributeMinMeasuredValue_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read PacketRxCount attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0002")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the mandatory attribute: MaxMeasuredValue\n"); + if (ShouldSkip("FLW.S.A0002")) { NextTest(); return; } - err = TestReadPacketRxCountAttributeConstraints_3(); + err = TestReadTheMandatoryAttributeMaxMeasuredValue_3(); break; case 4: - ChipLogProgress(chipTool, - " ***** Test Step 4 : Read PacketRxCount value from DUT and verify the number of packets received on ethernet " - "network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0002")) { - NextTest(); - return; - } - err = TestReadPacketRxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read PacketTxCount attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0003")) { - NextTest(); - return; - } - err = TestReadPacketTxCountAttributeConstraints_5(); - break; - case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Read PacketTxCount value from DUT and verify the number of packets received on ethernet " - "network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0003")) { - NextTest(); - return; - } - err = TestReadPacketTxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read TxErrCount attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0004")) { - NextTest(); - return; - } - err = TestReadTxErrCountAttributeConstraints_7(); - break; - case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : Read TxErrCount value from DUT and verify value indicates the number of failed packet " - "transmission on ethernet network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0004")) { - NextTest(); - return; - } - err = TestReadTxErrCountValueFromDutAndVerifyValueIndicatesTheNumberOfFailedPacketTransmissionOnEthernetNetworkInterface_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read CollisionCount attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0005")) { - NextTest(); - return; - } - err = TestReadCollisionCountAttributeConstraints_9(); - break; - case 10: - ChipLogProgress(chipTool, - " ***** Test Step 10 : Read CollisionCount value from DUT and verify value indicates the number of collision " - "occurred while transmitting packets on ethernet network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0005")) { - NextTest(); - return; - } - err = TestReadCollisionCountValueFromDutAndVerifyValueIndicatesTheNumberOfCollisionOccurredWhileTransmittingPacketsOnEthernetNetworkInterface_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read OverrunCount attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0006")) { - NextTest(); - return; - } - err = TestReadOverrunCountAttributeConstraints_11(); - break; - case 12: - ChipLogProgress(chipTool, - " ***** Test Step 12 : Read OverrunCount value from DUT and verify value indicates the number of packets dropped " - "due to lack of buffer memory on ethernet network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0006")) { - NextTest(); - return; - } - err = TestReadOverrunCountValueFromDutAndVerifyValueIndicatesTheNumberOfPacketsDroppedDueToLackOfBufferMemoryOnEthernetNetworkInterface_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read CarrierDetect attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0007")) { - NextTest(); - return; - } - err = TestReadCarrierDetectAttributeConstraints_13(); - break; - case 14: - ChipLogProgress(chipTool, - " ***** Test Step 14 : Read CarrierDetect value from DUT and verify value indicates the presence of carrier detect " - "control signal on ethernet network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0007")) { - NextTest(); - return; - } - err = TestReadCarrierDetectValueFromDutAndVerifyValueIndicatesThePresenceOfCarrierDetectControlSignalOnEthernetNetworkInterface_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Read TimeSinceReset attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0008")) { - NextTest(); - return; - } - err = TestReadTimeSinceResetAttributeConstraints_15(); - break; - case 16: - ChipLogProgress(chipTool, - " ***** Test Step 16 : Read TimeSinceReset value from DUT and verify the value indicates the duration of time, in " - "minutes\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0008")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : read the optional attribute: Tolerance\n"); + if (ShouldSkip("FLW.S.A0003")) { NextTest(); return; } - err = TestReadTimeSinceResetValueFromDutAndVerifyTheValueIndicatesTheDurationOfTimeInMinutes_16(); + err = TestReadTheOptionalAttributeTolerance_4(); break; } @@ -17847,42 +17976,6 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -17896,7 +17989,7 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 17; + const uint16_t mTestCount = 5; chip::Optional mNodeId; chip::Optional mCluster; @@ -17910,23 +18003,22 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadPHYRateAttributeConstraints_1() + CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePHYRateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read PHYRate attribute constraints Error: %@", err); + [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the mandatory attribute: MeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintType("PHYRate", "", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); + VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); } NextTest(); @@ -17935,21 +18027,22 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadFullDuplexAttributeConstraints_2() + CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFullDuplexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read FullDuplex attribute constraints Error: %@", err); + [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the mandatory attribute: MinMeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintType("fullDuplex", "", "bool")); + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "uint16")); } NextTest(); @@ -17958,164 +18051,22 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadPacketRxCountAttributeConstraints_3() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read PacketRxCount attribute constraints Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("packetRxCount", "", "uint64")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadPacketRxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_4() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestReadPacketTxCountAttributeConstraints_5() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read PacketTxCount attribute constraints Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("packetTxCount", "", "uint64")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadPacketTxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_6() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestReadTxErrCountAttributeConstraints_7() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read TxErrCount attribute constraints Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("txErrCount", "", "uint64")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR - TestReadTxErrCountValueFromDutAndVerifyValueIndicatesTheNumberOfFailedPacketTransmissionOnEthernetNetworkInterface_8() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestReadCollisionCountAttributeConstraints_9() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read CollisionCount attribute constraints Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("collisionCount", "", "uint64")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR - TestReadCollisionCountValueFromDutAndVerifyValueIndicatesTheNumberOfCollisionOccurredWhileTransmittingPacketsOnEthernetNetworkInterface_10() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestReadOverrunCountAttributeConstraints_11() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read OverrunCount attribute constraints Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("overrunCount", "", "uint64")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR - TestReadOverrunCountValueFromDutAndVerifyValueIndicatesTheNumberOfPacketsDroppedDueToLackOfBufferMemoryOnEthernetNetworkInterface_12() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestReadCarrierDetectAttributeConstraints_13() + CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCarrierDetectWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read CarrierDetect attribute constraints Error: %@", err); + [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the mandatory attribute: MaxMeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); if (value != nil) { - VerifyOrReturn(CheckConstraintType("carrierDetect", "", "bool")); + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "uint16")); } NextTest(); @@ -18124,50 +18075,35 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - TestReadCarrierDetectValueFromDutAndVerifyValueIndicatesThePresenceOfCarrierDetectControlSignalOnEthernetNetworkInterface_14() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestReadTimeSinceResetAttributeConstraints_15() + CHIP_ERROR TestReadTheOptionalAttributeTolerance_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTimeSinceResetWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read TimeSinceReset attribute constraints Error: %@", err); + [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: Tolerance Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("timeSinceReset", "", "uint64")); + VerifyOrReturn(CheckConstraintType("tolerance", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); + NextTest(); }]; return CHIP_NO_ERROR; } - - CHIP_ERROR TestReadTimeSinceResetValueFromDutAndVerifyTheValueIndicatesTheDurationOfTimeInMinutes_16() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } }; -class Test_TC_DGETH_2_2 : public TestCommandBridge { +class Test_TC_CGEN_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DGETH_2_2() - : TestCommandBridge("Test_TC_DGETH_2_2") + Test_TC_CGEN_1_1() + : TestCommandBridge("Test_TC_CGEN_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -18177,7 +18113,7 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DGETH_2_2() {} + ~Test_TC_CGEN_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -18185,11 +18121,11 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGETH_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CGEN_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGETH_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CGEN_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -18206,52 +18142,34 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Sends ResetCounts command\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && DGETH.S.C00")) { - NextTest(); - return; - } - err = TestSendsResetCountsCommand_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the PacketRxCount attribute\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && DGETH.S.A0002")) { - NextTest(); - return; - } - err = TestReadThePacketRxCountAttribute_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the PacketTxCount attribute\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && DGETH.S.A0003")) { - NextTest(); - return; - } - err = TestReadThePacketTxCountAttribute_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the TxErrCount attribute\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && DGETH.S.A0004")) { - NextTest(); - return; - } - err = TestReadTheTxErrCountAttribute_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the CollisionCount attribute\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && DGETH.S.A0005")) { - NextTest(); - return; - } - err = TestReadTheCollisionCountAttribute_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the OverrunCount attribute\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && DGETH.S.A0006")) { + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - err = TestReadTheOverrunCountAttribute_6(); + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); break; } @@ -18312,63 +18230,80 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestSendsResetCountsCommand_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster resetCountsWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends ResetCounts command Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadThePacketRxCountAttribute_2() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePacketRxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the PacketRxCount attribute Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("PacketRxCount", actualValue, 0ULL)); + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); } + VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadThePacketTxCountAttribute_3() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePacketTxCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the PacketTxCount attribute Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("PacketTxCount", actualValue, 0ULL)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); }]; @@ -18376,22 +18311,23 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheTxErrCountAttribute_4() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTxErrCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the TxErrCount attribute Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("TxErrCount", actualValue, 0ULL)); - } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 4UL)); NextTest(); }]; @@ -18399,22 +18335,23 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheCollisionCountAttribute_5() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCollisionCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the CollisionCount attribute Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("CollisionCount", actualValue, 0ULL)); - } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 5UL)); NextTest(); }]; @@ -18422,35 +18359,21 @@ class Test_TC_DGETH_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOverrunCountAttribute_6() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterEthernetNetworkDiagnostics * cluster = - [[MTRBaseClusterEthernetNetworkDiagnostics alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOverrunCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the OverrunCount attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OverrunCount", actualValue, 0ULL)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } }; -class Test_TC_FLW_1_1 : public TestCommandBridge { +class Test_TC_CGEN_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_FLW_1_1() - : TestCommandBridge("Test_TC_FLW_1_1") + Test_TC_CGEN_2_1() + : TestCommandBridge("Test_TC_CGEN_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -18460,7 +18383,7 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_FLW_1_1() {} + ~Test_TC_CGEN_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -18468,11 +18391,11 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CGEN_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CGEN_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -18489,46 +18412,63 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH1 reads the BreadCrumb Attribute from the DUT\n"); + if (ShouldSkip("CGEN.S.A0000")) { + NextTest(); + return; + } + err = TestTh1ReadsTheBreadCrumbAttributeFromTheDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints : FeatureMap\n"); - err = TestReadTheGlobalAttributeConstraintsFeatureMap_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH1 writes the BreadCrumb attribute as 1 to the DUT\n"); + if (ShouldSkip("CGEN.S.A0000")) { + NextTest(); + return; + } + err = TestTh1WritesTheBreadCrumbAttributeAs1ToTheDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - if (ShouldSkip(" !FLW.S.A0003 ")) { + ChipLogProgress(chipTool, " ***** Test Step 3 : TH1 reads the BreadCrumb attribute from the DUT\n"); + if (ShouldSkip("CGEN.S.A0000")) { NextTest(); return; } - err = TestReadTheGlobalAttributeAttributeList_3(); + err = TestTh1ReadsTheBreadCrumbAttributeFromTheDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AttributeList\n"); - if (ShouldSkip("FLW.S.A0003")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : TH1 reads the RegulatoryConfig attribute from the DUT\n"); + if (ShouldSkip("CGEN.S.A0002")) { NextTest(); return; } - err = TestReadTheGlobalAttributeAttributeList_4(); + err = TestTh1ReadsTheRegulatoryConfigAttributeFromTheDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : TH1 reads the LocationCapability attribute from the DUT\n"); + if (ShouldSkip("CGEN.S.A0003")) { + NextTest(); + return; + } + err = TestTh1ReadsTheLocationCapabilityAttributeFromTheDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_6(); + ChipLogProgress(chipTool, + " ***** Test Step 6 : TH1 reads BasicCommissioningInfo attribute from DUT and Verify that the " + "BasicCommissioningInfo attribute has the following field: FailSafeExpiryLengthSeconds field value is within a " + "duration range of 0 to 65535\n"); + if (ShouldSkip("CGEN.S.A0001")) { + NextTest(); + return; + } + err = TestTh1ReadsBasicCommissioningInfoAttributeFromDutAndVerifyThatTheBasicCommissioningInfoAttributeHasTheFollowingFieldFailSafeExpiryLengthSecondsFieldValueIsWithinADurationRangeOf0To65535_6(); break; case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " - "supported events.\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : TH1 reads SupportsConcurrentConnection attribute from the DUT\n"); + if (ShouldSkip("CGEN.S.A0004")) { NextTest(); return; } - err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_7(); + err = TestTh1ReadsSupportsConcurrentConnectionAttributeFromTheDut_7(); break; } @@ -18592,78 +18532,65 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestTh1ReadsTheBreadCrumbAttributeFromTheDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads the BreadCrumb Attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + VerifyOrReturn(CheckConstraintType("breadcrumb", "", "uint64")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsFeatureMap_2() + CHIP_ERROR TestTh1WritesTheBreadCrumbAttributeAs1ToTheDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints : FeatureMap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + id breadcrumbArgument; + breadcrumbArgument = [NSNumber numberWithUnsignedLongLong:1ULL]; + [cluster writeAttributeBreadcrumbWithValue:breadcrumbArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH1 writes the BreadCrumb attribute as 1 to the DUT Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestTh1ReadsTheBreadCrumbAttributeFromTheDut_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); + [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads the BreadCrumb attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 1ULL)); + } NextTest(); }]; @@ -18671,105 +18598,101 @@ class Test_TC_FLW_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_4() + CHIP_ERROR TestTh1ReadsTheRegulatoryConfigAttributeFromTheDut_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); + [cluster readAttributeRegulatoryConfigWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads the RegulatoryConfig attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(9))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 65528UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 65529UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 65531UL)); - VerifyOrReturn(CheckValue("", actualValue[7], 65532UL)); - VerifyOrReturn(CheckValue("", actualValue[8], 65533UL)); - } + VerifyOrReturn(CheckConstraintMinValue("regulatoryConfig", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("regulatoryConfig", [value unsignedCharValue], 2U)); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() + CHIP_ERROR TestTh1ReadsTheLocationCapabilityAttributeFromTheDut_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + [cluster readAttributeLocationCapabilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads the LocationCapability attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); - } + VerifyOrReturn(CheckConstraintMinValue("locationCapability", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("locationCapability", [value unsignedCharValue], 2U)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() + CHIP_ERROR + TestTh1ReadsBasicCommissioningInfoAttributeFromDutAndVerifyThatTheBasicCommissioningInfoAttributeHasTheFollowingFieldFailSafeExpiryLengthSecondsFieldValueIsWithinADurationRangeOf0To65535_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + [cluster readAttributeBasicCommissioningInfoWithCompletionHandler:^( + MTRGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, NSError * _Nullable err) { + NSLog( + @"TH1 reads BasicCommissioningInfo attribute from DUT and Verify that the BasicCommissioningInfo attribute has the " + @"following field: FailSafeExpiryLengthSeconds field value is within a duration range of 0 to 65535 Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } - - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_7() + CHIP_ERROR TestTh1ReadsSupportsConcurrentConnectionAttributeFromTheDut_7() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeSupportsConcurrentConnectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads SupportsConcurrentConnection attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("supportsConcurrentConnection", "", "bool")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } }; -class Test_TC_FLW_2_1 : public TestCommandBridge { +class Test_TC_DGGEN_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_FLW_2_1() - : TestCommandBridge("Test_TC_FLW_2_1") + Test_TC_DGGEN_1_1() + : TestCommandBridge("Test_TC_DGGEN_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -18779,7 +18702,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_FLW_2_1() {} + ~Test_TC_DGGEN_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -18787,11 +18710,11 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLW_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGGEN_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLW_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGGEN_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -18808,36 +18731,24 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the mandatory attribute: MeasuredValue\n"); - if (ShouldSkip("FLW.S.A0000")) { - NextTest(); - return; - } - err = TestReadTheMandatoryAttributeMeasuredValue_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the mandatory attribute: MinMeasuredValue\n"); - if (ShouldSkip("FLW.S.A0001")) { - NextTest(); - return; - } - err = TestReadTheMandatoryAttributeMinMeasuredValue_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + err = TestReadTheGlobalAttributeFeatureMap_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the mandatory attribute: MaxMeasuredValue\n"); - if (ShouldSkip("FLW.S.A0002")) { - NextTest(); - return; - } - err = TestReadTheMandatoryAttributeMaxMeasuredValue_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read the optional attribute: Tolerance\n"); - if (ShouldSkip("FLW.S.A0003")) { - NextTest(); - return; - } - err = TestReadTheOptionalAttributeTolerance_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); break; } @@ -18865,6 +18776,9 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -18878,7 +18792,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 6; chip::Optional mNodeId; chip::Optional mCluster; @@ -18892,71 +18806,99 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheMandatoryAttributeMeasuredValue_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: MeasuredValue Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); } + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_2() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: MinMeasuredValue Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "uint16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); } + VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_3() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute: MaxMeasuredValue Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "uint16")); - } + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); NextTest(); }]; @@ -18964,23 +18906,25 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeTolerance_4() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterFlowMeasurement * cluster = [[MTRBaseClusterFlowMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: Tolerance Error: %@", err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("tolerance", "", "uint16")); - VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; @@ -18988,11 +18932,11 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { } }; -class Test_TC_CGEN_1_1 : public TestCommandBridge { +class Test_TC_DGGEN_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CGEN_1_1() - : TestCommandBridge("Test_TC_CGEN_1_1") + Test_TC_DGGEN_2_1() + : TestCommandBridge("Test_TC_DGGEN_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -19002,7 +18946,7 @@ class Test_TC_CGEN_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CGEN_1_1() {} + ~Test_TC_DGGEN_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -19010,11 +18954,11 @@ class Test_TC_CGEN_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CGEN_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGGEN_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CGEN_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGGEN_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -19031,57 +18975,149 @@ class Test_TC_CGEN_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads NetworkInterfaces structure attribute from DUT.\n"); + if (ShouldSkip("DGGEN.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsNetworkInterfacesStructureAttributeFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - err = TestReadTheGlobalAttributeFeatureMap_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads a RebootCount attribute value from DUT.\n"); + if (ShouldSkip("DGGEN.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsARebootCountAttributeValueFromDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reboot target device\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { + NextTest(); + return; + } + err = TestRebootTargetDevice_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reboot target device(DUT)\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestRebootTargetDeviceDUT_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Reboot target device\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { + NextTest(); + return; + } + err = TestRebootTargetDevice_5(); break; case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " - "supported events.\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Reboot target device(DUT)\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } - err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + err = TestRebootTargetDeviceDUT_6(); break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_7(); + break; + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : DUT reboots and TH reads a UpTime attribute value of DUT since some arbitrary start time of " + "DUT rebooting.\n"); + if (ShouldSkip("DGGEN.S.A0002")) { + NextTest(); + return; + } + err = TestDutRebootsAndThReadsAUpTimeAttributeValueOfDutSinceSomeArbitraryStartTimeOfDutRebooting_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads a TotalOperationalHours attribute value from DUT.\n"); + if (ShouldSkip("DGGEN.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsATotalOperationalHoursAttributeValueFromDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Reboot target device\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { + NextTest(); + return; + } + err = TestRebootTargetDevice_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Reboot target device(DUT)\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestRebootTargetDeviceDUT_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads BootReason attribute value from DUT.\n"); + if (ShouldSkip("DGGEN.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsBootReasonAttributeValueFromDut_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads ActiveHardwareFaults attribute value from DUT.\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsActiveHardwareFaultsAttributeValueFromDut_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads ActiveRadioFaults attribute value from DUT.\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsActiveRadioFaultsAttributeValueFromDut_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads ActiveNetworkFaults attribute value from DUT.\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0007")) { + NextTest(); + return; + } + err = TestThReadsActiveNetworkFaultsAttributeValueFromDut_16(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -19092,6 +19128,36 @@ class Test_TC_CGEN_1_1 : public TestCommandBridge { case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -19105,7 +19171,7 @@ class Test_TC_CGEN_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 17; chip::Optional mNodeId; chip::Optional mCluster; @@ -19119,144 +19185,191 @@ class Test_TC_CGEN_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestThReadsNetworkInterfacesStructureAttributeFromDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeNetworkInterfacesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads NetworkInterfaces structure attribute from DUT. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + VerifyOrReturn(CheckConstraintType("networkInterfaces", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + CHIP_ERROR TestThReadsARebootCountAttributeValueFromDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + [cluster readAttributeRebootCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads a RebootCount attribute value from DUT. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } - - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); + VerifyOrReturn(CheckConstraintType("rebootCount", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestRebootTargetDevice_3() + { + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot("alpha", value); + } + + CHIP_ERROR TestRebootTargetDeviceDUT_4() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestRebootTargetDevice_5() + { + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot("alpha", value); + } + + CHIP_ERROR TestRebootTargetDeviceDUT_6() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_7() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestDutRebootsAndThReadsAUpTimeAttributeValueOfDutSinceSomeArbitraryStartTimeOfDutRebooting_8() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); + [cluster readAttributeUpTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"DUT reboots and TH reads a UpTime attribute value of DUT since some arbitrary start time of DUT rebooting. " + @"Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - + VerifyOrReturn(CheckConstraintType("upTime", "", "uint64")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestThReadsATotalOperationalHoursAttributeValueFromDut_9() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + [cluster readAttributeTotalOperationalHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads a TotalOperationalHours attribute value from DUT. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(3))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 2UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 4UL)); - } - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintType("totalOperationalHours", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestRebootTargetDevice_10() + { + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot("alpha", value); + } + + CHIP_ERROR TestRebootTargetDeviceDUT_11() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_12() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsBootReasonAttributeValueFromDut_13() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device + endpoint:0 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + [cluster readAttributeBootReasonsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads BootReason attribute value from DUT. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(3))); - VerifyOrReturn(CheckValue("", actualValue[0], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 3UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 5UL)); - } + VerifyOrReturn(CheckConstraintMinValue("bootReasons", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("bootReasons", [value unsignedCharValue], 6U)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + CHIP_ERROR TestThReadsActiveHardwareFaultsAttributeValueFromDut_14() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestThReadsActiveRadioFaultsAttributeValueFromDut_15() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestThReadsActiveNetworkFaultsAttributeValueFromDut_16() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); @@ -19266,11 +19379,11 @@ class Test_TC_CGEN_1_1 : public TestCommandBridge { } }; -class Test_TC_CGEN_2_1 : public TestCommandBridge { +class Test_TC_I_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CGEN_2_1() - : TestCommandBridge("Test_TC_CGEN_2_1") + Test_TC_I_1_1() + : TestCommandBridge("Test_TC_I_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -19280,7 +19393,7 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CGEN_2_1() {} + ~Test_TC_I_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -19288,11 +19401,11 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CGEN_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CGEN_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -19309,73 +19422,46 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH1 reads the BreadCrumb Attribute from the DUT\n"); - if (ShouldSkip("CGEN.S.A0000")) { - NextTest(); - return; - } - err = TestTh1ReadsTheBreadCrumbAttributeFromTheDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision attribute from the DUT\n"); + err = TestThReadsTheClusterRevisionAttributeFromTheDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH1 writes the BreadCrumb attribute as 1 to the DUT\n"); - if (ShouldSkip("CGEN.S.A0000")) { - NextTest(); - return; - } - err = TestTh1WritesTheBreadCrumbAttributeAs1ToTheDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap attribute from the DUT\n"); + err = TestThReadsTheFeatureMapAttributeFromTheDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH1 reads the BreadCrumb attribute from the DUT\n"); - if (ShouldSkip("CGEN.S.A0000")) { - NextTest(); - return; - } - err = TestTh1ReadsTheBreadCrumbAttributeFromTheDut_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH1 reads the RegulatoryConfig attribute from the DUT\n"); - if (ShouldSkip("CGEN.S.A0002")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip(" !I.C.C40.Tx ")) { NextTest(); return; } - err = TestTh1ReadsTheRegulatoryConfigAttributeFromTheDut_4(); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH1 reads the LocationCapability attribute from the DUT\n"); - if (ShouldSkip("CGEN.S.A0003")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("I.C.C40.Tx")) { NextTest(); return; } - err = TestTh1ReadsTheLocationCapabilityAttributeFromTheDut_5(); + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); break; case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : TH1 reads BasicCommissioningInfo attribute from DUT and Verify that the " - "BasicCommissioningInfo attribute has the following field: FailSafeExpiryLengthSeconds field value is within a " - "duration range of 0 to 65535\n"); - if (ShouldSkip("CGEN.S.A0001")) { - NextTest(); - return; - } - err = TestTh1ReadsBasicCommissioningInfoAttributeFromDutAndVerifyThatTheBasicCommissioningInfoAttributeHasTheFollowingFieldFailSafeExpiryLengthSecondsFieldValueIsWithinADurationRangeOf0To65535_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_6(); break; case 7: ChipLogProgress(chipTool, - " ***** Test Step 7 : Step 6 is implicitly validating the attribute(BasicCommissioningInfo) constraints, as long " - "as the payload is being parsed successfully\n"); + " ***** Test Step 7 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - err = TestStep6IsImplicitlyValidatingTheAttributeBasicCommissioningInfoConstraintsAsLongAsThePayloadIsBeingParsedSuccessfully_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : TH1 reads SupportsConcurrentConnection attribute from the DUT\n"); - if (ShouldSkip("CGEN.S.A0004")) { - NextTest(); - return; - } - err = TestTh1ReadsSupportsConcurrentConnectionAttributeFromTheDut_8(); + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_7(); break; } @@ -19412,9 +19498,6 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -19428,7 +19511,7 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 8; chip::Optional mNodeId; chip::Optional mCluster; @@ -19442,65 +19525,71 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestTh1ReadsTheBreadCrumbAttributeFromTheDut_1() + CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads the BreadCrumb Attribute from the DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("breadcrumb", "", "uint64")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1WritesTheBreadCrumbAttributeAs1ToTheDut_2() + CHIP_ERROR TestThReadsTheFeatureMapAttributeFromTheDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id breadcrumbArgument; - breadcrumbArgument = [NSNumber numberWithUnsignedLongLong:1ULL]; - [cluster writeAttributeBreadcrumbWithValue:breadcrumbArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH1 writes the BreadCrumb attribute as 1 to the DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the FeatureMap attribute from the DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1ReadsTheBreadCrumbAttributeFromTheDut_3() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBreadcrumbWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads the BreadCrumb attribute from the DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("Breadcrumb", actualValue, 1ULL)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); }]; @@ -19508,21 +19597,19 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1ReadsTheRegulatoryConfigAttributeFromTheDut_4() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRegulatoryConfigWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads the RegulatoryConfig attribute from the DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("regulatoryConfig", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("regulatoryConfig", [value unsignedCharValue], 2U)); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); NextTest(); }]; @@ -19530,21 +19617,20 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1ReadsTheLocationCapabilityAttributeFromTheDut_5() + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLocationCapabilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads the LocationCapability attribute from the DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("locationCapability", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("locationCapability", [value unsignedCharValue], 2U)); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 64UL)); NextTest(); }]; @@ -19552,32 +19638,30 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - TestTh1ReadsBasicCommissioningInfoAttributeFromDutAndVerifyThatTheBasicCommissioningInfoAttributeHasTheFollowingFieldFailSafeExpiryLengthSecondsFieldValueIsWithinADurationRangeOf0To65535_6() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBasicCommissioningInfoWithCompletionHandler:^( - MTRGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, NSError * _Nullable err) { - NSLog( - @"TH1 reads BasicCommissioningInfo attribute from DUT and Verify that the BasicCommissioningInfo attribute has the " - @"following field: FailSafeExpiryLengthSeconds field value is within a duration range of 0 to 65535 Error: %@", - err); + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR - TestStep6IsImplicitlyValidatingTheAttributeBasicCommissioningInfoConstraintsAsLongAsThePayloadIsBeingParsedSuccessfully_7() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_7() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); @@ -19585,35 +19669,14 @@ class Test_TC_CGEN_2_1 : public TestCommandBridge { value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); } +}; - CHIP_ERROR TestTh1ReadsSupportsConcurrentConnectionAttributeFromTheDut_8() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralCommissioning * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster - readAttributeSupportsConcurrentConnectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads SupportsConcurrentConnection attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("supportsConcurrentConnection", "", "bool")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_DGGEN_1_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DGGEN_1_1() - : TestCommandBridge("Test_TC_DGGEN_1_1") - , mTestIndex(0) +class Test_TC_I_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_I_2_1() + : TestCommandBridge("Test_TC_I_2_1") + , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -19622,7 +19685,7 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DGGEN_1_1() {} + ~Test_TC_I_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -19630,11 +19693,11 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGGEN_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGGEN_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -19651,24 +19714,12 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the IdentifyTime attribute from the DUT\n"); + err = TestThReadsTheIdentifyTimeAttributeFromTheDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - err = TestReadTheGlobalAttributeFeatureMap_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the IdentifyType attribute from the DUT\n"); + err = TestThReadsTheIdentifyTypeAttributeFromTheDut_2(); break; } @@ -19690,15 +19741,6 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -19712,7 +19754,7 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 3; chip::Optional mNodeId; chip::Optional mCluster; @@ -19726,129 +19768,39 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: FeatureMap Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } - - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestThReadsTheIdentifyTimeAttributeFromTheDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the IdentifyTime attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - } - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintType("identifyTime", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestThReadsTheIdentifyTypeAttributeFromTheDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the IdentifyType attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } + VerifyOrReturn(CheckConstraintType("identifyType", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("identifyType", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyType", [value unsignedCharValue], 5U)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; @@ -19856,11 +19808,11 @@ class Test_TC_DGGEN_1_1 : public TestCommandBridge { } }; -class Test_TC_DGGEN_2_1 : public TestCommandBridge { +class Test_TC_I_2_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DGGEN_2_1() - : TestCommandBridge("Test_TC_DGGEN_2_1") + Test_TC_I_2_2() + : TestCommandBridge("Test_TC_I_2_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -19870,7 +19822,7 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DGGEN_2_1() {} + ~Test_TC_I_2_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -19878,11 +19830,11 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DGGEN_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DGGEN_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -19899,126 +19851,89 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads NetworkInterfaces structure attribute from DUT.\n"); - if (ShouldSkip("DGGEN.S.A0000")) { + ChipLogProgress(chipTool, + " ***** Test Step 1 : TH sends Identify command to DUT, with the identify time field set to 0x003c (60s).\n"); + if (ShouldSkip("I.S.C00.Rsp")) { NextTest(); return; } - err = TestThReadsNetworkInterfacesStructureAttributeFromDut_1(); + err = TestThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x003c60s_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads a RebootCount attribute value from DUT.\n"); - if (ShouldSkip("DGGEN.S.A0001")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads immediately IdentifyTime attribute from DUT1\n"); + if (ShouldSkip("I.S.A0000")) { NextTest(); return; } - err = TestThReadsARebootCountAttributeValueFromDut_2(); + err = TestThReadsImmediatelyIdentifyTimeAttributeFromDut1_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reboot target device\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestRebootTargetDevice_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Wait 10000ms\n"); + err = TestWait10000ms_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reboot target device(DUT)\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : After 10 seconds, the TH reads IdentifyTime attribute from DUT\n"); + if (ShouldSkip("I.S.A0000")) { NextTest(); return; } - err = TestRebootTargetDeviceDUT_4(); + err = TestAfter10SecondsTheThReadsIdentifyTimeAttributeFromDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Reboot target device\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { + ChipLogProgress(chipTool, + " ***** Test Step 5 : TH sends IdentifyQuery command to DUT and Verify IdentifyQueryResponse command to TH,with " + "the Timeout field set to a value in the range 0x0000 to 0x0032\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - err = TestRebootTargetDevice_5(); + err = TestThSendsIdentifyQueryCommandToDutAndVerifyIdentifyQueryResponseCommandToTHwithTheTimeoutFieldSetToAValueInTheRange0x0000To0x0032_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Reboot target device(DUT)\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + ChipLogProgress(chipTool, + " ***** Test Step 6 : TH sends Identify command to DUT, with the identify time field set to 0x0000 (stop " + "identifying).\n"); + if (ShouldSkip("I.S.C00.Rsp")) { NextTest(); return; } - err = TestRebootTargetDeviceDUT_6(); + err = TestThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x0000StopIdentifying_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads immediately IdentifyTime attribute from DUT2\n"); + if (ShouldSkip("I.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsImmediatelyIdentifyTimeAttributeFromDut2_7(); break; case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : DUT reboots and TH reads a UpTime attribute value of DUT since some arbitrary start time of " - "DUT rebooting.\n"); - if (ShouldSkip("DGGEN.S.A0002")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : TH sends IdentifyQuery command to DUT \n"); + if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - err = TestDutRebootsAndThReadsAUpTimeAttributeValueOfDutSinceSomeArbitraryStartTimeOfDutRebooting_8(); + err = TestThSendsIdentifyQueryCommandToDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads a TotalOperationalHours attribute value from DUT.\n"); - if (ShouldSkip("DGGEN.S.A0003")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : TH writes a value of 0x000f (15s) to IdentifyTime attribute of DUT\n"); + if (ShouldSkip("I.S.A0000")) { NextTest(); return; } - err = TestThReadsATotalOperationalHoursAttributeValueFromDut_9(); + err = TestThWritesAValueOf0x000f15sToIdentifyTimeAttributeOfDut_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Reboot target device\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { - NextTest(); - return; - } - err = TestRebootTargetDevice_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Wait 5000ms\n"); + err = TestWait5000ms_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Reboot target device(DUT)\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { - NextTest(); - return; - } - err = TestRebootTargetDeviceDUT_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads BootReason attribute value from DUT.\n"); - if (ShouldSkip("DGGEN.S.A0004")) { - NextTest(); - return; - } - err = TestThReadsBootReasonAttributeValueFromDut_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads ActiveHardwareFaults attribute value from DUT.\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0005")) { - NextTest(); - return; - } - err = TestThReadsActiveHardwareFaultsAttributeValueFromDut_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads ActiveRadioFaults attribute value from DUT.\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0006")) { - NextTest(); - return; - } - err = TestThReadsActiveRadioFaultsAttributeValueFromDut_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads ActiveNetworkFaults attribute value from DUT.\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGGEN.S.A0007")) { + ChipLogProgress(chipTool, " ***** Test Step 11 : After 5 seconds, the TH reads IdentifyTime attribute from DUT\n"); + if (ShouldSkip("I.S.A0000")) { NextTest(); return; } - err = TestThReadsActiveNetworkFaultsAttributeValueFromDut_16(); + err = TestAfter5SecondsTheThReadsIdentifyTimeAttributeFromDut_11(); break; } @@ -20067,21 +19982,6 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -20095,7 +19995,7 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 17; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -20109,996 +20009,203 @@ class Test_TC_DGGEN_2_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThReadsNetworkInterfacesStructureAttributeFromDut_1() + CHIP_ERROR TestThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x003c60s_1() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNetworkInterfacesWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads NetworkInterfaces structure attribute from DUT. Error: %@", err); + __auto_type * params = [[MTRIdentifyClusterIdentifyParams alloc] init]; + params.identifyTime = [NSNumber numberWithUnsignedShort:60U]; + [cluster identifyWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Identify command to DUT, with the identify time field set to 0x003c (60s). Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("networkInterfaces", "", "list")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsARebootCountAttributeValueFromDut_2() + CHIP_ERROR TestThReadsImmediatelyIdentifyTimeAttributeFromDut1_2() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeRebootCountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads a RebootCount attribute value from DUT. Error: %@", err); + [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads immediately IdentifyTime attribute from DUT1 Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("rebootCount", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 55U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 65U)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestRebootTargetDevice_3() + CHIP_ERROR TestWait10000ms_3() { - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot("alpha", value); + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); } - CHIP_ERROR TestRebootTargetDeviceDUT_4() + CHIP_ERROR TestAfter10SecondsTheThReadsIdentifyTimeAttributeFromDut_4() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIP_ERROR TestRebootTargetDevice_5() - { - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot("alpha", value); + [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"After 10 seconds, the TH reads IdentifyTime attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 45U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 55U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestRebootTargetDeviceDUT_6() + CHIP_ERROR + TestThSendsIdentifyQueryCommandToDutAndVerifyIdentifyQueryResponseCommandToTHwithTheTimeoutFieldSetToAValueInTheRange0x0000To0x0032_5() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); value.expectedValue.Emplace(); value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_7() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestDutRebootsAndThReadsAUpTimeAttributeValueOfDutSinceSomeArbitraryStartTimeOfDutRebooting_8() + CHIP_ERROR TestThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x0000StopIdentifying_6() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeUpTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"DUT reboots and TH reads a UpTime attribute value of DUT since some arbitrary start time of DUT rebooting. " - @"Error: %@", - err); + __auto_type * params = [[MTRIdentifyClusterIdentifyParams alloc] init]; + params.identifyTime = [NSNumber numberWithUnsignedShort:0U]; + [cluster + identifyWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"TH sends Identify command to DUT, with the identify time field set to 0x0000 (stop identifying). Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("upTime", "", "uint64")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsATotalOperationalHoursAttributeValueFromDut_9() + CHIP_ERROR TestThReadsImmediatelyIdentifyTimeAttributeFromDut2_7() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeTotalOperationalHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads a TotalOperationalHours attribute value from DUT. Error: %@", err); + [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads immediately IdentifyTime attribute from DUT2 Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("totalOperationalHours", "", "uint32")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("identify time", actualValue, 0U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestRebootTargetDevice_10() - { - chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; - return Reboot("alpha", value); - } - - CHIP_ERROR TestRebootTargetDeviceDUT_11() + CHIP_ERROR TestThSendsIdentifyQueryCommandToDut_8() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); value.expectedValue.Emplace(); value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_12() + CHIP_ERROR TestThWritesAValueOf0x000f15sToIdentifyTimeAttributeOfDut_9() { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id identifyTimeArgument; + identifyTimeArgument = [NSNumber numberWithUnsignedShort:15U]; + [cluster writeAttributeIdentifyTimeWithValue:identifyTimeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes a value of 0x000f (15s) to IdentifyTime attribute of DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsBootReasonAttributeValueFromDut_13() + CHIP_ERROR TestWait5000ms_10() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestAfter5SecondsTheThReadsIdentifyTimeAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterGeneralDiagnostics * cluster = [[MTRBaseClusterGeneralDiagnostics alloc] initWithDevice:device - endpoint:0 - queue:mCallbackQueue]; + MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBootReasonsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads BootReason attribute value from DUT. Error: %@", err); + [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"After 5 seconds, the TH reads IdentifyTime attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("bootReasons", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("bootReasons", [value unsignedCharValue], 6U)); + VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 5U)); + VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 15U)); NextTest(); }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestThReadsActiveHardwareFaultsAttributeValueFromDut_14() +class Test_TC_I_2_3 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_I_2_3() + : TestCommandBridge("Test_TC_I_2_3") + , mTestIndex(0) { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - CHIP_ERROR TestThReadsActiveRadioFaultsAttributeValueFromDut_15() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestThReadsActiveNetworkFaultsAttributeValueFromDut_16() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } -}; - -class Test_TC_I_1_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_1_1() - : TestCommandBridge("Test_TC_I_1_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_I_1_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_1_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision attribute from the DUT\n"); - err = TestThReadsTheClusterRevisionAttributeFromTheDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap attribute from the DUT\n"); - err = TestThReadsTheFeatureMapAttributeFromTheDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); - break; - case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " - "supported events.\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 4U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsTheFeatureMapAttributeFromTheDut_2() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the FeatureMap attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } - - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(2))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 64UL)); - } - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } - - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } -}; - -class Test_TC_I_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_2_1() - : TestCommandBridge("Test_TC_I_2_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_I_2_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the IdentifyTime attribute from the DUT\n"); - err = TestThReadsTheIdentifyTimeAttributeFromTheDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the IdentifyType attribute from the DUT\n"); - err = TestThReadsTheIdentifyTypeAttributeFromTheDut_2(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestThReadsTheIdentifyTimeAttributeFromTheDut_1() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the IdentifyTime attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("identifyTime", "", "uint16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsTheIdentifyTypeAttributeFromTheDut_2() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeIdentifyTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the IdentifyType attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("identifyType", "", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("identifyType", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("identifyType", [value unsignedCharValue], 5U)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_I_2_2 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_2_2() - : TestCommandBridge("Test_TC_I_2_2") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_I_2_2() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_I_2_2\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_I_2_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : TH sends Identify command to DUT, with the identify time field set to 0x003c (60s).\n"); - if (ShouldSkip("I.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x003c60s_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads immediately IdentifyTime attribute from DUT1\n"); - if (ShouldSkip("I.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsImmediatelyIdentifyTimeAttributeFromDut1_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Wait 10000ms\n"); - err = TestWait10000ms_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : After 10 seconds, the TH reads IdentifyTime attribute from DUT\n"); - if (ShouldSkip("I.S.A0000")) { - NextTest(); - return; - } - err = TestAfter10SecondsTheThReadsIdentifyTimeAttributeFromDut_4(); - break; - case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : TH sends IdentifyQuery command to DUT and Verify IdentifyQueryResponse command to TH,with " - "the Timeout field set to a value in the range 0x0000 to 0x0032\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestThSendsIdentifyQueryCommandToDutAndVerifyIdentifyQueryResponseCommandToTHwithTheTimeoutFieldSetToAValueInTheRange0x0000To0x0032_5(); - break; - case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : TH sends Identify command to DUT, with the identify time field set to 0x0000 (stop " - "identifying).\n"); - if (ShouldSkip("I.S.C00.Rsp")) { - NextTest(); - return; - } - err = TestThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x0000StopIdentifying_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads immediately IdentifyTime attribute from DUT2\n"); - if (ShouldSkip("I.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsImmediatelyIdentifyTimeAttributeFromDut2_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : TH sends IdentifyQuery command to DUT \n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestThSendsIdentifyQueryCommandToDut_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH writes a value of 0x000f (15s) to IdentifyTime attribute of DUT\n"); - if (ShouldSkip("I.S.A0000")) { - NextTest(); - return; - } - err = TestThWritesAValueOf0x000f15sToIdentifyTimeAttributeOfDut_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Wait 5000ms\n"); - err = TestWait5000ms_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : After 5 seconds, the TH reads IdentifyTime attribute from DUT\n"); - if (ShouldSkip("I.S.A0000")) { - NextTest(); - return; - } - err = TestAfter5SecondsTheThReadsIdentifyTimeAttributeFromDut_11(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x003c60s_1() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRIdentifyClusterIdentifyParams alloc] init]; - params.identifyTime = [NSNumber numberWithUnsignedShort:60U]; - [cluster identifyWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Identify command to DUT, with the identify time field set to 0x003c (60s). Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsImmediatelyIdentifyTimeAttributeFromDut1_2() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads immediately IdentifyTime attribute from DUT1 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 55U)); - VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 65U)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait10000ms_3() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestAfter10SecondsTheThReadsIdentifyTimeAttributeFromDut_4() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"After 10 seconds, the TH reads IdentifyTime attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 45U)); - VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 55U)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR - TestThSendsIdentifyQueryCommandToDutAndVerifyIdentifyQueryResponseCommandToTHwithTheTimeoutFieldSetToAValueInTheRange0x0000To0x0032_5() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestThSendsIdentifyCommandToDutWithTheIdentifyTimeFieldSetTo0x0000StopIdentifying_6() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRIdentifyClusterIdentifyParams alloc] init]; - params.identifyTime = [NSNumber numberWithUnsignedShort:0U]; - [cluster - identifyWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"TH sends Identify command to DUT, with the identify time field set to 0x0000 (stop identifying). Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsImmediatelyIdentifyTimeAttributeFromDut2_7() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads immediately IdentifyTime attribute from DUT2 Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("identify time", actualValue, 0U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThSendsIdentifyQueryCommandToDut_8() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestThWritesAValueOf0x000f15sToIdentifyTimeAttributeOfDut_9() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id identifyTimeArgument; - identifyTimeArgument = [NSNumber numberWithUnsignedShort:15U]; - [cluster writeAttributeIdentifyTimeWithValue:identifyTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes a value of 0x000f (15s) to IdentifyTime attribute of DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait5000ms_10() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestAfter5SecondsTheThReadsIdentifyTimeAttributeFromDut_11() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterIdentify * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeIdentifyTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"After 5 seconds, the TH reads IdentifyTime attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintMinValue("identifyTime", [value unsignedShortValue], 5U)); - VerifyOrReturn(CheckConstraintMaxValue("identifyTime", [value unsignedShortValue], 15U)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_I_2_3 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_I_2_3() - : TestCommandBridge("Test_TC_I_2_3") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_I_2_3() {} - - /////////// TestCommand Interface ///////// - void NextTest() override + ~Test_TC_I_2_3() {} + + /////////// TestCommand Interface ///////// + void NextTest() override { CHIP_ERROR err = CHIP_NO_ERROR; @@ -22602,7 +21709,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { break; case 5: ChipLogProgress(chipTool, " ***** Test Step 5 : Reads the MinLevel attribute\n"); - if (ShouldSkip("LVL.S.A0002")) { + if (ShouldSkip("LVL.S.A0002 && LVL.S.F01")) { NextTest(); return; } @@ -22610,7 +21717,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { break; case 6: ChipLogProgress(chipTool, " ***** Test Step 6 : Reads the MinLevel attribute\n"); - if (ShouldSkip("LVL.S.A0002")) { + if (ShouldSkip("LVL.S.A0002 && !LVL.S.F01")) { NextTest(); return; } @@ -22618,7 +21725,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { break; case 7: ChipLogProgress(chipTool, " ***** Test Step 7 : Reads the MaxLevel attribute\n"); - if (ShouldSkip("LVL.S.A0003")) { + if (ShouldSkip("LVL.S.A0003 && LVL.S.F01")) { NextTest(); return; } @@ -22626,7 +21733,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { break; case 8: ChipLogProgress(chipTool, " ***** Test Step 8 : Reads the MaxLevel attribute\n"); - if (ShouldSkip("LVL.S.A0003")) { + if (ShouldSkip("LVL.S.A0003 && !LVL.S.F01")) { NextTest(); return; } @@ -22674,7 +21781,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { break; case 14: ChipLogProgress(chipTool, " ***** Test Step 14 : Step 7b & 7C Reads the CurrentFrequency attribute\n"); - if (ShouldSkip("LVL.S.A0004 && LVL.S.A0005")) { + if (ShouldSkip("LVL.S.A0004 && LVL.S.A0005 && LVL.S.A0006")) { NextTest(); return; } @@ -22690,7 +21797,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { break; case 16: ChipLogProgress(chipTool, " ***** Test Step 16 : Reads the OnLevel attribute \n"); - if (ShouldSkip("LVL.S.F01")) { + if (ShouldSkip("LVL.S.F01 && LVL.S.A0011")) { NextTest(); return; } @@ -22698,7 +21805,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { break; case 17: ChipLogProgress(chipTool, " ***** Test Step 17 : Reads the OnLevel attribute \n"); - if (ShouldSkip(" !LVL.S.F01 ")) { + if (ShouldSkip("LVL.S.A0011 && !LVL.S.F01")) { NextTest(); return; } @@ -22897,11 +22004,6 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("current level", actualValue, 254U)); - } - VerifyOrReturn(CheckConstraintType("currentLevel", "", "uint8")); { CurrentLevelValue = value; @@ -22926,11 +22028,6 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("remaining time", actualValue, 0U)); - } - VerifyOrReturn(CheckConstraintType("remainingTime", "", "uint16")); NextTest(); }]; @@ -22958,8 +22055,6 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { } VerifyOrReturn(CheckConstraintType("minLevel", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("minLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("minLevel", [value unsignedCharValue], 1U)); { MinLevelValue = value; } @@ -23017,8 +22112,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { } VerifyOrReturn(CheckConstraintType("maxLevel", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("maxLevel", [value unsignedCharValue], 1U)); - VerifyOrReturn(CheckConstraintMaxValue("maxLevel", [value unsignedCharValue], 254U)); + VerifyOrReturn(CheckConstraintMinValue("maxLevel", [value unsignedCharValue], MinLevelValue)); { MaxLevelValue = value; } @@ -23044,7 +22138,7 @@ class Test_TC_LVL_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("maxLevel", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("maxLevel", [value unsignedCharValue], 1U)); + VerifyOrReturn(CheckConstraintMinValue("maxLevel", [value unsignedCharValue], MinLevelValue1)); VerifyOrReturn(CheckConstraintMaxValue("maxLevel", [value unsignedCharValue], 254U)); { MaxLevelValue1 = value; @@ -24240,12 +23334,12 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { err = TestReadsTheMaxLevelAttribute_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : sends a Move to level command\n"); + ChipLogProgress(chipTool, " ***** Test Step 3 : sends a MoveToLevelWithOnOff command\n"); if (ShouldSkip("LVL.S.C00.Rsp")) { NextTest(); return; } - err = TestSendsAMoveToLevelCommand_3(); + err = TestSendsAMoveToLevelWithOnOffCommand_3(); break; case 4: ChipLogProgress(chipTool, " ***** Test Step 4 : Wait 100ms\n"); @@ -24280,72 +23374,64 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { err = TestReadsCurrentLevelAttributeFromDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Reads On Off Transition Time attribute from DUT\n"); - if (ShouldSkip("LVL.S.A0010")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : sends a Move to level command\n"); + if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0010")) { NextTest(); return; } - err = TestReadsOnOffTransitionTimeAttributeFromDut_9(); + err = TestSendsAMoveToLevelCommand_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : sends a Move to level command\n"); - if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0010")) { - NextTest(); - return; - } - err = TestSendsAMoveToLevelCommand_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Wait 11000ms\n"); + err = TestWait11000ms_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Wait 11000ms\n"); - err = TestWait11000ms_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Reads CurrentLevel attribute from DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 11 : Reads CurrentLevel attribute from DUT\n"); if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { NextTest(); return; } - err = TestReadsCurrentLevelAttributeFromDut_12(); + err = TestReadsCurrentLevelAttributeFromDut_11(); break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Reads the OnOffTransitionTime attribute from the DUT\n"); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Reads the OnOffTransitionTime attribute from the DUT\n"); if (ShouldSkip("LVL.S.A0010")) { NextTest(); return; } - err = TestReadsTheOnOffTransitionTimeAttributeFromTheDut_13(); + err = TestReadsTheOnOffTransitionTimeAttributeFromTheDut_12(); break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : sends a Move to level command\n"); + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : sends a Move to level command\n"); if (ShouldSkip("LVL.S.C00.Rsp && LVL.S.A0010")) { NextTest(); return; } - err = TestSendsAMoveToLevelCommand_14(); + err = TestSendsAMoveToLevelCommand_13(); break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 1000ms\n"); - err = TestWait1000ms_15(); + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 1000ms\n"); + err = TestWait1000ms_14(); break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Reads CurrentLevel attribute from DUT\n"); + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Reads CurrentLevel attribute from DUT\n"); if (ShouldSkip("LVL.S.A0000")) { NextTest(); return; } - err = TestReadsCurrentLevelAttributeFromDut_16(); + err = TestReadsCurrentLevelAttributeFromDut_15(); break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Reset level to 254\n"); + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Reset level to 254\n"); if (ShouldSkip("LVL.S.C00.Rsp")) { NextTest(); return; } - err = TestResetLevelTo254_17(); + err = TestResetLevelTo254_16(); break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Wait 100ms\n"); - err = TestWait100ms_18(); + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Wait 100ms\n"); + err = TestWait100ms_17(); break; } @@ -24412,9 +23498,6 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -24428,7 +23511,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 19; + const uint16_t mTestCount = 18; chip::Optional mNodeId; chip::Optional mCluster; @@ -24482,7 +23565,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsAMoveToLevelCommand_3() + CHIP_ERROR TestSendsAMoveToLevelWithOnOffCommand_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24490,19 +23573,17 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + __auto_type * params = [[MTRLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; params.level = [NSNumber numberWithUnsignedChar:64U]; params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionMask = [NSNumber numberWithUnsignedChar:1U]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1U]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"sends a Move to level command Error: %@", err); + [cluster moveToLevelWithOnOffWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"sends a MoveToLevelWithOnOff command Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -24594,27 +23675,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOnOffTransitionTimeAttributeFromDut_9() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeOnOffTransitionTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads On Off Transition Time attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("onOffTransitionTime", "", "uint16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSendsAMoveToLevelCommand_10() + CHIP_ERROR TestSendsAMoveToLevelCommand_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24639,14 +23700,14 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait11000ms_11() + CHIP_ERROR TestWait11000ms_10() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 11000UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_12() + CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24669,8 +23730,9 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + NSNumber * _Nonnull OnOffTransitionTimeValue; - CHIP_ERROR TestReadsTheOnOffTransitionTimeAttributeFromTheDut_13() + CHIP_ERROR TestReadsTheOnOffTransitionTimeAttributeFromTheDut_12() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24684,13 +23746,17 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("onOffTransitionTime", "", "uint16")); + { + OnOffTransitionTimeValue = value; + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsAMoveToLevelCommand_14() + CHIP_ERROR TestSendsAMoveToLevelCommand_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24700,7 +23766,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; params.level = [NSNumber numberWithUnsignedChar:64U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:65535U]; params.optionMask = [NSNumber numberWithUnsignedChar:1U]; params.optionOverride = [NSNumber numberWithUnsignedChar:1U]; [cluster moveToLevelWithParams:params @@ -24715,14 +23781,14 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait1000ms_15() + CHIP_ERROR TestWait1000ms_14() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 1000UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_16() + CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_15() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24746,7 +23812,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestResetLevelTo254_17() + CHIP_ERROR TestResetLevelTo254_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24771,7 +23837,7 @@ class Test_TC_LVL_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait100ms_18() + CHIP_ERROR TestWait100ms_17() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; value.ms = 100UL; @@ -24830,12 +23896,12 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { err = TestReadsMinlevelAttributeFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : sends a Move to level command\n"); + ChipLogProgress(chipTool, " ***** Test Step 2 : sends a MoveToLevelWithOnOff command\n"); if (ShouldSkip("LVL.S.C00.Rsp")) { NextTest(); return; } - err = TestSendsAMoveToLevelCommand_2(); + err = TestSendsAMoveToLevelWithOnOffCommand_2(); break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : reads max level attribute from DUT\n"); @@ -25064,7 +24130,7 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsAMoveToLevelCommand_2() + CHIP_ERROR TestSendsAMoveToLevelWithOnOffCommand_2() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -25072,19 +24138,17 @@ class Test_TC_LVL_4_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRLevelControlClusterMoveToLevelParams alloc] init]; + __auto_type * params = [[MTRLevelControlClusterMoveToLevelWithOnOffParams alloc] init]; params.level = [NSNumber numberWithUnsignedChar:1U]; params.transitionTime = [NSNumber numberWithUnsignedShort:0U]; - params.optionMask = [NSNumber numberWithUnsignedChar:1U]; - params.optionOverride = [NSNumber numberWithUnsignedChar:1U]; - [cluster moveToLevelWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"sends a Move to level command Error: %@", err); + [cluster moveToLevelWithOnOffWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"sends a MoveToLevelWithOnOff command Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -26107,8 +25171,8 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRLevelControlClusterStopParams alloc] init]; - params.optionMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionOverride = [NSNumber numberWithUnsignedChar:0U]; + params.optionMask = [NSNumber numberWithUnsignedChar:1U]; + params.optionOverride = [NSNumber numberWithUnsignedChar:1U]; [cluster stopWithParams:params completionHandler:^(NSError * _Nullable err) { NSLog(@"Sends stop command to DUT Error: %@", err); @@ -26143,8 +25207,8 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 23U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 27U)); + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 22U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 28U)); VerifyOrReturn(CheckConstraintNotValue("currentLevel", value, CurrentLevelValue)); NextTest(); @@ -26194,8 +25258,8 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRLevelControlClusterStopParams alloc] init]; - params.optionMask = [NSNumber numberWithUnsignedChar:0U]; - params.optionOverride = [NSNumber numberWithUnsignedChar:0U]; + params.optionMask = [NSNumber numberWithUnsignedChar:1U]; + params.optionOverride = [NSNumber numberWithUnsignedChar:1U]; [cluster stopWithParams:params completionHandler:^(NSError * _Nullable err) { NSLog(@"Sends stop command to DUT Error: %@", err); @@ -26230,8 +25294,8 @@ class Test_TC_LVL_6_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 48U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 52U)); + VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 45U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 55U)); VerifyOrReturn(CheckConstraintNotValue("currentLevel", value, CurrentLevelValue)); NextTest(); @@ -26731,17 +25795,13 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(5))); - VerifyOrReturn(CheckValue("", actualValue[0], 65528UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 65529UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 65531UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 65532UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 65533UL)); - } - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + NextTest(); }]; @@ -26761,13 +25821,9 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - } - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + NextTest(); }]; @@ -26787,13 +25843,9 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 1UL)); - } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); + NextTest(); }]; @@ -27038,15 +26090,11 @@ class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(3))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); - } - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + NextTest(); }]; @@ -27066,13 +26114,9 @@ class Test_TC_APPLAUNCHER_1_3 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 3UL)); - } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 3UL)); + NextTest(); }]; @@ -27317,16 +26361,12 @@ class Test_TC_MEDIAINPUT_1_4 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(4))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 3UL)); - } - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + NextTest(); }]; @@ -27843,15 +26883,11 @@ class Test_TC_CHANNEL_1_6 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(3))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 2UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 3UL)); - } - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + NextTest(); }]; @@ -28133,13 +27169,9 @@ class Test_TC_MEDIAPLAYBACK_1_7 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 10UL)); - } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 10UL)); + NextTest(); }]; @@ -28482,7 +27514,7 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { break; case 4: ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AttributeList\n"); - if (ShouldSkip("!MC_TGTNAV.S.A0001")) { + if (ShouldSkip(" !MC_TGTNAV.S.A0001 ")) { NextTest(); return; } @@ -28631,19 +27663,15 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(7))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 65528UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 65529UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 65531UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 65532UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 65533UL)); - } - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + NextTest(); }]; @@ -28663,18 +27691,14 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(6))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 65528UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 65529UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 65531UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 65532UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 65533UL)); - } - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + NextTest(); }]; @@ -28694,13 +27718,9 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - } - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + NextTest(); }]; @@ -28720,13 +27740,9 @@ class Test_TC_TGTNAV_1_9 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 1UL)); - } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); + NextTest(); }]; @@ -29268,13 +28284,9 @@ class Test_TC_CONTENTLAUNCHER_1_11 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 2UL)); - } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 2UL)); + NextTest(); }]; @@ -29485,17 +28497,13 @@ class Test_TC_ALOGIN_1_12 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(5))); - VerifyOrReturn(CheckValue("", actualValue[0], 65528UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 65529UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 65531UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 65532UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 65533UL)); - } - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + NextTest(); }]; @@ -29515,15 +28523,11 @@ class Test_TC_ALOGIN_1_12 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(3))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 2UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 3UL)); - } - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + NextTest(); }]; @@ -29543,13 +28547,9 @@ class Test_TC_ALOGIN_1_12 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 1UL)); - } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); + NextTest(); }]; @@ -34906,13 +33906,9 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - } - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + NextTest(); }]; @@ -36936,7 +35932,7 @@ class Test_TC_OO_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : read the optional global attribute: FeatureMap\n"); - if (ShouldSkip("OO_LT")) { + if (ShouldSkip("OO.S.F00")) { NextTest(); return; } @@ -36944,29 +35940,49 @@ class Test_TC_OO_1_1 : public TestCommandBridge { break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("OO.S.F00")) { + NextTest(); + return; + } err = TestReadTheGlobalAttributeAttributeList_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); - if (ShouldSkip("OO_LT")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AttributeList\n"); + if (ShouldSkip(" !OO.S.F00 ")) { NextTest(); return; } - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + err = TestReadTheGlobalAttributeAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("OO.S.F00")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_5(); break; case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip(" !OO.S.F00 ")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_7(); + break; + case 8: ChipLogProgress(chipTool, - " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + " ***** Test Step 8 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " "supported events.\n"); if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_8(); break; } @@ -37000,6 +36016,12 @@ class Test_TC_OO_1_1 : public TestCommandBridge { case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -37013,7 +36035,7 @@ class Test_TC_OO_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 9; chip::Optional mNodeId; chip::Optional mCluster; @@ -37102,7 +36124,32 @@ class Test_TC_OO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -37113,25 +36160,43 @@ class Test_TC_OO_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(6))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 64UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 65UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 66UL)); - } + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 64UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 65UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 66UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_6() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -37154,7 +36219,7 @@ class Test_TC_OO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_8() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); @@ -44969,10 +44034,6 @@ class Test_TC_TSTAT_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Read the optional global attribute constraints: FeatureMap\n"); - if (ShouldSkip("( TSTAT_HEAT || TSTAT_COOL || TSTAT_OCC || TSTAT_SCH || TSTAT_SB || TSTAT_AUTO )")) { - NextTest(); - return; - } err = TestReadTheOptionalGlobalAttributeConstraintsFeatureMap_2(); break; case 3: @@ -45226,415 +44287,406 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress( - chipTool, " ***** Test Step 1 : Reads constraints of mandatory attributes from DUT: LocalTemperature\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutLocalTemperature_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads mandatory attributes from DUT: LocalTemperature\n"); + if (ShouldSkip("TSTAT.S.A0000")) { + NextTest(); + return; + } + err = TestReadsMandatoryAttributesFromDutLocalTemperature_1(); break; case 2: - ChipLogProgress( - chipTool, " ***** Test Step 2 : Reads constraints of mandatory attributes from DUT: AbsMinHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinHeatSetpointLimit_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read OutdoorTemperature attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0001")) { + NextTest(); + return; + } + err = TestReadOutdoorTemperatureAttributeFromTheDut_2(); break; case 3: - ChipLogProgress( - chipTool, " ***** Test Step 3 : Reads constraints of mandatory attributes from DUT: AbsMaxHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read Occupancy attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0002")) { + NextTest(); + return; + } + err = TestReadOccupancyAttributeFromTheDut_3(); break; case 4: - ChipLogProgress( - chipTool, " ***** Test Step 4 : Reads constraints of optional attributes from DUT: AbsMinCoolSetpointLimit\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutAbsMinCoolSetpointLimit_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads mandatory attributes from DUT: AbsMinHeatSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.A0003")) { + NextTest(); + return; + } + err = TestReadsMandatoryAttributesFromDutAbsMinHeatSetpointLimit_4(); break; case 5: - ChipLogProgress( - chipTool, " ***** Test Step 5 : Reads constraints of optional attributes from DUT: AbsMaxCoolSetpointLimit\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutAbsMaxCoolSetpointLimit_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Reads mandatory attributes from DUT: AbsMaxHeatSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.A0004")) { + NextTest(); + return; + } + err = TestReadsMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_5(); break; case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Read PICoolingDemand attribute from the DUT Verify that the DUT responds with a uint8 " - "value.The value has to be in the range of 0 to 100\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads optional attributes from DUT: AbsMinCoolSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.A0005")) { NextTest(); return; } - err = TestReadPICoolingDemandAttributeFromTheDutVerifyThatTheDutRespondsWithAUint8ValueTheValueHasToBeInTheRangeOf0To100_6(); + err = TestReadsOptionalAttributesFromDutAbsMinCoolSetpointLimit_6(); break; case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : Read PIHeatingDemand attribute from the DUT and Verify that the DUT responds with a uint8 " - "value.The value has to be in the range of 0 to 100\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 7 : Reads optional attributes from DUT: AbsMaxCoolSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.A0006")) { NextTest(); return; } - err = TestReadPIHeatingDemandAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueTheValueHasToBeInTheRangeOf0To100_7(); + err = TestReadsOptionalAttributesFromDutAbsMaxCoolSetpointLimit_7(); break; case 8: - ChipLogProgress( - chipTool, " ***** Test Step 8 : Reads constraints of optional attributes from DUT: OccupiedCoolingSetpoint\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutOccupiedCoolingSetpoint_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read PICoolingDemand attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0007")) { + NextTest(); + return; + } + err = TestReadPICoolingDemandAttributeFromTheDut_8(); break; case 9: - ChipLogProgress( - chipTool, " ***** Test Step 9 : Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Read PIHeatingDemand attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0008")) { + NextTest(); + return; + } + err = TestReadPIHeatingDemandAttributeFromTheDut_9(); break; case 10: - ChipLogProgress(chipTool, - " ***** Test Step 10 : Read UnoccupiedCoolingSetpoint attribute from the DUT and Verify that the DUT responds with " - "an int16 value\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : Read HVACSystemTypeConfiguration attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0009")) { NextTest(); return; } - err = TestReadUnoccupiedCoolingSetpointAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt16Value_10(); + err = TestReadHVACSystemTypeConfigurationAttributeFromTheDut_10(); break; case 11: - ChipLogProgress(chipTool, - " ***** Test Step 11 : Read UnoccupiedHeatingSetpoint attribute from the DUT and Verify that the DUT responds with " - "an int16 value\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 11 : Read LocalTemperatureCalibration attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0010")) { NextTest(); return; } - err = TestReadUnoccupiedHeatingSetpointAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt16Value_11(); + err = TestReadLocalTemperatureCalibrationAttributeFromTheDut_11(); break; case 12: - ChipLogProgress( - chipTool, " ***** Test Step 12 : Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Reads optional attributes from DUT: OccupiedCoolingSetpoint\n"); + if (ShouldSkip("TSTAT.S.A0011")) { + NextTest(); + return; + } + err = TestReadsOptionalAttributesFromDutOccupiedCoolingSetpoint_12(); break; case 13: - ChipLogProgress( - chipTool, " ***** Test Step 13 : Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Reads mandatory attributes from DUT: OccupiedHeatingSetpoint\n"); + if (ShouldSkip("TSTAT.S.A0012")) { + NextTest(); + return; + } + err = TestReadsMandatoryAttributesFromDutOccupiedHeatingSetpoint_13(); break; case 14: - ChipLogProgress( - chipTool, " ***** Test Step 14 : Reads constraints of optional attributes from DUT: MinCoolSetpointLimit\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutMinCoolSetpointLimit_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Read UnoccupiedCoolingSetpoint attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0013")) { + NextTest(); + return; + } + err = TestReadUnoccupiedCoolingSetpointAttributeFromTheDut_14(); break; case 15: - ChipLogProgress( - chipTool, " ***** Test Step 15 : Reads constraints of optional attributes from DUT: MaxCoolSetpointLimit\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutMaxCoolSetpointLimit_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Read UnoccupiedHeatingSetpoint attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0014")) { + NextTest(); + return; + } + err = TestReadUnoccupiedHeatingSetpointAttributeFromTheDut_15(); break; case 16: - ChipLogProgress( - chipTool, " ***** Test Step 16 : Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : Reads mandatory attributes from DUT: MinHeatSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.A0015")) { + NextTest(); + return; + } + err = TestReadsMandatoryAttributesFromDutMinHeatSetpointLimit_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Reads constraints of mandatory attributes from DUT: SystemMode\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : Reads mandatory attributes from DUT: MaxHeatSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.A0016")) { + NextTest(); + return; + } + err = TestReadsMandatoryAttributesFromDutMaxHeatSetpointLimit_17(); break; case 18: - ChipLogProgress( - chipTool, " ***** Test Step 18 : Read OutdoorTemperature attribute from the DUT and Verify the datatype\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 18 : Reads optional attributes from DUT: MinCoolSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.A0017")) { NextTest(); return; } - err = TestReadOutdoorTemperatureAttributeFromTheDutAndVerifyTheDatatype_18(); + err = TestReadsOptionalAttributesFromDutMinCoolSetpointLimit_18(); break; case 19: - ChipLogProgress(chipTool, - " ***** Test Step 19 : Read Occupancy attribute from the DUT and Verify the datatype and response value\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 19 : Reads optional attributes from DUT: MaxCoolSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.A0018")) { NextTest(); return; } - err = TestReadOccupancyAttributeFromTheDutAndVerifyTheDatatypeAndResponseValue_19(); + err = TestReadsOptionalAttributesFromDutMaxCoolSetpointLimit_19(); break; case 20: - ChipLogProgress(chipTool, - " ***** Test Step 20 : Read HVACSystemTypeConfiguration attribute from the DUT and Verify that the DUT responds " - "with a map8 value. The value has to be in the range of 0x00 to 0x3f\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 20 : Reads optional attributes from DUT: MinSetpointDeadBand\n"); + if (ShouldSkip("TSTAT.S.A0019")) { NextTest(); return; } - err = TestReadHVACSystemTypeConfigurationAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x3f_20(); + err = TestReadsOptionalAttributesFromDutMinSetpointDeadBand_20(); break; case 21: - ChipLogProgress(chipTool, - " ***** Test Step 21 : Read LocalTemperatureCalibration attribute from the DUT and Verify that the DUT responds " - "with an int8 value.The value has to be in the range of -25 to 25\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 21 : Read RemoteSensing attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A001a")) { NextTest(); return; } - err = TestReadLocalTemperatureCalibrationAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt8ValueTheValueHasToBeInTheRangeOf25To25_21(); + err = TestReadRemoteSensingAttributeFromTheDut_21(); break; case 22: - ChipLogProgress( - chipTool, " ***** Test Step 22 : Reads constraints of optional attributes from DUT: MinSetpointDeadBand\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_22(); + ChipLogProgress(chipTool, " ***** Test Step 22 : Reads mandatory attributes from DUT: ControlSequenceOfOperation\n"); + if (ShouldSkip("TSTAT.S.A001b")) { + NextTest(); + return; + } + err = TestReadsMandatoryAttributesFromDutControlSequenceOfOperation_22(); break; case 23: - ChipLogProgress(chipTool, - " ***** Test Step 23 : Read RemoteSensing attribute from the DUT and Verify that the DUT responds with a map8 " - "value. The value has to be in the range of 0x00 to 0x07\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 23 : Reads mandatory attributes from DUT: SystemMode\n"); + if (ShouldSkip("TSTAT.S.A001c")) { NextTest(); return; } - err = TestReadRemoteSensingAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x07_23(); + err = TestReadsMandatoryAttributesFromDutSystemMode_23(); break; case 24: ChipLogProgress(chipTool, " ***** Test Step 24 : Read AlarmMask attribute from the DUT and Verify that the DUT responds with a map8 " "value.The value has to be in the range of 0x00 to 0x07.\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + if (ShouldSkip("PICS_USER_PROMPT && TSTAT.S.A001d")) { NextTest(); return; } err = TestReadAlarmMaskAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x07_24(); break; case 25: - ChipLogProgress(chipTool, - " ***** Test Step 25 : Read ThermostatRunningMode attribute from the DUT and Verify that the DUT responds with an " - "enum8 value.The value has to be 0, 3 or 4\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 25 : Read ThermostatRunningMode attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A001e")) { NextTest(); return; } - err = TestReadThermostatRunningModeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBe03Or4_25(); + err = TestReadThermostatRunningModeAttributeFromTheDut_25(); break; case 26: ChipLogProgress(chipTool, " ***** Test Step 26 : Reads constraints of optional attributes from DUT: StartOfWeek\n"); + if (ShouldSkip("TSTAT.S.A0020")) { + NextTest(); + return; + } err = TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_26(); break; case 27: - ChipLogProgress( - chipTool, " ***** Test Step 27 : Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_27(); + ChipLogProgress(chipTool, " ***** Test Step 27 : Reads optional attributes from DUT: NumberOfWeeklyTransitions\n"); + if (ShouldSkip("TSTAT.S.A0021")) { + NextTest(); + return; + } + err = TestReadsOptionalAttributesFromDutNumberOfWeeklyTransitions_27(); break; case 28: - ChipLogProgress( - chipTool, " ***** Test Step 28 : Reads constraints of optional attributes from DUT: NumberOfDailyTransitions\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_28(); + ChipLogProgress(chipTool, " ***** Test Step 28 : Reads optional attributes from DUT: NumberOfDailyTransitions\n"); + if (ShouldSkip("TSTAT.S.A0022")) { + NextTest(); + return; + } + err = TestReadsOptionalAttributesFromDutNumberOfDailyTransitions_28(); break; case 29: - ChipLogProgress(chipTool, - " ***** Test Step 29 : Read TemperatureSetpointHold attribute from the DUT and Verify that the DUT responds with " - "an enum8 value.The value has to 0 or 1\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 29 : Read TemperatureSetpointHold attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0023")) { NextTest(); return; } - err = TestReadTemperatureSetpointHoldAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasTo0Or1_29(); + err = TestReadTemperatureSetpointHoldAttributeFromTheDut_29(); break; case 30: - ChipLogProgress(chipTool, - " ***** Test Step 30 : Read TemperatureSetpointHoldDuration attribute from the DUT and Verify that the DUT " - "responds with a uint16 value or NULL.The value has to be in the range of 0 to 1440\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 30 : Read TemperatureSetpointHoldDuration attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0024")) { NextTest(); return; } - err = TestReadTemperatureSetpointHoldDurationAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint16ValueOrNULLTheValueHasToBeInTheRangeOf0To1440_30(); + err = TestReadTemperatureSetpointHoldDurationAttributeFromTheDut_30(); break; case 31: - ChipLogProgress(chipTool, - " ***** Test Step 31 : Read ThermostatProgrammingOperationMode attribute from the DUT and Verify that the DUT " - "responds with a map8 value.The value has to be in the range of 0x00 to 0x07\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 31 : Read ThermostatProgrammingOperationMode attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0025")) { NextTest(); return; } - err = TestReadThermostatProgrammingOperationModeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x07_31(); + err = TestReadThermostatProgrammingOperationModeAttributeFromTheDut_31(); break; case 32: - ChipLogProgress(chipTool, - " ***** Test Step 32 : Read ThermostatRunningState attribute from the DUT and Verify that the DUT responds with a " - "map16 value.The value has to be in the range of 0x00 to 0x7F\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 32 : Read ThermostatRunningState attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0029")) { NextTest(); return; } - err = TestReadThermostatRunningStateAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap16ValueTheValueHasToBeInTheRangeOf0x00To0x7F_32(); + err = TestReadThermostatRunningStateAttributeFromTheDut_32(); break; case 33: - ChipLogProgress(chipTool, - " ***** Test Step 33 : Read SetpointChangeSource attribute from the DUT and Verify that the DUT responds with an " - "enum8 value. The value has to be in the range of 0 to 2\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 33 : Read SetpointChangeSource attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0030")) { NextTest(); return; } - err = TestReadSetpointChangeSourceAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf0To2_33(); + err = TestReadSetpointChangeSourceAttributeFromTheDut_33(); break; case 34: - ChipLogProgress(chipTool, - " ***** Test Step 34 : Read SetpointChangeAmount attribute from the DUT and Verify that the DUT responds with an " - "int16 value or NULL\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 34 : Read SetpointChangeAmount attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0031")) { NextTest(); return; } - err = TestReadSetpointChangeAmountAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt16ValueOrNull_34(); + err = TestReadSetpointChangeAmountAttributeFromTheDut_34(); break; case 35: - ChipLogProgress(chipTool, - " ***** Test Step 35 : Read SetpointChangeSourceTimestamp attribute from the DUT and Verify that the DUT responds " - "with a utc value\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 35 : Read SetpointChangeSourceTimestamp attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0032")) { NextTest(); return; } - err = TestReadSetpointChangeSourceTimestampAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUtcValue_35(); + err = TestReadSetpointChangeSourceTimestampAttributeFromTheDut_35(); break; case 36: - ChipLogProgress(chipTool, - " ***** Test Step 36 : Read OccupiedSetback attribute from the DUT and Verify that the DUT responds with a uint8 " - "value or NULL\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 36 : Read OccupiedSetback attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0034")) { NextTest(); return; } - err = TestReadOccupiedSetbackAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_36(); + err = TestReadOccupiedSetbackAttributeFromTheDut_36(); break; case 37: - ChipLogProgress(chipTool, - " ***** Test Step 37 : Read OccupiedSetbackMin attribute from the DUT and Verify that the DUT responds with a " - "uint8 value or NULL\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 37 : Read OccupiedSetbackMin attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0035")) { NextTest(); return; } - err = TestReadOccupiedSetbackMinAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_37(); + err = TestReadOccupiedSetbackMinAttributeFromTheDut_37(); break; case 38: - ChipLogProgress(chipTool, - " ***** Test Step 38 : Read OccupiedSetbackMax attribute from the DUT and Verify that the DUT responds with a " - "uint8 value or NULL\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 38 : Read OccupiedSetbackMax attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0036")) { NextTest(); return; } - err = TestReadOccupiedSetbackMaxAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_38(); + err = TestReadOccupiedSetbackMaxAttributeFromTheDut_38(); break; case 39: - ChipLogProgress(chipTool, - " ***** Test Step 39 : Read UnoccupiedSetback attribute from the DUT and Verify that the DUT responds with a uint8 " - "value or NULL\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 39 : Read UnoccupiedSetback attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0037")) { NextTest(); return; } - err = TestReadUnoccupiedSetbackAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_39(); + err = TestReadUnoccupiedSetbackAttributeFromTheDut_39(); break; case 40: - ChipLogProgress(chipTool, - " ***** Test Step 40 : Read UnoccupiedSetbackMin attribute from the DUT and Verify that the DUT responds with a " - "uint8 value or NULL\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 40 : Read UnoccupiedSetbackMin attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0038")) { NextTest(); return; } - err = TestReadUnoccupiedSetbackMinAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_40(); + err = TestReadUnoccupiedSetbackMinAttributeFromTheDut_40(); break; case 41: - ChipLogProgress(chipTool, - " ***** Test Step 41 : Read UnoccupiedSetbackMax attribute from the DUT and Verify that the DUT responds with a " - "uint8 value or NULL\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 41 : Read UnoccupiedSetbackMax attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0039")) { NextTest(); return; } - err = TestReadUnoccupiedSetbackMaxAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_41(); + err = TestReadUnoccupiedSetbackMaxAttributeFromTheDut_41(); break; case 42: - ChipLogProgress(chipTool, - " ***** Test Step 42 : Read EmergencyHeatDelta attribute from the DUT and Verify that the DUT responds with a " - "uint8 value or NULL\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 42 : Read EmergencyHeatDelta attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A003a")) { NextTest(); return; } - err = TestReadEmergencyHeatDeltaAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_42(); + err = TestReadEmergencyHeatDeltaAttributeFromTheDut_42(); break; case 43: - ChipLogProgress(chipTool, - " ***** Test Step 43 : Read ACType attribute from the DUT and Verify that the DUT responds with an enum8 value. " - "The value has to be in the range of 0 to 4\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 43 : Read ACType attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0040")) { NextTest(); return; } - err = TestReadACTypeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf0To4_43(); + err = TestReadACTypeAttributeFromTheDut_43(); break; case 44: - ChipLogProgress(chipTool, - " ***** Test Step 44 : Read ACCapacity attribute from the DUT and Verify that the DUT responds with a uint16 " - "value\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 44 : Read ACCapacity attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0041")) { NextTest(); return; } - err = TestReadACCapacityAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint16Value_44(); + err = TestReadACCapacityAttributeFromTheDut_44(); break; case 45: - ChipLogProgress(chipTool, - " ***** Test Step 45 : Read ACRefrigerantType attribute from the DUT and VVerify that the DUT responds with an " - "enum8 value.The value has to be in the range of 0 to 3\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 45 : Read ACRefrigerantType attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0042")) { NextTest(); return; } - err = TestReadACRefrigerantTypeAttributeFromTheDutAndVVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf0To3_45(); + err = TestReadACRefrigerantTypeAttributeFromTheDut_45(); break; case 46: - ChipLogProgress(chipTool, - " ***** Test Step 46 : Read ACCompressorType attribute from the DUT and Verify that the DUT responds with an enum8 " - "value.The value has to be in the range of 0 to 3\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 46 : Read ACCompressorType attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0043")) { NextTest(); return; } - err = TestReadACCompressorTypeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf0To3_46(); + err = TestReadACCompressorTypeAttributeFromTheDut_46(); break; case 47: - ChipLogProgress(chipTool, - " ***** Test Step 47 : Read ACErrorCode attribute from the DUT and Verify that the DUT responds with a map32 " - "value\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 47 : Read ACErrorCode attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0044")) { NextTest(); return; } - err = TestReadACErrorCodeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap32Value_47(); + err = TestReadACErrorCodeAttributeFromTheDut_47(); break; case 48: - ChipLogProgress(chipTool, - " ***** Test Step 48 : Read ACLouverPosition attribute from the DUT and Verify that the DUT responds with an enum8 " - "value.The value has to be in the range of 1 to 5\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 48 : Read ACLouverPosition attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0045")) { NextTest(); return; } - err = TestReadACLouverPositionAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf1To5_48(); + err = TestReadACLouverPositionAttributeFromTheDut_48(); break; case 49: - ChipLogProgress(chipTool, - " ***** Test Step 49 : Read ACCoilTemperature attribute from the DUT and Verify that the DUT responds with an " - "int16 value or NULL\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 49 : Read ACCoilTemperature attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0046")) { NextTest(); return; } - err = TestReadACCoilTemperatureAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt16ValueOrNull_49(); + err = TestReadACCoilTemperatureAttributeFromTheDut_49(); break; case 50: - ChipLogProgress(chipTool, - " ***** Test Step 50 : Read ACCapacityFormat attribute from the DUT and Verify that the DUT responds with an enum8 " - "value.The value has to be 0.\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { + ChipLogProgress(chipTool, " ***** Test Step 50 : Read ACCapacityFormat attribute from the DUT\n"); + if (ShouldSkip("TSTAT.S.A0047")) { NextTest(); return; } - err = TestReadACCapacityFormatAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBe0_50(); + err = TestReadACCapacityFormatAttributeFromTheDut_50(); break; } @@ -45827,7 +44879,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutLocalTemperature_1() + CHIP_ERROR TestReadsMandatoryAttributesFromDutLocalTemperature_1() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45836,14 +44888,61 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeLocalTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: LocalTemperature Error: %@", err); + NSLog(@"Reads mandatory attributes from DUT: LocalTemperature Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("localTemperature", "", "int16")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadOutdoorTemperatureAttributeFromTheDut_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOutdoorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read OutdoorTemperature attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("outdoorTemperature", "", "int16")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadOccupancyAttributeFromTheDut_3() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOccupancyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read Occupancy attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("localTemperature", "", "int16")); - } + VerifyOrReturn(CheckConstraintType("occupancy", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("occupancy", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("occupancy", [value unsignedCharValue], 1U)); NextTest(); }]; @@ -45851,7 +44950,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMinHeatSetpointLimit_2() + CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMinHeatSetpointLimit_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45860,7 +44959,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAbsMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: AbsMinHeatSetpointLimit Error: %@", err); + NSLog(@"Reads mandatory attributes from DUT: AbsMinHeatSetpointLimit Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -45874,7 +44973,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_3() + CHIP_ERROR TestReadsMandatoryAttributesFromDutAbsMaxHeatSetpointLimit_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45883,7 +44982,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAbsMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: AbsMaxHeatSetpointLimit Error: %@", err); + NSLog(@"Reads mandatory attributes from DUT: AbsMaxHeatSetpointLimit Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -45897,7 +44996,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutAbsMinCoolSetpointLimit_4() + CHIP_ERROR TestReadsOptionalAttributesFromDutAbsMinCoolSetpointLimit_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45906,12 +45005,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAbsMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: AbsMinCoolSetpointLimit Error: %@", err); - - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + NSLog(@"Reads optional attributes from DUT: AbsMinCoolSetpointLimit Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -45925,7 +45019,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutAbsMaxCoolSetpointLimit_5() + CHIP_ERROR TestReadsOptionalAttributesFromDutAbsMaxCoolSetpointLimit_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45934,12 +45028,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAbsMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: AbsMaxCoolSetpointLimit Error: %@", err); - - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + NSLog(@"Reads optional attributes from DUT: AbsMaxCoolSetpointLimit Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -45953,27 +45042,53 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - TestReadPICoolingDemandAttributeFromTheDutVerifyThatTheDutRespondsWithAUint8ValueTheValueHasToBeInTheRangeOf0To100_6() + CHIP_ERROR TestReadPICoolingDemandAttributeFromTheDut_8() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePICoolingDemandWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read PICoolingDemand attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("PICoolingDemand", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("PICoolingDemand", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("PICoolingDemand", [value unsignedCharValue], 100U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR - TestReadPIHeatingDemandAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueTheValueHasToBeInTheRangeOf0To100_7() + CHIP_ERROR TestReadPIHeatingDemandAttributeFromTheDut_9() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePIHeatingDemandWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read PIHeatingDemand attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("PIHeatingDemand", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("PIHeatingDemand", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("PIHeatingDemand", [value unsignedCharValue], 100U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutOccupiedCoolingSetpoint_8() + CHIP_ERROR TestReadHVACSystemTypeConfigurationAttributeFromTheDut_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -45981,13 +45096,56 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: OccupiedCoolingSetpoint Error: %@", err); + [cluster + readAttributeHVACSystemTypeConfigurationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read HVACSystemTypeConfiguration attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("HVACSystemTypeConfiguration", "", "map8")); + VerifyOrReturn(CheckConstraintMinValue("HVACSystemTypeConfiguration", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("HVACSystemTypeConfiguration", [value unsignedCharValue], 63U)); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { NextTest(); - return; - } + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadLocalTemperatureCalibrationAttributeFromTheDut_11() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeLocalTemperatureCalibrationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read LocalTemperatureCalibration attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("localTemperatureCalibration", "", "int8")); + VerifyOrReturn(CheckConstraintMinValue("localTemperatureCalibration", [value charValue], 25)); + VerifyOrReturn(CheckConstraintMaxValue("localTemperatureCalibration", [value charValue], -25)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsOptionalAttributesFromDutOccupiedCoolingSetpoint_12() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads optional attributes from DUT: OccupiedCoolingSetpoint Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -46001,7 +45159,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_9() + CHIP_ERROR TestReadsMandatoryAttributesFromDutOccupiedHeatingSetpoint_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46010,7 +45168,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint Error: %@", err); + NSLog(@"Reads mandatory attributes from DUT: OccupiedHeatingSetpoint Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -46024,25 +45182,49 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadUnoccupiedCoolingSetpointAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt16Value_10() + CHIP_ERROR TestReadUnoccupiedCoolingSetpointAttributeFromTheDut_14() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeUnoccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read UnoccupiedCoolingSetpoint attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("unoccupiedCoolingSetpoint", "", "int16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadUnoccupiedHeatingSetpointAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt16Value_11() + CHIP_ERROR TestReadUnoccupiedHeatingSetpointAttributeFromTheDut_15() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeUnoccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read UnoccupiedHeatingSetpoint attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("unoccupiedHeatingSetpoint", "", "int16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_12() + CHIP_ERROR TestReadsMandatoryAttributesFromDutMinHeatSetpointLimit_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46051,21 +45233,18 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit Error: %@", err); + NSLog(@"Reads mandatory attributes from DUT: MinHeatSetpointLimit Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("minHeatSetpointLimit", "", "int16")); - VerifyOrReturn(CheckConstraintMinValue("minHeatSetpointLimit", [value shortValue], 700)); - VerifyOrReturn(CheckConstraintMaxValue("minHeatSetpointLimit", [value shortValue], 3000)); - NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_13() + CHIP_ERROR TestReadsMandatoryAttributesFromDutMaxHeatSetpointLimit_17() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46074,7 +45253,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit Error: %@", err); + NSLog(@"Reads mandatory attributes from DUT: MaxHeatSetpointLimit Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -46088,7 +45267,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMinCoolSetpointLimit_14() + CHIP_ERROR TestReadsOptionalAttributesFromDutMinCoolSetpointLimit_18() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46097,12 +45276,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: MinCoolSetpointLimit Error: %@", err); - - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + NSLog(@"Reads optional attributes from DUT: MinCoolSetpointLimit Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -46116,7 +45290,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMaxCoolSetpointLimit_15() + CHIP_ERROR TestReadsOptionalAttributesFromDutMaxCoolSetpointLimit_19() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46125,12 +45299,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: MaxCoolSetpointLimit Error: %@", err); - - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + NSLog(@"Reads optional attributes from DUT: MaxCoolSetpointLimit Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -46144,7 +45313,53 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_16() + CHIP_ERROR TestReadsOptionalAttributesFromDutMinSetpointDeadBand_20() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinSetpointDeadBandWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads optional attributes from DUT: MinSetpointDeadBand Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("minSetpointDeadBand", "", "int8")); + VerifyOrReturn(CheckConstraintMinValue("minSetpointDeadBand", [value charValue], 0)); + VerifyOrReturn(CheckConstraintMaxValue("minSetpointDeadBand", [value charValue], 25)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadRemoteSensingAttributeFromTheDut_21() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeRemoteSensingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read RemoteSensing attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("remoteSensing", "", "map8")); + VerifyOrReturn(CheckConstraintMinValue("remoteSensing", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("remoteSensing", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsMandatoryAttributesFromDutControlSequenceOfOperation_22() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46154,7 +45369,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { [cluster readAttributeControlSequenceOfOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation Error: %@", err); + NSLog(@"Reads mandatory attributes from DUT: ControlSequenceOfOperation Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -46168,7 +45383,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_17() + CHIP_ERROR TestReadsMandatoryAttributesFromDutSystemMode_23() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46177,7 +45392,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeSystemModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of mandatory attributes from DUT: SystemMode Error: %@", err); + NSLog(@"Reads mandatory attributes from DUT: SystemMode Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -46191,7 +45406,8 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadOutdoorTemperatureAttributeFromTheDutAndVerifyTheDatatype_18() + CHIP_ERROR + TestReadAlarmMaskAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x07_24() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); @@ -46200,36 +45416,405 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return UserPrompt("alpha", value); } - CHIP_ERROR TestReadOccupancyAttributeFromTheDutAndVerifyTheDatatypeAndResponseValue_19() + CHIP_ERROR TestReadThermostatRunningModeAttributeFromTheDut_25() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeThermostatRunningModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ThermostatRunningMode attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("thermostatRunningMode", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("thermostatRunningMode", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("thermostatRunningMode", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR - TestReadHVACSystemTypeConfigurationAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x3f_20() + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_26() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStartOfWeekWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads constraints of optional attributes from DUT: StartOfWeek Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("startOfWeek", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("startOfWeek", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("startOfWeek", [value unsignedCharValue], 6U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsOptionalAttributesFromDutNumberOfWeeklyTransitions_27() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeNumberOfWeeklyTransitionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads optional attributes from DUT: NumberOfWeeklyTransitions Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("numberOfWeeklyTransitions", "", "uint8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsOptionalAttributesFromDutNumberOfDailyTransitions_28() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNumberOfDailyTransitionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads optional attributes from DUT: NumberOfDailyTransitions Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("numberOfDailyTransitions", "", "uint8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTemperatureSetpointHoldAttributeFromTheDut_29() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTemperatureSetpointHoldWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read TemperatureSetpointHold attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("temperatureSetpointHold", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("temperatureSetpointHold", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("temperatureSetpointHold", [value unsignedCharValue], 1U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTemperatureSetpointHoldDurationAttributeFromTheDut_30() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTemperatureSetpointHoldDurationWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read TemperatureSetpointHoldDuration attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("temperatureSetpointHoldDuration", "", "uint16")); + VerifyOrReturn( + CheckConstraintMinValue("temperatureSetpointHoldDuration", [value unsignedShortValue], 0U)); + VerifyOrReturn( + CheckConstraintMaxValue("temperatureSetpointHoldDuration", [value unsignedShortValue], 1440U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadThermostatProgrammingOperationModeAttributeFromTheDut_31() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeThermostatProgrammingOperationModeWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ThermostatProgrammingOperationMode attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("thermostatProgrammingOperationMode", "", "map8")); + VerifyOrReturn(CheckConstraintMinValue("thermostatProgrammingOperationMode", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("thermostatProgrammingOperationMode", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadThermostatRunningStateAttributeFromTheDut_32() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeThermostatRunningStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ThermostatRunningState attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("thermostatRunningState", "", "map16")); + VerifyOrReturn(CheckConstraintMinValue("thermostatRunningState", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("thermostatRunningState", [value unsignedShortValue], 127U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadSetpointChangeSourceAttributeFromTheDut_33() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSetpointChangeSourceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read SetpointChangeSource attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("setpointChangeSource", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("setpointChangeSource", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("setpointChangeSource", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadSetpointChangeAmountAttributeFromTheDut_34() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSetpointChangeAmountWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read SetpointChangeAmount attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("setpointChangeAmount", "", "int16")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadSetpointChangeSourceTimestampAttributeFromTheDut_35() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeSetpointChangeSourceTimestampWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read SetpointChangeSourceTimestamp attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("setpointChangeSourceTimestamp", "", "utc")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadOccupiedSetbackAttributeFromTheDut_36() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOccupiedSetbackWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read OccupiedSetback attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("occupiedSetback", "", "uint8")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadOccupiedSetbackMinAttributeFromTheDut_37() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOccupiedSetbackMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read OccupiedSetbackMin attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("occupiedSetbackMin", "", "uint8")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadOccupiedSetbackMaxAttributeFromTheDut_38() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOccupiedSetbackMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read OccupiedSetbackMax attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("occupiedSetbackMax", "", "uint8")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadUnoccupiedSetbackAttributeFromTheDut_39() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeUnoccupiedSetbackWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read UnoccupiedSetback attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("unoccupiedSetback", "", "uint8")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadUnoccupiedSetbackMinAttributeFromTheDut_40() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeUnoccupiedSetbackMinWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read UnoccupiedSetbackMin attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("unoccupiedSetbackMin", "", "uint8")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR - TestReadLocalTemperatureCalibrationAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt8ValueTheValueHasToBeInTheRangeOf25To25_21() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + CHIP_ERROR TestReadUnoccupiedSetbackMaxAttributeFromTheDut_41() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeUnoccupiedSetbackMaxWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read UnoccupiedSetbackMax attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("unoccupiedSetbackMax", "", "uint8")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_22() + CHIP_ERROR TestReadEmergencyHeatDeltaAttributeFromTheDut_42() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46237,56 +45822,42 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinSetpointDeadBandWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: MinSetpointDeadBand Error: %@", err); - - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeEmergencyHeatDeltaWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read EmergencyHeatDelta attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("minSetpointDeadBand", "", "int8")); - VerifyOrReturn(CheckConstraintMinValue("minSetpointDeadBand", [value charValue], 0)); - VerifyOrReturn(CheckConstraintMaxValue("minSetpointDeadBand", [value charValue], 25)); - + VerifyOrReturn(CheckConstraintType("emergencyHeatDelta", "", "uint8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR - TestReadRemoteSensingAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x07_23() + CHIP_ERROR TestReadACTypeAttributeFromTheDut_43() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIP_ERROR - TestReadAlarmMaskAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x07_24() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + [cluster readAttributeACTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ACType attribute from the DUT Error: %@", err); - CHIP_ERROR TestReadThermostatRunningModeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBe03Or4_25() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("ACType", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("ACType", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("ACType", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_26() + CHIP_ERROR TestReadACCapacityAttributeFromTheDut_44() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46294,27 +45865,19 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStartOfWeekWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: StartOfWeek Error: %@", err); - - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeACCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ACCapacity attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("startOfWeek", "", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("startOfWeek", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("startOfWeek", [value unsignedCharValue], 6U)); - + VerifyOrReturn(CheckConstraintType("ACCapacity", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_27() + CHIP_ERROR TestReadACRefrigerantTypeAttributeFromTheDut_45() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46322,25 +45885,22 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNumberOfWeeklyTransitionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions Error: %@", err); + [cluster readAttributeACRefrigerantTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ACRefrigerantType attribute from the DUT Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("ACRefrigerantType", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("ACRefrigerantType", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("ACRefrigerantType", [value unsignedCharValue], 3U)); - VerifyOrReturn(CheckConstraintType("numberOfWeeklyTransitions", "", "uint8")); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_28() + CHIP_ERROR TestReadACCompressorTypeAttributeFromTheDut_46() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -46348,226 +45908,111 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeNumberOfDailyTransitionsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads constraints of optional attributes from DUT: NumberOfDailyTransitions Error: %@", err); - - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeACCompressorTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ACCompressorType attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("numberOfDailyTransitions", "", "uint8")); + VerifyOrReturn(CheckConstraintType("ACCompressorType", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("ACCompressorType", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("ACCompressorType", [value unsignedCharValue], 3U)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTemperatureSetpointHoldAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasTo0Or1_29() + CHIP_ERROR TestReadACErrorCodeAttributeFromTheDut_47() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIP_ERROR - TestReadTemperatureSetpointHoldDurationAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint16ValueOrNULLTheValueHasToBeInTheRangeOf0To1440_30() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + [cluster readAttributeACErrorCodeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ACErrorCode attribute from the DUT Error: %@", err); - CHIP_ERROR - TestReadThermostatProgrammingOperationModeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x07_31() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - CHIP_ERROR - TestReadThermostatRunningStateAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap16ValueTheValueHasToBeInTheRangeOf0x00To0x7F_32() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + VerifyOrReturn(CheckConstraintType("ACErrorCode", "", "map32")); + NextTest(); + }]; - CHIP_ERROR - TestReadSetpointChangeSourceAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf0To2_33() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadSetpointChangeAmountAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt16ValueOrNull_34() + CHIP_ERROR TestReadACLouverPositionAttributeFromTheDut_48() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIP_ERROR TestReadSetpointChangeSourceTimestampAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUtcValue_35() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + [cluster readAttributeACLouverPositionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ACLouverPosition attribute from the DUT Error: %@", err); - CHIP_ERROR TestReadOccupiedSetbackAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_36() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - CHIP_ERROR TestReadOccupiedSetbackMinAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_37() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + VerifyOrReturn(CheckConstraintType("ACLouverPosition", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("ACLouverPosition", [value unsignedCharValue], 1U)); + VerifyOrReturn(CheckConstraintMaxValue("ACLouverPosition", [value unsignedCharValue], 5U)); - CHIP_ERROR TestReadOccupiedSetbackMaxAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_38() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + NextTest(); + }]; - CHIP_ERROR TestReadUnoccupiedSetbackAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_39() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadUnoccupiedSetbackMinAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_40() + CHIP_ERROR TestReadACCoilTemperatureAttributeFromTheDut_49() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIP_ERROR TestReadUnoccupiedSetbackMaxAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_41() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + [cluster readAttributeACCoilTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ACCoilTemperature attribute from the DUT Error: %@", err); - CHIP_ERROR TestReadEmergencyHeatDeltaAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_42() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - CHIP_ERROR TestReadACTypeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf0To4_43() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + if (value != nil) { - CHIP_ERROR TestReadACCapacityAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint16Value_44() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + VerifyOrReturn(CheckConstraintType("ACCoilTemperature", "", "int16")); + } - CHIP_ERROR - TestReadACRefrigerantTypeAttributeFromTheDutAndVVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf0To3_45() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + NextTest(); + }]; - CHIP_ERROR - TestReadACCompressorTypeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf0To3_46() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadACErrorCodeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap32Value_47() + CHIP_ERROR TestReadACCapacityFormatAttributeFromTheDut_50() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIP_ERROR - TestReadACLouverPositionAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf1To5_48() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + [cluster readAttributeACCapacityformatWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read ACCapacityFormat attribute from the DUT Error: %@", err); - CHIP_ERROR TestReadACCoilTemperatureAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt16ValueOrNull_49() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - CHIP_ERROR TestReadACCapacityFormatAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBe0_50() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ACCapacityformat", actualValue, 0U)); + } + + VerifyOrReturn(CheckConstraintType("ACCapacityformat", "", "enum8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } }; @@ -46617,7 +46062,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 1 : Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is " "within range\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } @@ -46626,7 +46071,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Writes a value back that is different but valid for OccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } @@ -46635,7 +46080,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } @@ -46643,17 +46088,17 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { break; case 4: ChipLogProgress( - chipTool, " ***** Test Step 4 : Writes OccupiedCoolingSetpoint to value below the MinCoolSetpointLimit\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + chipTool, " ***** Test Step 4 : Writes OccupiedCoolingSetpoint to value below the ABSMinCoolSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } - err = TestWritesOccupiedCoolingSetpointToValueBelowTheMinCoolSetpointLimit_4(); + err = TestWritesOccupiedCoolingSetpointToValueBelowTheABSMinCoolSetpointLimit_4(); break; case 5: ChipLogProgress( chipTool, " ***** Test Step 5 : Writes OccupiedCoolingSetpoint to value above the MaxCoolSetpointLimit\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } @@ -46661,642 +46106,853 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { break; case 6: ChipLogProgress( - chipTool, " ***** Test Step 6 : Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + chipTool, " ***** Test Step 6 : Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && !TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesTheLimitOfMaxCoolSetpointLimitToOccupiedCoolingSetpointAttribute_6(); + err = TestWritesTheLimitOfMinCoolSetpointLimitToOccupiedCoolingSetpointAttribute_6(); break; case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is " - "within range\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { + ChipLogProgress( + chipTool, " ***** Test Step 7 : Writes the CoolingSetpoint below the HeatingSetpoint when auto is enabled\n"); + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } - err = TestReadsOccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_7(); + err = TestWritesTheCoolingSetpointBelowTheHeatingSetpointWhenAutoIsEnabled_7(); break; case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : Writes a value back that is different but valid for OccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { + ChipLogProgress( + chipTool, " ***** Test Step 8 : Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint attribute\n"); + if (ShouldSkip("TSTAT.S.F01")) { NextTest(); return; } - err = TestWritesAValueBackThatIsDifferentButValidForOccupiedHeatingSetpointAttribute_8(); + err = TestWritesTheLimitOfMaxCoolSetpointLimitToOccupiedCoolingSetpointAttribute_8(); break; case 9: ChipLogProgress(chipTool, - " ***** Test Step 9 : Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { + " ***** Test Step 9 : Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is " + "within range\n"); + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_9(); + err = TestReadsOccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_9(); break; case 10: - ChipLogProgress( - chipTool, " ***** Test Step 10 : Writes OccupiedHeatingSetpoint to value below the MinHeatSetpointLimit\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { + ChipLogProgress(chipTool, + " ***** Test Step 10 : Writes a value back that is different but valid for OccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } - err = TestWritesOccupiedHeatingSetpointToValueBelowTheMinHeatSetpointLimit_10(); + err = TestWritesAValueBackThatIsDifferentButValidForOccupiedHeatingSetpointAttribute_10(); break; case 11: - ChipLogProgress( - chipTool, " ***** Test Step 11 : Writes OccupiedHeatingSetpoint to value above the MaxHeatSetpointLimit\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { + ChipLogProgress(chipTool, + " ***** Test Step 11 : Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } - err = TestWritesOccupiedHeatingSetpointToValueAboveTheMaxHeatSetpointLimit_11(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_11(); break; case 12: ChipLogProgress( - chipTool, " ***** Test Step 12 : Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("A_OCCUPIEDHEATINGSETPOINT")) { + chipTool, " ***** Test Step 12 : Writes OccupiedHeatingSetpoint to value below the MinHeatSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } - err = TestWritesTheLimitOfMinHeatSetpointLimitToOccupiedHeatingSetpointAttribute_12(); + err = TestWritesOccupiedHeatingSetpointToValueBelowTheMinHeatSetpointLimit_12(); break; case 13: - ChipLogProgress(chipTool, - " ***** Test Step 13 : Reads UnoccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is " - "within range\n"); - if (ShouldSkip("A_UNOCCUPIEDCOOLINGSETPOINT")) { + ChipLogProgress( + chipTool, " ***** Test Step 13 : Writes OccupiedHeatingSetpoint to value above the MaxHeatSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } - err = TestReadsUnoccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_13(); + err = TestWritesOccupiedHeatingSetpointToValueAboveTheMaxHeatSetpointLimit_13(); break; case 14: - ChipLogProgress(chipTool, - " ***** Test Step 14 : Writes a value back that is different but valid for UnoccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("A_UNOCCUPIEDCOOLINGSETPOINT")) { + ChipLogProgress( + chipTool, " ***** Test Step 14 : Writes the limit of MinHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } - err = TestWritesAValueBackThatIsDifferentButValidForUnoccupiedCoolingSetpointAttribute_14(); + err = TestWritesTheLimitOfMinHeatSetpointLimitToOccupiedHeatingSetpointAttribute_14(); break; case 15: ChipLogProgress(chipTool, - " ***** Test Step 15 : Reads it back again to confirm the successful write of UnoccupiedCoolingSetpoint " - "attribute\n"); - if (ShouldSkip("A_UNOCCUPIEDCOOLINGSETPOINT")) { + " ***** Test Step 15 : Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfUnoccupiedCoolingSetpointAttribute_15(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_15(); break; case 16: ChipLogProgress( - chipTool, " ***** Test Step 16 : Writes UnoccupiedCoolingSetpoint to value below the MinHeatSetpointLimit\n"); - if (ShouldSkip("A_UNOCCUPIEDCOOLINGSETPOINT")) { + chipTool, " ***** Test Step 16 : Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && !TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesUnoccupiedCoolingSetpointToValueBelowTheMinHeatSetpointLimit_16(); + err = TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_16(); break; case 17: ChipLogProgress( - chipTool, " ***** Test Step 17 : Writes UnoccupiedCoolingSetpoint to value above the MaxHeatSetpointLimit\n"); - if (ShouldSkip("A_UNOCCUPIEDCOOLINGSETPOINT")) { + chipTool, " ***** Test Step 17 : Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesUnoccupiedCoolingSetpointToValueAboveTheMaxHeatSetpointLimit_17(); + err = TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_17(); break; case 18: ChipLogProgress(chipTool, - " ***** Test Step 18 : Writes the limit of MinCoolSetpointLimit to UnoccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("A_UNOCCUPIEDCOOLINGSETPOINT")) { + " ***** Test Step 18 : Reads UnoccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is " + "within range\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01")) { NextTest(); return; } - err = TestWritesTheLimitOfMinCoolSetpointLimitToUnoccupiedCoolingSetpointAttribute_18(); + err = TestReadsUnoccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_18(); break; case 19: ChipLogProgress(chipTool, - " ***** Test Step 19 : Writes the limit of MaxCoolSetpointLimit to UnoccupiedCoolingSetpoint attribute\n"); - if (ShouldSkip("A_UNOCCUPIEDCOOLINGSETPOINT")) { + " ***** Test Step 19 : Writes a value back that is different but valid for UnoccupiedCoolingSetpoint attribute\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01")) { NextTest(); return; } - err = TestWritesTheLimitOfMaxCoolSetpointLimitToUnoccupiedCoolingSetpointAttribute_19(); + err = TestWritesAValueBackThatIsDifferentButValidForUnoccupiedCoolingSetpointAttribute_19(); break; case 20: ChipLogProgress(chipTool, - " ***** Test Step 20 : Reads UnoccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is " - "within range\n"); - if (ShouldSkip("A_UNOCCUPIEDHEATINGSETPOINT")) { + " ***** Test Step 20 : Reads it back again to confirm the successful write of UnoccupiedCoolingSetpoint " + "attribute\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01")) { NextTest(); return; } - err = TestReadsUnoccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_20(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfUnoccupiedCoolingSetpointAttribute_20(); break; case 21: - ChipLogProgress(chipTool, - " ***** Test Step 21 : Writes a value back that is different but valid for UnoccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("A_UNOCCUPIEDHEATINGSETPOINT")) { + ChipLogProgress( + chipTool, " ***** Test Step 21 : Writes UnoccupiedCoolingSetpoint to value below the MinCoolSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01")) { NextTest(); return; } - err = TestWritesAValueBackThatIsDifferentButValidForUnoccupiedHeatingSetpointAttribute_21(); + err = TestWritesUnoccupiedCoolingSetpointToValueBelowTheMinCoolSetpointLimit_21(); break; case 22: - ChipLogProgress(chipTool, - " ***** Test Step 22 : Reads it back again to confirm the successful write of UnoccupiedHeatingSetpoint " - "attribute\n"); - if (ShouldSkip("A_UNOCCUPIEDHEATINGSETPOINT")) { + ChipLogProgress( + chipTool, " ***** Test Step 22 : Writes UnoccupiedCoolingSetpoint to value above the MaxCoolSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01")) { NextTest(); return; } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfUnoccupiedHeatingSetpointAttribute_22(); + err = TestWritesUnoccupiedCoolingSetpointToValueAboveTheMaxCoolSetpointLimit_22(); break; case 23: - ChipLogProgress( - chipTool, " ***** Test Step 23 : Writes UnoccupiedHeatingSetpoint to value below the MinHeatSetpointLimit\n"); - if (ShouldSkip("A_UNOCCUPIEDHEATINGSETPOINT")) { + ChipLogProgress(chipTool, + " ***** Test Step 23 : Writes the limit of MinCoolSetpointLimit to UnoccupiedCoolingSetpoint attribute\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01")) { NextTest(); return; } - err = TestWritesUnoccupiedHeatingSetpointToValueBelowTheMinHeatSetpointLimit_23(); + err = TestWritesTheLimitOfMinCoolSetpointLimitToUnoccupiedCoolingSetpointAttribute_23(); break; case 24: - ChipLogProgress( - chipTool, " ***** Test Step 24 : Writes UnoccupiedHeatingSetpoint to value above the MaxHeatSetpointLimit\n"); - if (ShouldSkip("A_UNOCCUPIEDHEATINGSETPOINT")) { + ChipLogProgress(chipTool, + " ***** Test Step 24 : Writes the limit of MaxCoolSetpointLimit to UnoccupiedCoolingSetpoint attribute\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F01")) { NextTest(); return; } - err = TestWritesUnoccupiedHeatingSetpointToValueAboveTheMaxHeatSetpointLimit_24(); + err = TestWritesTheLimitOfMaxCoolSetpointLimitToUnoccupiedCoolingSetpointAttribute_24(); break; case 25: ChipLogProgress(chipTool, - " ***** Test Step 25 : Writes the limit of MinHeatSetpointLimit to UnoccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("A_UNOCCUPIEDHEATINGSETPOINT")) { + " ***** Test Step 25 : Reads UnoccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is " + "within range\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00")) { NextTest(); return; } - err = TestWritesTheLimitOfMinHeatSetpointLimitToUnoccupiedHeatingSetpointAttribute_25(); + err = TestReadsUnoccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_25(); break; case 26: ChipLogProgress(chipTool, - " ***** Test Step 26 : Writes the limit of MaxHeatSetpointLimit to UnoccupiedHeatingSetpoint attribute\n"); - if (ShouldSkip("A_UNOCCUPIEDHEATINGSETPOINT")) { + " ***** Test Step 26 : Writes a value back that is different but valid for UnoccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00")) { NextTest(); return; } - err = TestWritesTheLimitOfMaxHeatSetpointLimitToUnoccupiedHeatingSetpointAttribute_26(); + err = TestWritesAValueBackThatIsDifferentButValidForUnoccupiedHeatingSetpointAttribute_26(); break; case 27: ChipLogProgress(chipTool, - " ***** Test Step 27 : Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within " - "range\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { + " ***** Test Step 27 : Reads it back again to confirm the successful write of UnoccupiedHeatingSetpoint " + "attribute\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00")) { NextTest(); return; } - err = TestReadsMinHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_27(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfUnoccupiedHeatingSetpointAttribute_27(); break; case 28: ChipLogProgress( - chipTool, " ***** Test Step 28 : Writes MinHeatSetpointLimit to value below the AbsMinHeatSetpointLimit \n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { + chipTool, " ***** Test Step 28 : Writes UnoccupiedHeatingSetpoint to value below the MinHeatSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00")) { NextTest(); return; } - err = TestWritesMinHeatSetpointLimitToValueBelowTheAbsMinHeatSetpointLimit_28(); + err = TestWritesUnoccupiedHeatingSetpointToValueBelowTheMinHeatSetpointLimit_28(); break; case 29: ChipLogProgress( - chipTool, " ***** Test Step 29 : Writes MinHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit \n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { + chipTool, " ***** Test Step 29 : Writes UnoccupiedHeatingSetpoint to value above the MaxHeatSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00")) { NextTest(); return; } - err = TestWritesMinHeatSetpointLimitToValueAboveTheAbsMaxHeatSetpointLimit_29(); + err = TestWritesUnoccupiedHeatingSetpointToValueAboveTheMaxHeatSetpointLimit_29(); break; case 30: - ChipLogProgress( - chipTool, " ***** Test Step 30 : Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { + ChipLogProgress(chipTool, + " ***** Test Step 30 : Writes the limit of MinHeatSetpointLimit to UnoccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00")) { NextTest(); return; } - err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_30(); + err = TestWritesTheLimitOfMinHeatSetpointLimitToUnoccupiedHeatingSetpointAttribute_30(); break; case 31: ChipLogProgress(chipTool, - " ***** Test Step 31 : Writes a value back that is different but valid for MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) { + " ***** Test Step 31 : Writes the limit of MaxHeatSetpointLimit to UnoccupiedHeatingSetpoint attribute\n"); + if (ShouldSkip("TSTAT.S.F02 && TSTAT.S.F00")) { NextTest(); return; } - err = TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_31(); + err = TestWritesTheLimitOfMaxHeatSetpointLimitToUnoccupiedHeatingSetpointAttribute_31(); break; case 32: ChipLogProgress(chipTool, - " ***** Test Step 32 : Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) { + " ***** Test Step 32 : Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within " + "range\n"); + if (ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT")) { NextTest(); return; } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_32(); + err = TestReadsMinHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_32(); break; case 33: - ChipLogProgress( - chipTool, " ***** Test Step 33 : Writes MaxHeatSetpointLimit to value below the AbsMinHeatSetpointLimit \n"); - if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) { + ChipLogProgress(chipTool, + " ***** Test Step 33 : Writes a value back that is different but valid for MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesMaxHeatSetpointLimitToValueBelowTheAbsMinHeatSetpointLimit_33(); + err = TestWritesAValueBackThatIsDifferentButValidForMinHeatSetpointLimitAttribute_33(); break; case 34: - ChipLogProgress( - chipTool, " ***** Test Step 34 : Writes MaxHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit \n"); - if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) { + ChipLogProgress(chipTool, + " ***** Test Step 34 : Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesMaxHeatSetpointLimitToValueAboveTheAbsMaxHeatSetpointLimit_34(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinHeatSetpointLimitAttribute_34(); break; case 35: - ChipLogProgress( - chipTool, " ***** Test Step 35 : Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXHEATSETPOINTLIMIT")) { + ChipLogProgress(chipTool, " ***** Test Step 35 : Writes a value back that is different but violates the deadband\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT && TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_35(); + err = TestWritesAValueBackThatIsDifferentButViolatesTheDeadband_35(); break; case 36: - ChipLogProgress(chipTool, - " ***** Test Step 36 : Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within " - "range\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { + ChipLogProgress( + chipTool, " ***** Test Step 36 : Writes MinHeatSetpointLimit to value below the AbsMinHeatSetpointLimit \n"); + if (ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT")) { NextTest(); return; } - err = TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_36(); + err = TestWritesMinHeatSetpointLimitToValueBelowTheAbsMinHeatSetpointLimit_36(); break; case 37: - ChipLogProgress(chipTool, - " ***** Test Step 37 : Writes a value back that is different but valid for MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { + ChipLogProgress( + chipTool, " ***** Test Step 37 : Writes MinHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit \n"); + if (ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_37(); + err = TestWritesMinHeatSetpointLimitToValueAboveTheAbsMaxHeatSetpointLimit_37(); break; case 38: - ChipLogProgress(chipTool, - " ***** Test Step 38 : Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { + ChipLogProgress( + chipTool, " ***** Test Step 38 : Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT")) { NextTest(); return; } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_38(); + err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_38(); break; case 39: ChipLogProgress( - chipTool, " ***** Test Step 39 : Writes MinCoolSetpointLimit to value below the AbsMinCoolSetpointLimit \n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { + chipTool, " ***** Test Step 39 : Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT && !TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesMinCoolSetpointLimitToValueBelowTheAbsMinCoolSetpointLimit_39(); + err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_39(); break; case 40: - ChipLogProgress( - chipTool, " ***** Test Step 40 : Writes MinCoolSetpointLimit to value above the MaxCoolSetpointLimit \n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { + ChipLogProgress(chipTool, + " ***** Test Step 40 : Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within " + "range\n"); + if (ShouldSkip("TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT && !TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesMinCoolSetpointLimitToValueAboveTheMaxCoolSetpointLimit_40(); + err = TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_40(); break; case 41: ChipLogProgress( - chipTool, " ***** Test Step 41 : Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { + chipTool, " ***** Test Step 41 : Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_41(); + err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_41(); break; case 42: ChipLogProgress( - chipTool, " ***** Test Step 42 : Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { + chipTool, " ***** Test Step 42 : Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit attribute\n"); + if (ShouldSkip("A_MINHEATSETPOINTLIMIT && TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_42(); + err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_42(); break; case 43: ChipLogProgress(chipTool, - " ***** Test Step 43 : Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within " - "range\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { + " ***** Test Step 43 : Writes a value back that is different but valid for MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT && !TSTAT.S.F05")) { NextTest(); return; } - err = TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_43(); + err = TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_43(); break; case 44: - ChipLogProgress( - chipTool, " ***** Test Step 44 : Writes MaxCoolSetpointLimit to value below the AbsMinCoolSetpointLimit \n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { + ChipLogProgress(chipTool, + " ***** Test Step 44 : Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT && !TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesMaxCoolSetpointLimitToValueBelowTheAbsMinCoolSetpointLimit_44(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_44(); break; case 45: ChipLogProgress( - chipTool, " ***** Test Step 45 : Writes MaxCoolSetpointLimit to value above the MaxCoolSetpointLimit \n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { + chipTool, " ***** Test Step 45 : Writes MaxHeatSetpointLimit to value below the AbsMinHeatSetpointLimit \n"); + if (ShouldSkip("TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesMaxCoolSetpointLimitToValueAboveTheMaxCoolSetpointLimit_45(); + err = TestWritesMaxHeatSetpointLimitToValueBelowTheAbsMinHeatSetpointLimit_45(); break; case 46: ChipLogProgress( - chipTool, " ***** Test Step 46 : Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { + chipTool, " ***** Test Step 46 : Writes MaxHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit \n"); + if (ShouldSkip("TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_46(); + err = TestWritesMaxHeatSetpointLimitToValueAboveTheAbsMaxHeatSetpointLimit_46(); break; case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : Writes (sets back) default value of MinHeatSetpointLimit\n"); - if (ShouldSkip("A_MINHEATSETPOINTLIMIT")) { + ChipLogProgress( + chipTool, " ***** Test Step 47 : Writes the limit of AbsMinHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesSetsBackDefaultValueOfMinHeatSetpointLimit_47(); + err = TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_47(); break; case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Writes (sets back) default value of MinCoolSetpointLimit\n"); - if (ShouldSkip("A_MINCOOLSETPOINTLIMIT")) { + ChipLogProgress( + chipTool, " ***** Test Step 48 : Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F00 && A_MAXHEATSETPOINTLIMIT && !TSTAT.S.F05")) { NextTest(); return; } - err = TestWritesSetsBackDefaultValueOfMinCoolSetpointLimit_48(); + err = TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_48(); break; case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Writes (sets back) default value of MaxCoolSetpointLimit\n"); - if (ShouldSkip("A_MAXCOOLSETPOINTLIMIT")) { + ChipLogProgress(chipTool, + " ***** Test Step 49 : Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within " + "range\n"); + if (ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesSetsBackDefaultValueOfMaxCoolSetpointLimit_49(); + err = TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_49(); break; case 50: ChipLogProgress(chipTool, - " ***** Test Step 50 : Reads MinSetpointDeadBand attribute from Server DUT and verifies that the value is within " - "range\n"); - if (ShouldSkip("A_MINSETPOINTDEADBAND")) { + " ***** Test Step 50 : Writes a value back that is different but valid for MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestReadsMinSetpointDeadBandAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_50(); + err = TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_50(); break; case 51: ChipLogProgress(chipTool, - " ***** Test Step 51 : Writes a value back that is different but valid for MinSetpointDeadBand attribute\n"); - if (ShouldSkip("A_MINSETPOINTDEADBAND")) { + " ***** Test Step 51 : Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesAValueBackThatIsDifferentButValidForMinSetpointDeadBandAttribute_51(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_51(); break; case 52: - ChipLogProgress(chipTool, - " ***** Test Step 52 : Reads it back again to confirm the successful write of MinSetpointDeadBand attribute\n"); - if (ShouldSkip("A_MINSETPOINTDEADBAND")) { + ChipLogProgress( + chipTool, " ***** Test Step 52 : Writes MinCoolSetpointLimit to value below the AbsMinCoolSetpointLimit \n"); + if (ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinSetpointDeadBandAttribute_52(); + err = TestWritesMinCoolSetpointLimitToValueBelowTheAbsMinCoolSetpointLimit_52(); break; case 53: - ChipLogProgress(chipTool, " ***** Test Step 53 : Writes the value below MinSetpointDeadBand\n"); - if (ShouldSkip("A_MINSETPOINTDEADBAND")) { + ChipLogProgress( + chipTool, " ***** Test Step 53 : Writes MinCoolSetpointLimit to value above the MaxCoolSetpointLimit \n"); + if (ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesTheValueBelowMinSetpointDeadBand_53(); + err = TestWritesMinCoolSetpointLimitToValueAboveTheMaxCoolSetpointLimit_53(); break; case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : Writes the value above MinSetpointDeadBand \n"); - if (ShouldSkip("A_MINSETPOINTDEADBAND")) { + ChipLogProgress( + chipTool, " ***** Test Step 54 : Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesTheValueAboveMinSetpointDeadBand_54(); + err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_54(); break; case 55: - ChipLogProgress(chipTool, " ***** Test Step 55 : Writes the min limit of MinSetpointDeadBand\n"); - if (ShouldSkip("A_MINSETPOINTDEADBAND")) { + ChipLogProgress( + chipTool, " ***** Test Step 55 : Writes the limit of MaxCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesTheMinLimitOfMinSetpointDeadBand_55(); + err = TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_55(); break; case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : Writes the max limit of MinSetpointDeadBand\n"); - if (ShouldSkip("A_MINSETPOINTDEADBAND")) { + ChipLogProgress( + chipTool, " ***** Test Step 56 : Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestWritesTheMaxLimitOfMinSetpointDeadBand_56(); + err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_56(); break; case 57: ChipLogProgress(chipTool, - " ***** Test Step 57 : Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid\n"); - if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) { + " ***** Test Step 57 : Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within " + "range\n"); + if (ShouldSkip("TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_57(); + err = TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_57(); break; case 58: - ChipLogProgress( - chipTool, " ***** Test Step 58 : Write Attribute command for ControlSequenceOfOperation with a new valid value\n"); - if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) { + ChipLogProgress(chipTool, + " ***** Test Step 58 : Writes a value back that is different but valid for MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT && !TSTAT.S.F05")) { NextTest(); return; } - err = TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_58(); + err = TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_58(); break; case 59: - ChipLogProgress(chipTool, " ***** Test Step 59 : Read it back again to confirm the successful write\n"); - if (ShouldSkip("A_CONTROLSEQUENCEOFOPERATION")) { + ChipLogProgress(chipTool, + " ***** Test Step 59 : Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT && !TSTAT.S.F05")) { NextTest(); return; } - err = TestReadItBackAgainToConfirmTheSuccessfulWrite_59(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_59(); break; case 60: - ChipLogProgress(chipTool, " ***** Test Step 60 : Sends SetpointRaise Command\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower")) { + ChipLogProgress( + chipTool, " ***** Test Step 60 : Writes MaxCoolSetpointLimit to value below the AbsMinCoolSetpointLimit \n"); + if (ShouldSkip("TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestSendsSetpointRaiseCommand_60(); + err = TestWritesMaxCoolSetpointLimitToValueBelowTheAbsMinCoolSetpointLimit_60(); break; case 61: ChipLogProgress( - chipTool, " ***** Test Step 61 : Reads back OccupiedHeatingSetpoint to confirm the success of the write\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && A_OCCUPIEDHEATINGSETPOINT")) { + chipTool, " ***** Test Step 61 : Writes MaxCoolSetpointLimit to value above the MaxCoolSetpointLimit \n"); + if (ShouldSkip("TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_61(); + err = TestWritesMaxCoolSetpointLimitToValueAboveTheMaxCoolSetpointLimit_61(); break; case 62: - ChipLogProgress(chipTool, " ***** Test Step 62 : Sends SetpointRaise Command\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower")) { + ChipLogProgress( + chipTool, " ***** Test Step 62 : Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestSendsSetpointRaiseCommand_62(); + err = TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_62(); break; case 63: ChipLogProgress( - chipTool, " ***** Test Step 63 : Reads back OccupiedHeatingSetpoint to confirm the success of the write\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && A_OCCUPIEDCOOLINGSETPOINT")) { + chipTool, " ***** Test Step 63 : Writes the limit of MaxCoolSetpointLimit to MaxCoolSetpointLimit attribute\n"); + if (ShouldSkip("TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_63(); + err = TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_63(); break; case 64: - ChipLogProgress(chipTool, " ***** Test Step 64 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + ChipLogProgress(chipTool, " ***** Test Step 64 : Writes (sets back) default value of MinHeatSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F01 && A_MINHEATSETPOINTLIMIT")) { NextTest(); return; } - err = TestSetsOccupiedCoolingSetpointToDefaultValue_64(); + err = TestWritesSetsBackDefaultValueOfMinHeatSetpointLimit_64(); break; case 65: - ChipLogProgress(chipTool, " ***** Test Step 65 : Sends SetpointRaise Command\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower")) { + ChipLogProgress(chipTool, " ***** Test Step 65 : Writes (sets back)default value of MaxHeatSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F01 && A_MAXHEATSETPOINTLIMIT &&!TSTAT.S.F05")) { NextTest(); return; } - err = TestSendsSetpointRaiseCommand_65(); + err = TestWritesSetsBackdefaultValueOfMaxHeatSetpointLimit_65(); break; case 66: - ChipLogProgress( - chipTool, " ***** Test Step 66 : Reads back OccupiedCoolingSetpoint to confirm the success of the write\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && A_OCCUPIEDCOOLINGSETPOINT")) { + ChipLogProgress(chipTool, " ***** Test Step 66 : Writes MaxHeatSetpointLimit That meets the deadband of 2.5C\n"); + if (ShouldSkip("TSTAT.S.F01 && A_MAXHEATSETPOINTLIMIT &&!TSTAT.S.F05")) { NextTest(); return; } - err = TestReadsBackOccupiedCoolingSetpointToConfirmTheSuccessOfTheWrite_66(); + err = TestWritesMaxHeatSetpointLimitThatMeetsTheDeadbandOf25c_66(); break; case 67: - ChipLogProgress(chipTool, " ***** Test Step 67 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + ChipLogProgress(chipTool, " ***** Test Step 67 : Writes (sets back) default value of MinCoolSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F01 && A_MINCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestSetsOccupiedCoolingSetpointToDefaultValue_67(); + err = TestWritesSetsBackDefaultValueOfMinCoolSetpointLimit_67(); break; case 68: - ChipLogProgress(chipTool, " ***** Test Step 68 : Sends SetpointRaise Command\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower")) { + ChipLogProgress(chipTool, " ***** Test Step 68 : Writes (sets back) default value of MaxCoolSetpointLimit\n"); + if (ShouldSkip("TSTAT.S.F01 && A_MAXCOOLSETPOINTLIMIT")) { NextTest(); return; } - err = TestSendsSetpointRaiseCommand_68(); + err = TestWritesSetsBackDefaultValueOfMaxCoolSetpointLimit_68(); break; case 69: - ChipLogProgress( - chipTool, " ***** Test Step 69 : Reads back OccupiedCoolingSetpoint to confirm the success of the write\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && A_OCCUPIEDCOOLINGSETPOINT")) { + ChipLogProgress(chipTool, + " ***** Test Step 69 : Reads MinSetpointDeadBand attribute from Server DUT and verifies that the value is within " + "range\n"); + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } - err = TestReadsBackOccupiedCoolingSetpointToConfirmTheSuccessOfTheWrite_69(); + err = TestReadsMinSetpointDeadBandAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_69(); break; case 70: - ChipLogProgress(chipTool, " ***** Test Step 70 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + ChipLogProgress(chipTool, + " ***** Test Step 70 : Writes a value back that is different but valid for MinSetpointDeadBand attribute\n"); + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } - err = TestSetsOccupiedCoolingSetpointToDefaultValue_70(); + err = TestWritesAValueBackThatIsDifferentButValidForMinSetpointDeadBandAttribute_70(); break; case 71: - ChipLogProgress(chipTool, " ***** Test Step 71 : Sends SetpointRaise Command\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower")) { + ChipLogProgress(chipTool, + " ***** Test Step 71 : Reads it back again to confirm the successful write of MinSetpointDeadBand attribute\n"); + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } - err = TestSendsSetpointRaiseCommand_71(); + err = TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinSetpointDeadBandAttribute_71(); break; case 72: - ChipLogProgress( - chipTool, " ***** Test Step 72 : Reads back OccupiedCoolingSetpoint to confirm the success of the write\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + ChipLogProgress(chipTool, " ***** Test Step 72 : Writes the value below MinSetpointDeadBand\n"); + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } - err = TestReadsBackOccupiedCoolingSetpointToConfirmTheSuccessOfTheWrite_72(); + err = TestWritesTheValueBelowMinSetpointDeadBand_72(); break; case 73: - ChipLogProgress( - chipTool, " ***** Test Step 73 : Reads back OccupiedHeatingSetpoint to confirm the success of the write\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && A_OCCUPIEDHEATINGSETPOINT")) { + ChipLogProgress(chipTool, " ***** Test Step 73 : Writes the value above MinSetpointDeadBand \n"); + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } - err = TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_73(); + err = TestWritesTheValueAboveMinSetpointDeadBand_73(); break; case 74: - ChipLogProgress(chipTool, " ***** Test Step 74 : Sets OccupiedCoolingSetpoint to default value\n"); - if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { + ChipLogProgress(chipTool, " ***** Test Step 74 : Writes the min limit of MinSetpointDeadBand\n"); + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } - err = TestSetsOccupiedCoolingSetpointToDefaultValue_74(); + err = TestWritesTheMinLimitOfMinSetpointDeadBand_74(); break; case 75: - ChipLogProgress(chipTool, " ***** Test Step 75 : Sends SetpointRaise Command\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && CR_SetpointRaiseLower")) { + ChipLogProgress(chipTool, " ***** Test Step 75 : Writes the max limit of MinSetpointDeadBand\n"); + if (ShouldSkip("TSTAT.S.F05")) { NextTest(); return; } - err = TestSendsSetpointRaiseCommand_75(); + err = TestWritesTheMaxLimitOfMinSetpointDeadBand_75(); break; case 76: - ChipLogProgress( - chipTool, " ***** Test Step 76 : Reads back OccupiedCoolingSetpoint to confirm the success of the write\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && A_OCCUPIEDCOOLINGSETPOINT")) { + ChipLogProgress(chipTool, + " ***** Test Step 76 : Reads ControlSequenceOfOperation from Server DUT and verifies that the value is valid\n"); + if (ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01")) { NextTest(); return; } - err = TestReadsBackOccupiedCoolingSetpointToConfirmTheSuccessOfTheWrite_76(); + err = TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_76(); break; case 77: ChipLogProgress( - chipTool, " ***** Test Step 77 : Reads back OccupiedHeatingSetpoint to confirm the success of the write\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && A_OCCUPIEDHEATINGSETPOINT")) { + chipTool, " ***** Test Step 77 : Write Attribute command for ControlSequenceOfOperation with a new valid value\n"); + if (ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01")) { + NextTest(); + return; + } + err = TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_77(); + break; + case 78: + ChipLogProgress(chipTool, " ***** Test Step 78 : Read it back again to confirm the successful write\n"); + if (ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01")) { + NextTest(); + return; + } + err = TestReadItBackAgainToConfirmTheSuccessfulWrite_78(); + break; + case 79: + ChipLogProgress(chipTool, + " ***** Test Step 79 : Writes MaxHeatSetpointLimit attribute to default value of 2950 to meet deadband " + "constraint\n"); + if (ShouldSkip("TSTAT.S.F00 && A_MINHEATSETPOINTLIMIT && TSTAT.S.F05")) { + NextTest(); + return; + } + err = TestWritesMaxHeatSetpointLimitAttributeToDefaultValueOf2950ToMeetDeadbandConstraint_79(); + break; + case 80: + ChipLogProgress(chipTool, " ***** Test Step 80 : Sets OccupiedCoolingSetpoint to default value\n"); + if (ShouldSkip("TSTAT.S.F01")) { + NextTest(); + return; + } + err = TestSetsOccupiedCoolingSetpointToDefaultValue_80(); + break; + case 81: + ChipLogProgress(chipTool, " ***** Test Step 81 : Sets OccupiedHeatingSetpoint to default value\n"); + if (ShouldSkip("TSTAT.S.F00")) { + NextTest(); + return; + } + err = TestSetsOccupiedHeatingSetpointToDefaultValue_81(); + break; + case 82: + ChipLogProgress(chipTool, " ***** Test Step 82 : Sends SetpointRaise Command Heat Only\n"); + if (ShouldSkip("TSTAT.S.F00")) { + NextTest(); + return; + } + err = TestSendsSetpointRaiseCommandHeatOnly_82(); + break; + case 83: + ChipLogProgress( + chipTool, " ***** Test Step 83 : Reads back OccupiedHeatingSetpoint to confirm the success of the write\n"); + if (ShouldSkip("TSTAT.S.F00")) { + NextTest(); + return; + } + err = TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_83(); + break; + case 84: + ChipLogProgress(chipTool, " ***** Test Step 84 : Sets OccupiedHeatingSetpoint to default value\n"); + if (ShouldSkip("TSTAT.S.F00")) { + NextTest(); + return; + } + err = TestSetsOccupiedHeatingSetpointToDefaultValue_84(); + break; + case 85: + ChipLogProgress(chipTool, " ***** Test Step 85 : Sends SetpointRaise Command Heat Only\n"); + if (ShouldSkip("TSTAT.S.F00")) { + NextTest(); + return; + } + err = TestSendsSetpointRaiseCommandHeatOnly_85(); + break; + case 86: + ChipLogProgress( + chipTool, " ***** Test Step 86 : Reads back OccupiedHeatingSetpoint to confirm the success of the write\n"); + if (ShouldSkip("TSTAT.S.F00")) { + NextTest(); + return; + } + err = TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_86(); + break; + case 87: + ChipLogProgress(chipTool, " ***** Test Step 87 : Sends SetpointRaise Command Cool Only\n"); + if (ShouldSkip("TSTAT.S.F01")) { + NextTest(); + return; + } + err = TestSendsSetpointRaiseCommandCoolOnly_87(); + break; + case 88: + ChipLogProgress( + chipTool, " ***** Test Step 88 : Reads back OccupiedCoolingSetpoint to confirm the success of the write\n"); + if (ShouldSkip("TSTAT.S.F01")) { + NextTest(); + return; + } + err = TestReadsBackOccupiedCoolingSetpointToConfirmTheSuccessOfTheWrite_88(); + break; + case 89: + ChipLogProgress(chipTool, " ***** Test Step 89 : Sets OccupiedCoolingSetpoint to default value\n"); + if (ShouldSkip("TSTAT.S.F01")) { + NextTest(); + return; + } + err = TestSetsOccupiedCoolingSetpointToDefaultValue_89(); + break; + case 90: + ChipLogProgress(chipTool, " ***** Test Step 90 : Sends SetpointRaise Command Cool Only\n"); + if (ShouldSkip("TSTAT.S.F01")) { + NextTest(); + return; + } + err = TestSendsSetpointRaiseCommandCoolOnly_90(); + break; + case 91: + ChipLogProgress( + chipTool, " ***** Test Step 91 : Reads back OccupiedCoolingSetpoint to confirm the success of the write\n"); + if (ShouldSkip("TSTAT.S.F01")) { + NextTest(); + return; + } + err = TestReadsBackOccupiedCoolingSetpointToConfirmTheSuccessOfTheWrite_91(); + break; + case 92: + ChipLogProgress(chipTool, " ***** Test Step 92 : Sets OccupiedCoolingSetpoint to default value\n"); + if (ShouldSkip("TSTAT.S.F01")) { + NextTest(); + return; + } + err = TestSetsOccupiedCoolingSetpointToDefaultValue_92(); + break; + case 93: + ChipLogProgress(chipTool, " ***** Test Step 93 : Sets OccupiedHeatingSetpoint to default value\n"); + if (ShouldSkip("TSTAT.S.F00")) { + NextTest(); + return; + } + err = TestSetsOccupiedHeatingSetpointToDefaultValue_93(); + break; + case 94: + ChipLogProgress(chipTool, " ***** Test Step 94 : Sends SetpointRaise Command Heat & Cool\n"); + if (ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01")) { + NextTest(); + return; + } + err = TestSendsSetpointRaiseCommandHeatCool_94(); + break; + case 95: + ChipLogProgress( + chipTool, " ***** Test Step 95 : Reads back OccupiedCoolingSetpoint to confirm the success of the write\n"); + if (ShouldSkip("TSTAT.S.F01")) { + NextTest(); + return; + } + err = TestReadsBackOccupiedCoolingSetpointToConfirmTheSuccessOfTheWrite_95(); + break; + case 96: + ChipLogProgress( + chipTool, " ***** Test Step 96 : Reads back OccupiedHeatingSetpoint to confirm the success of the write\n"); + if (ShouldSkip("TSTAT.S.F00")) { + NextTest(); + return; + } + err = TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_96(); + break; + case 97: + ChipLogProgress(chipTool, " ***** Test Step 97 : Sets OccupiedCoolingSetpoint to default value\n"); + if (ShouldSkip("TSTAT.S.F01")) { + NextTest(); + return; + } + err = TestSetsOccupiedCoolingSetpointToDefaultValue_97(); + break; + case 98: + ChipLogProgress(chipTool, " ***** Test Step 98 : Sets OccupiedHeatingSetpoint to default value\n"); + if (ShouldSkip("TSTAT.S.F00")) { + NextTest(); + return; + } + err = TestSetsOccupiedHeatingSetpointToDefaultValue_98(); + break; + case 99: + ChipLogProgress(chipTool, " ***** Test Step 99 : Sends SetpointRaise Command Heat & Cool\n"); + if (ShouldSkip("TSTAT.S.F00 || TSTAT.S.F01")) { + NextTest(); + return; + } + err = TestSendsSetpointRaiseCommandHeatCool_99(); + break; + case 100: + ChipLogProgress( + chipTool, " ***** Test Step 100 : Reads back OccupiedCoolingSetpoint to confirm the success of the write\n"); + if (ShouldSkip("TSTAT.S.F01")) { + NextTest(); + return; + } + err = TestReadsBackOccupiedCoolingSetpointToConfirmTheSuccessOfTheWrite_100(); + break; + case 101: + ChipLogProgress( + chipTool, " ***** Test Step 101 : Reads back OccupiedHeatingSetpoint to confirm the success of the write\n"); + if (ShouldSkip("TSTAT.S.F00")) { NextTest(); return; } - err = TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_77(); + err = TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_101(); break; } @@ -47331,7 +46987,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -47340,16 +46996,16 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -47358,7 +47014,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); @@ -47373,16 +47029,16 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 22: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 23: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 24: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 25: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -47409,46 +47065,46 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 33: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 34: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 35: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 36: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 37: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 38: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 39: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 40: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 41: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 42: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 43: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 44: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 45: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 46: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 47: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -47466,13 +47122,13 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 52: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 53: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 54: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 55: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -47490,10 +47146,10 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 60: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 61: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 62: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -47526,10 +47182,10 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 72: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 73: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 74: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -47543,6 +47199,78 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { case 77: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 78: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 79: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 80: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 81: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 82: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 83: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 84: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 85: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 86: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 87: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 88: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 89: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 90: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 91: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 92: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 93: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 94: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 95: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 96: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 97: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 98: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 99: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 100: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 101: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -47556,7 +47284,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 78; + const uint16_t mTestCount = 102; chip::Optional mNodeId; chip::Optional mCluster; @@ -47582,21 +47310,11 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { NSLog(@"Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is within range Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OccupiedCoolingSetpoint", actualValue, 2600)); - } - VerifyOrReturn(CheckConstraintType("occupiedCoolingSetpoint", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("occupiedCoolingSetpoint", [value shortValue], 1600)); - VerifyOrReturn(CheckConstraintMaxValue("occupiedCoolingSetpoint", [value shortValue], 2600)); + VerifyOrReturn(CheckConstraintMaxValue("occupiedCoolingSetpoint", [value shortValue], 3200)); NextTest(); }]; @@ -47613,18 +47331,13 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2250]; + occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2500]; [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument completionHandler:^(NSError * _Nullable err) { NSLog(@"Writes a value back that is different but valid for " @"OccupiedCoolingSetpoint attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -47644,16 +47357,11 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { [cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"Reads it back again to confirm the successful write of OccupiedCoolingSetpoint attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OccupiedCoolingSetpoint", actualValue, 2250)); + VerifyOrReturn(CheckValue("OccupiedCoolingSetpoint", actualValue, 2500)); } NextTest(); @@ -47662,7 +47370,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesOccupiedCoolingSetpointToValueBelowTheMinCoolSetpointLimit_4() + CHIP_ERROR TestWritesOccupiedCoolingSetpointToValueBelowTheABSMinCoolSetpointLimit_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -47674,15 +47382,10 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { occupiedCoolingSetpointArgument = [NSNumber numberWithShort:30]; [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Writes OccupiedCoolingSetpoint to value below the MinCoolSetpointLimit " - @"Error: %@", + NSLog(@"Writes OccupiedCoolingSetpoint to value below the " + @"ABSMinCoolSetpointLimit Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn( CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -47707,10 +47410,53 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn( + CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesTheLimitOfMinCoolSetpointLimitToOccupiedCoolingSetpointAttribute_6() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = [NSNumber numberWithShort:1600]; + [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of MinCoolSetpointLimit to OccupiedCoolingSetpoint " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesTheCoolingSetpointBelowTheHeatingSetpointWhenAutoIsEnabled_7() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = [NSNumber numberWithShort:1600]; + [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the CoolingSetpoint below the HeatingSetpoint when auto is " + @"enabled Error: %@", + err); VerifyOrReturn( CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); @@ -47720,7 +47466,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToOccupiedCoolingSetpointAttribute_6() + CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToOccupiedCoolingSetpointAttribute_8() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -47729,18 +47475,13 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; + occupiedCoolingSetpointArgument = [NSNumber numberWithShort:3200]; [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument completionHandler:^(NSError * _Nullable err) { NSLog(@"Writes the limit of MaxCoolSetpointLimit to OccupiedCoolingSetpoint " @"attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -47749,7 +47490,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsOccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_7() + CHIP_ERROR TestReadsOccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -47761,18 +47502,8 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { NSLog(@"Reads OccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is within range Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OccupiedHeatingSetpoint", actualValue, 2000)); - } - VerifyOrReturn(CheckConstraintType("occupiedHeatingSetpoint", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("occupiedHeatingSetpoint", [value shortValue], 700)); VerifyOrReturn(CheckConstraintMaxValue("occupiedHeatingSetpoint", [value shortValue], 3000)); @@ -47783,7 +47514,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForOccupiedHeatingSetpointAttribute_8() + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForOccupiedHeatingSetpointAttribute_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -47799,11 +47530,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"OccupiedHeatingSetpoint attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -47812,7 +47538,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_9() + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -47823,11 +47549,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { @@ -47841,7 +47562,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesOccupiedHeatingSetpointToValueBelowTheMinHeatSetpointLimit_10() + CHIP_ERROR TestWritesOccupiedHeatingSetpointToValueBelowTheMinHeatSetpointLimit_12() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -47857,11 +47578,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn( CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -47870,7 +47586,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesOccupiedHeatingSetpointToValueAboveTheMaxHeatSetpointLimit_11() + CHIP_ERROR TestWritesOccupiedHeatingSetpointToValueAboveTheMaxHeatSetpointLimit_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -47886,11 +47602,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn( CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -47899,7 +47610,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfMinHeatSetpointLimitToOccupiedHeatingSetpointAttribute_12() + CHIP_ERROR TestWritesTheLimitOfMinHeatSetpointLimitToOccupiedHeatingSetpointAttribute_14() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -47915,10 +47626,53 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfOccupiedHeatingSetpointAttribute_15() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads it back again to confirm the successful write of OccupiedHeatingSetpoint attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OccupiedHeatingSetpoint", actualValue, 700)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_16() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:3000]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint " + @"attribute Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -47928,7 +47682,31 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsUnoccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_13() + CHIP_ERROR TestWritesTheLimitOfMaxHeatSetpointLimitToOccupiedHeatingSetpointAttribute_17() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:3000]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of MaxHeatSetpointLimit to OccupiedHeatingSetpoint " + @"attribute Error: %@", + err); + + VerifyOrReturn( + CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsUnoccupiedCoolingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_18() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -47942,11 +47720,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"Reads UnoccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is within range Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { @@ -47964,7 +47737,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForUnoccupiedCoolingSetpointAttribute_14() + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForUnoccupiedCoolingSetpointAttribute_19() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -47980,11 +47753,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"UnoccupiedCoolingSetpoint attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -47993,7 +47761,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfUnoccupiedCoolingSetpointAttribute_15() + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfUnoccupiedCoolingSetpointAttribute_20() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48005,11 +47773,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { readAttributeUnoccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"Reads it back again to confirm the successful write of UnoccupiedCoolingSetpoint attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { @@ -48023,7 +47786,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesUnoccupiedCoolingSetpointToValueBelowTheMinHeatSetpointLimit_16() + CHIP_ERROR TestWritesUnoccupiedCoolingSetpointToValueBelowTheMinCoolSetpointLimit_21() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48036,14 +47799,9 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { [cluster writeAttributeUnoccupiedCoolingSetpointWithValue:unoccupiedCoolingSetpointArgument completionHandler:^(NSError * _Nullable err) { NSLog(@"Writes UnoccupiedCoolingSetpoint to value below the " - @"MinHeatSetpointLimit Error: %@", + @"MinCoolSetpointLimit Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue( "status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -48052,7 +47810,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesUnoccupiedCoolingSetpointToValueAboveTheMaxHeatSetpointLimit_17() + CHIP_ERROR TestWritesUnoccupiedCoolingSetpointToValueAboveTheMaxCoolSetpointLimit_22() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48065,14 +47823,9 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { [cluster writeAttributeUnoccupiedCoolingSetpointWithValue:unoccupiedCoolingSetpointArgument completionHandler:^(NSError * _Nullable err) { NSLog(@"Writes UnoccupiedCoolingSetpoint to value above the " - @"MaxHeatSetpointLimit Error: %@", + @"MaxCoolSetpointLimit Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue( "status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -48081,7 +47834,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfMinCoolSetpointLimitToUnoccupiedCoolingSetpointAttribute_18() + CHIP_ERROR TestWritesTheLimitOfMinCoolSetpointLimitToUnoccupiedCoolingSetpointAttribute_23() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48097,11 +47850,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -48110,7 +47858,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToUnoccupiedCoolingSetpointAttribute_19() + CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToUnoccupiedCoolingSetpointAttribute_24() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48126,11 +47874,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -48139,7 +47882,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsUnoccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_20() + CHIP_ERROR TestReadsUnoccupiedHeatingSetpointAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_25() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48153,11 +47896,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"Reads UnoccupiedHeatingSetpoint attribute from Server DUT and verifies that the value is within range Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { @@ -48175,7 +47913,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForUnoccupiedHeatingSetpointAttribute_21() + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForUnoccupiedHeatingSetpointAttribute_26() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48191,11 +47929,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"UnoccupiedHeatingSetpoint attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -48204,7 +47937,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfUnoccupiedHeatingSetpointAttribute_22() + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfUnoccupiedHeatingSetpointAttribute_27() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48216,11 +47949,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { readAttributeUnoccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"Reads it back again to confirm the successful write of UnoccupiedHeatingSetpoint attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { @@ -48234,7 +47962,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesUnoccupiedHeatingSetpointToValueBelowTheMinHeatSetpointLimit_23() + CHIP_ERROR TestWritesUnoccupiedHeatingSetpointToValueBelowTheMinHeatSetpointLimit_28() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48250,11 +47978,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"MinHeatSetpointLimit Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue( "status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -48263,7 +47986,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesUnoccupiedHeatingSetpointToValueAboveTheMaxHeatSetpointLimit_24() + CHIP_ERROR TestWritesUnoccupiedHeatingSetpointToValueAboveTheMaxHeatSetpointLimit_29() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48279,11 +48002,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"MaxHeatSetpointLimit Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue( "status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -48292,7 +48010,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfMinHeatSetpointLimitToUnoccupiedHeatingSetpointAttribute_25() + CHIP_ERROR TestWritesTheLimitOfMinHeatSetpointLimitToUnoccupiedHeatingSetpointAttribute_30() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48308,11 +48026,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -48321,7 +48034,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfMaxHeatSetpointLimitToUnoccupiedHeatingSetpointAttribute_26() + CHIP_ERROR TestWritesTheLimitOfMaxHeatSetpointLimitToUnoccupiedHeatingSetpointAttribute_31() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48337,11 +48050,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -48350,7 +48058,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMinHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_27() + CHIP_ERROR TestReadsMinHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_32() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48362,11 +48070,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { NSLog( @"Reads MinHeatSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { @@ -48384,7 +48087,78 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMinHeatSetpointLimitToValueBelowTheAbsMinHeatSetpointLimit_28() + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinHeatSetpointLimitAttribute_33() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = [NSNumber numberWithShort:800]; + [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value back that is different but valid for MinHeatSetpointLimit " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinHeatSetpointLimitAttribute_34() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads it back again to confirm the successful write of MinHeatSetpointLimit attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("MinHeatSetpointLimit", actualValue, 800)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesAValueBackThatIsDifferentButViolatesTheDeadband_35() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = [NSNumber numberWithShort:2000]; + [cluster + writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value back that is different but violates the deadband Error: %@", err); + + VerifyOrReturn( + CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesMinHeatSetpointLimitToValueBelowTheAbsMinHeatSetpointLimit_36() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48401,11 +48175,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"Writes MinHeatSetpointLimit to value below the AbsMinHeatSetpointLimit Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn( CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -48414,7 +48183,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMinHeatSetpointLimitToValueAboveTheAbsMaxHeatSetpointLimit_29() + CHIP_ERROR TestWritesMinHeatSetpointLimitToValueAboveTheAbsMaxHeatSetpointLimit_37() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48431,11 +48200,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"Writes MinHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn( CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -48444,7 +48208,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_30() + CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_38() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48460,10 +48224,29 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_39() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; + [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit " + @"attribute Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -48473,7 +48256,84 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_31() + CHIP_ERROR TestReadsMaxHeatSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_40() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog( + @"Reads MaxHeatSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("MaxHeatSetpointLimit", actualValue, 3000)); + } + + VerifyOrReturn(CheckConstraintType("maxHeatSetpointLimit", "", "int16")); + VerifyOrReturn(CheckConstraintMinValue("maxHeatSetpointLimit", [value shortValue], 700)); + VerifyOrReturn(CheckConstraintMaxValue("maxHeatSetpointLimit", [value shortValue], 3000)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMinHeatSetpointLimitAttribute_41() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = [NSNumber numberWithShort:700]; + [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of AbsMinHeatSetpointLimit to MinHeatSetpointLimit " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMinHeatSetpointLimitAttribute_42() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id minHeatSetpointLimitArgument; + minHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; + [cluster writeAttributeMinHeatSetpointLimitWithValue:minHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of AbsMaxHeatSetpointLimit to MinHeatSetpointLimit " + @"attribute Error: %@", + err); + + VerifyOrReturn( + CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxHeatSetpointLimitAttribute_43() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48482,18 +48342,13 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); id maxHeatSetpointLimitArgument; - maxHeatSetpointLimitArgument = [NSNumber numberWithShort:2000]; + maxHeatSetpointLimitArgument = [NSNumber numberWithShort:2900]; [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument completionHandler:^(NSError * _Nullable err) { NSLog(@"Writes a value back that is different but valid for MaxHeatSetpointLimit " @"attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -48502,7 +48357,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_32() + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxHeatSetpointLimitAttribute_44() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48513,16 +48368,11 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { [cluster readAttributeMaxHeatSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"Reads it back again to confirm the successful write of MaxHeatSetpointLimit attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("MaxHeatSetpointLimit", actualValue, 2000)); + VerifyOrReturn(CheckValue("MaxHeatSetpointLimit", actualValue, 2900)); } NextTest(); @@ -48531,7 +48381,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMaxHeatSetpointLimitToValueBelowTheAbsMinHeatSetpointLimit_33() + CHIP_ERROR TestWritesMaxHeatSetpointLimitToValueBelowTheAbsMinHeatSetpointLimit_45() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48548,11 +48398,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"Writes MaxHeatSetpointLimit to value below the AbsMinHeatSetpointLimit Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn( CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -48561,7 +48406,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMaxHeatSetpointLimitToValueAboveTheAbsMaxHeatSetpointLimit_34() + CHIP_ERROR TestWritesMaxHeatSetpointLimitToValueAboveTheAbsMaxHeatSetpointLimit_46() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48578,11 +48423,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"Writes MaxHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn( CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -48591,7 +48431,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_35() + CHIP_ERROR TestWritesTheLimitOfAbsMinHeatSetpointLimitToMaxHeatSetpointLimitAttribute_47() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48607,10 +48447,29 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesTheLimitOfAbsMaxHeatSetpointLimitToMaxHeatSetpointLimitAttribute_48() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; + [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of AbsMaxHeatSetpointLimit to MaxHeatSetpointLimit " + @"attribute Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -48620,7 +48479,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_36() + CHIP_ERROR TestReadsMinCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_49() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48632,11 +48491,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { NSLog( @"Reads MinCoolSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { @@ -48654,7 +48508,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_37() + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinCoolSetpointLimitAttribute_50() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48670,11 +48524,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -48683,7 +48532,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_38() + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinCoolSetpointLimitAttribute_51() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48694,11 +48543,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { [cluster readAttributeMinCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"Reads it back again to confirm the successful write of MinCoolSetpointLimit attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { @@ -48712,7 +48556,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMinCoolSetpointLimitToValueBelowTheAbsMinCoolSetpointLimit_39() + CHIP_ERROR TestWritesMinCoolSetpointLimitToValueBelowTheAbsMinCoolSetpointLimit_52() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48729,11 +48573,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"Writes MinCoolSetpointLimit to value below the AbsMinCoolSetpointLimit Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn( CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -48742,7 +48581,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMinCoolSetpointLimitToValueAboveTheMaxCoolSetpointLimit_40() + CHIP_ERROR TestWritesMinCoolSetpointLimitToValueAboveTheMaxCoolSetpointLimit_53() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48758,11 +48597,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { NSLog(@"Writes MinCoolSetpointLimit to value above the MaxCoolSetpointLimit Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn( CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -48771,7 +48605,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_41() + CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_54() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48787,11 +48621,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -48800,7 +48629,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_42() + CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMinCoolSetpointLimitAttribute_55() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48816,10 +48645,29 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMinCoolSetpointLimitAttribute_56() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id minCoolSetpointLimitArgument; + minCoolSetpointLimitArgument = [NSNumber numberWithShort:1600]; + [cluster writeAttributeMinCoolSetpointLimitWithValue:minCoolSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of AbsMinCoolSetpointLimit to MinCoolSetpointLimit " + @"attribute Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -48829,7 +48677,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_43() + CHIP_ERROR TestReadsMaxCoolSetpointLimitAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_57() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48841,11 +48689,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { NSLog( @"Reads MaxCoolSetpointLimit attribute from Server DUT and verifies that the value is within range Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { @@ -48863,7 +48706,55 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMaxCoolSetpointLimitToValueBelowTheAbsMinCoolSetpointLimit_44() + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMaxCoolSetpointLimitAttribute_58() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id maxCoolSetpointLimitArgument; + maxCoolSetpointLimitArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes a value back that is different but valid for MaxCoolSetpointLimit " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMaxCoolSetpointLimitAttribute_59() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxCoolSetpointLimitWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads it back again to confirm the successful write of MaxCoolSetpointLimit attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("MaxCoolSetpointLimit", actualValue, 2000)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesMaxCoolSetpointLimitToValueBelowTheAbsMinCoolSetpointLimit_60() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48880,11 +48771,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"Writes MaxCoolSetpointLimit to value below the AbsMinCoolSetpointLimit Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn( CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -48893,7 +48779,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesMaxCoolSetpointLimitToValueAboveTheMaxCoolSetpointLimit_45() + CHIP_ERROR TestWritesMaxCoolSetpointLimitToValueAboveTheMaxCoolSetpointLimit_61() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48909,11 +48795,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { NSLog(@"Writes MaxCoolSetpointLimit to value above the MaxCoolSetpointLimit Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn( CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -48922,7 +48803,31 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_46() + CHIP_ERROR TestWritesTheLimitOfAbsMinCoolSetpointLimitToMaxCoolSetpointLimitAttribute_62() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id maxCoolSetpointLimitArgument; + maxCoolSetpointLimitArgument = [NSNumber numberWithShort:1600]; + [cluster writeAttributeMaxCoolSetpointLimitWithValue:maxCoolSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes the limit of AbsMinCoolSetpointLimit to MaxCoolSetpointLimit " + @"attribute Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesTheLimitOfMaxCoolSetpointLimitToMaxCoolSetpointLimitAttribute_63() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48938,11 +48843,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -48951,7 +48851,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesSetsBackDefaultValueOfMinHeatSetpointLimit_47() + CHIP_ERROR TestWritesSetsBackDefaultValueOfMinHeatSetpointLimit_64() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48965,10 +48865,27 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { completionHandler:^(NSError * _Nullable err) { NSLog(@"Writes (sets back) default value of MinHeatSetpointLimit Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesSetsBackdefaultValueOfMaxHeatSetpointLimit_65() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = [NSNumber numberWithShort:3000]; + [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes (sets back)default value of MaxHeatSetpointLimit Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -48978,7 +48895,29 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesSetsBackDefaultValueOfMinCoolSetpointLimit_48() + CHIP_ERROR TestWritesMaxHeatSetpointLimitThatMeetsTheDeadbandOf25c_66() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = [NSNumber numberWithShort:2950]; + [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes MaxHeatSetpointLimit That meets the deadband of 2.5C Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWritesSetsBackDefaultValueOfMinCoolSetpointLimit_67() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -48992,11 +48931,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { completionHandler:^(NSError * _Nullable err) { NSLog(@"Writes (sets back) default value of MinCoolSetpointLimit Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -49005,7 +48939,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesSetsBackDefaultValueOfMaxCoolSetpointLimit_49() + CHIP_ERROR TestWritesSetsBackDefaultValueOfMaxCoolSetpointLimit_68() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49019,11 +48953,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { completionHandler:^(NSError * _Nullable err) { NSLog(@"Writes (sets back) default value of MaxCoolSetpointLimit Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -49032,7 +48961,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsMinSetpointDeadBandAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_50() + CHIP_ERROR TestReadsMinSetpointDeadBandAttributeFromServerDutAndVerifiesThatTheValueIsWithinRange_69() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49044,11 +48973,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { NSLog( @"Reads MinSetpointDeadBand attribute from Server DUT and verifies that the value is within range Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { @@ -49066,7 +48990,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinSetpointDeadBandAttribute_51() + CHIP_ERROR TestWritesAValueBackThatIsDifferentButValidForMinSetpointDeadBandAttribute_70() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49082,11 +49006,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { @"attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -49095,7 +49014,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinSetpointDeadBandAttribute_52() + CHIP_ERROR TestReadsItBackAgainToConfirmTheSuccessfulWriteOfMinSetpointDeadBandAttribute_71() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49106,11 +49025,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { [cluster readAttributeMinSetpointDeadBandWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"Reads it back again to confirm the successful write of MinSetpointDeadBand attribute Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { @@ -49124,7 +49038,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheValueBelowMinSetpointDeadBand_53() + CHIP_ERROR TestWritesTheValueBelowMinSetpointDeadBand_72() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49138,11 +49052,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { completionHandler:^(NSError * _Nullable err) { NSLog(@"Writes the value below MinSetpointDeadBand Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn( CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -49151,7 +49060,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheValueAboveMinSetpointDeadBand_54() + CHIP_ERROR TestWritesTheValueAboveMinSetpointDeadBand_73() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49165,11 +49074,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { completionHandler:^(NSError * _Nullable err) { NSLog(@"Writes the value above MinSetpointDeadBand Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn( CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); @@ -49178,7 +49082,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheMinLimitOfMinSetpointDeadBand_55() + CHIP_ERROR TestWritesTheMinLimitOfMinSetpointDeadBand_74() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49192,11 +49096,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { completionHandler:^(NSError * _Nullable err) { NSLog(@"Writes the min limit of MinSetpointDeadBand Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -49205,7 +49104,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWritesTheMaxLimitOfMinSetpointDeadBand_56() + CHIP_ERROR TestWritesTheMaxLimitOfMinSetpointDeadBand_75() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49219,11 +49118,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { completionHandler:^(NSError * _Nullable err) { NSLog(@"Writes the max limit of MinSetpointDeadBand Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -49232,7 +49126,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_57() + CHIP_ERROR TestReadsControlSequenceOfOperationFromServerDutAndVerifiesThatTheValueIsValid_76() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49261,7 +49155,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_58() + CHIP_ERROR TestWriteAttributeCommandForControlSequenceOfOperationWithANewValidValue_77() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49285,7 +49179,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadItBackAgainToConfirmTheSuccessfulWrite_59() + CHIP_ERROR TestReadItBackAgainToConfirmTheSuccessfulWrite_78() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49310,7 +49204,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsSetpointRaiseCommand_60() + CHIP_ERROR TestWritesMaxHeatSetpointLimitAttributeToDefaultValueOf2950ToMeetDeadbandConstraint_79() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49318,22 +49212,23 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRThermostatClusterSetpointRaiseLowerParams alloc] init]; - params.mode = [NSNumber numberWithUnsignedChar:0U]; - params.amount = [NSNumber numberWithChar:-30]; - [cluster setpointRaiseLowerWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends SetpointRaise Command Error: %@", err); + id maxHeatSetpointLimitArgument; + maxHeatSetpointLimitArgument = [NSNumber numberWithShort:2950]; + [cluster writeAttributeMaxHeatSetpointLimitWithValue:maxHeatSetpointLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Writes MaxHeatSetpointLimit attribute to default value of 2950 to meet " + @"deadband constraint Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_61() + CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_80() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49341,28 +49236,43 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back OccupiedHeatingSetpoint to confirm the success of the write Error: %@", err); + id occupiedCoolingSetpointArgument; + occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; + [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + NextTest(); + }]; - { - id actualValue = value; - VerifyOrReturn(CheckValue("OccupiedHeatingSetpoint", actualValue, -30)); - } + return CHIP_NO_ERROR; + } - NextTest(); - }]; + CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_81() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsSetpointRaiseCommand_62() + CHIP_ERROR TestSendsSetpointRaiseCommandHeatOnly_82() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49372,10 +49282,10 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { __auto_type * params = [[MTRThermostatClusterSetpointRaiseLowerParams alloc] init]; params.mode = [NSNumber numberWithUnsignedChar:0U]; - params.amount = [NSNumber numberWithChar:30]; + params.amount = [NSNumber numberWithChar:-30]; [cluster setpointRaiseLowerWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends SetpointRaise Command Error: %@", err); + NSLog(@"Sends SetpointRaise Command Heat Only Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -49385,7 +49295,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_63() + CHIP_ERROR TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_83() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49396,16 +49306,11 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"Reads back OccupiedHeatingSetpoint to confirm the success of the write Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OccupiedHeatingSetpoint", actualValue, 30)); + VerifyOrReturn(CheckValue("OccupiedHeatingSetpoint", actualValue, 1700)); } NextTest(); @@ -49414,7 +49319,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_64() + CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_84() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49422,16 +49327,11 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id occupiedCoolingSetpointArgument; - occupiedCoolingSetpointArgument = [NSNumber numberWithShort:2600]; - [cluster writeAttributeOccupiedCoolingSetpointWithValue:occupiedCoolingSetpointArgument + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -49441,7 +49341,54 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsSetpointRaiseCommand_65() + CHIP_ERROR TestSendsSetpointRaiseCommandHeatOnly_85() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRThermostatClusterSetpointRaiseLowerParams alloc] init]; + params.mode = [NSNumber numberWithUnsignedChar:0U]; + params.amount = [NSNumber numberWithChar:30]; + [cluster setpointRaiseLowerWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sends SetpointRaise Command Heat Only Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_86() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads back OccupiedHeatingSetpoint to confirm the success of the write Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OccupiedHeatingSetpoint", actualValue, 2300)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendsSetpointRaiseCommandCoolOnly_87() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49454,7 +49401,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { params.amount = [NSNumber numberWithChar:-30]; [cluster setpointRaiseLowerWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends SetpointRaise Command Error: %@", err); + NSLog(@"Sends SetpointRaise Command Cool Only Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -49464,7 +49411,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackOccupiedCoolingSetpointToConfirmTheSuccessOfTheWrite_66() + CHIP_ERROR TestReadsBackOccupiedCoolingSetpointToConfirmTheSuccessOfTheWrite_88() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49475,16 +49422,11 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { [cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"Reads back OccupiedCoolingSetpoint to confirm the success of the write Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OccupiedCoolingSetpoint", actualValue, -30)); + VerifyOrReturn(CheckValue("OccupiedCoolingSetpoint", actualValue, 2300)); } NextTest(); @@ -49493,7 +49435,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_67() + CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_89() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49507,11 +49449,6 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { completionHandler:^(NSError * _Nullable err) { NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); NextTest(); @@ -49520,7 +49457,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsSetpointRaiseCommand_68() + CHIP_ERROR TestSendsSetpointRaiseCommandCoolOnly_90() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49533,7 +49470,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { params.amount = [NSNumber numberWithChar:30]; [cluster setpointRaiseLowerWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends SetpointRaise Command Error: %@", err); + NSLog(@"Sends SetpointRaise Command Cool Only Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -49543,7 +49480,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackOccupiedCoolingSetpointToConfirmTheSuccessOfTheWrite_69() + CHIP_ERROR TestReadsBackOccupiedCoolingSetpointToConfirmTheSuccessOfTheWrite_91() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49554,16 +49491,11 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { [cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"Reads back OccupiedCoolingSetpoint to confirm the success of the write Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OccupiedCoolingSetpoint", actualValue, 30)); + VerifyOrReturn(CheckValue("OccupiedCoolingSetpoint", actualValue, 2900)); } NextTest(); @@ -49572,7 +49504,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_70() + CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_92() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49586,10 +49518,27 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { completionHandler:^(NSError * _Nullable err) { NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_93() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -49599,7 +49548,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsSetpointRaiseCommand_71() + CHIP_ERROR TestSendsSetpointRaiseCommandHeatCool_94() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49612,7 +49561,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { params.amount = [NSNumber numberWithChar:-30]; [cluster setpointRaiseLowerWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends SetpointRaise Command Error: %@", err); + NSLog(@"Sends SetpointRaise Command Heat & Cool Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -49622,7 +49571,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackOccupiedCoolingSetpointToConfirmTheSuccessOfTheWrite_72() + CHIP_ERROR TestReadsBackOccupiedCoolingSetpointToConfirmTheSuccessOfTheWrite_95() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49633,16 +49582,11 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { [cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"Reads back OccupiedCoolingSetpoint to confirm the success of the write Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OccupiedCoolingSetpoint", actualValue, -30)); + VerifyOrReturn(CheckValue("OccupiedCoolingSetpoint", actualValue, 2300)); } NextTest(); @@ -49651,7 +49595,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_73() + CHIP_ERROR TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_96() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49662,16 +49606,11 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"Reads back OccupiedHeatingSetpoint to confirm the success of the write Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OccupiedHeatingSetpoint", actualValue, -30)); + VerifyOrReturn(CheckValue("OccupiedHeatingSetpoint", actualValue, 1700)); } NextTest(); @@ -49680,7 +49619,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_74() + CHIP_ERROR TestSetsOccupiedCoolingSetpointToDefaultValue_97() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49694,10 +49633,27 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { completionHandler:^(NSError * _Nullable err) { NSLog(@"Sets OccupiedCoolingSetpoint to default value Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSetsOccupiedHeatingSetpointToDefaultValue_98() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id occupiedHeatingSetpointArgument; + occupiedHeatingSetpointArgument = [NSNumber numberWithShort:2000]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:occupiedHeatingSetpointArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sets OccupiedHeatingSetpoint to default value Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -49707,7 +49663,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsSetpointRaiseCommand_75() + CHIP_ERROR TestSendsSetpointRaiseCommandHeatCool_99() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49720,7 +49676,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { params.amount = [NSNumber numberWithChar:30]; [cluster setpointRaiseLowerWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Sends SetpointRaise Command Error: %@", err); + NSLog(@"Sends SetpointRaise Command Heat & Cool Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -49730,7 +49686,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackOccupiedCoolingSetpointToConfirmTheSuccessOfTheWrite_76() + CHIP_ERROR TestReadsBackOccupiedCoolingSetpointToConfirmTheSuccessOfTheWrite_100() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49741,16 +49697,11 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { [cluster readAttributeOccupiedCoolingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"Reads back OccupiedCoolingSetpoint to confirm the success of the write Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OccupiedCoolingSetpoint", actualValue, 30)); + VerifyOrReturn(CheckValue("OccupiedCoolingSetpoint", actualValue, 2900)); } NextTest(); @@ -49759,7 +49710,7 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_77() + CHIP_ERROR TestReadsBackOccupiedHeatingSetpointToConfirmTheSuccessOfTheWrite_101() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterThermostat * cluster = [[MTRBaseClusterThermostat alloc] initWithDevice:device @@ -49770,16 +49721,11 @@ class Test_TC_TSTAT_2_2 : public TestCommandBridge { [cluster readAttributeOccupiedHeatingSetpointWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { NSLog(@"Reads back OccupiedHeatingSetpoint to confirm the success of the write Error: %@", err); - if (err.code == MTRInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("OccupiedHeatingSetpoint", actualValue, 30)); + VerifyOrReturn(CheckValue("OccupiedHeatingSetpoint", actualValue, 2300)); } NextTest(); @@ -51901,10 +51847,10 @@ class Test_TC_ULABEL_2_3 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; } @@ -51952,7 +51898,7 @@ class Test_TC_ULABEL_2_3 : public TestCommandBridge { completionHandler:^(NSError * _Nullable err) { NSLog(@"TH writes LabelList attribute of the DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); }]; @@ -51978,7 +51924,7 @@ class Test_TC_ULABEL_2_3 : public TestCommandBridge { completionHandler:^(NSError * _Nullable err) { NSLog(@"TH reads LabelList attribute of the DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); }]; @@ -54398,15 +54344,6 @@ class Test_TC_WNCV_2_2 : public TestCommandBridge { } err = TestReadsConfigStatusAttributeFromDutIfPaLfValueOfBit3MustBe1bElse0bIfPaTlValueOfBit4MustBe1bElse0b_1(); break; - case 2: - ChipLogProgress( - chipTool, " ***** Test Step 2 : Reads ConfigStatus attribute from DUT, value of bit 0 must be 1b operational\n"); - if (ShouldSkip("PICS_USER_PROMPT && WNCV.S.A0007 && WNCV.S.F01 && WNCV.S.F04")) { - NextTest(); - return; - } - err = TestReadsConfigStatusAttributeFromDutValueOfBit0MustBe1bOperational_2(); - break; } if (CHIP_NO_ERROR != err) { @@ -54424,9 +54361,6 @@ class Test_TC_WNCV_2_2 : public TestCommandBridge { case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -54440,7 +54374,7 @@ class Test_TC_WNCV_2_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 2; chip::Optional mNodeId; chip::Optional mCluster; @@ -54462,15 +54396,6 @@ class Test_TC_WNCV_2_2 : public TestCommandBridge { value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); } - - CHIP_ERROR TestReadsConfigStatusAttributeFromDutValueOfBit0MustBe1bOperational_2() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } }; class Test_TC_WNCV_2_3 : public TestCommandBridge { @@ -85651,6 +85576,311 @@ class TestBasicInformation : public TestCommandBridge { } }; +class TestFabricRemovalWhileSubscribed : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + TestFabricRemovalWhileSubscribed() + : TestCommandBridge("TestFabricRemovalWhileSubscribed") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("payload", &mPayload); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~TestFabricRemovalWhileSubscribed() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: TestFabricRemovalWhileSubscribed\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: TestFabricRemovalWhileSubscribed\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 number of commissioned fabrics\n"); + err = TestReadNumberOfCommissionedFabrics_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read current fabric index\n"); + err = TestReadCurrentFabricIndex_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Open commissioning window from alpha\n"); + err = TestOpenCommissioningWindowFromAlpha_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Commission from beta\n"); + err = TestCommissionFromBeta_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait for the commissioned device to be retrieved for beta\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrievedForBeta_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Report: Subscribe Fabrics Attribute from beta\n"); + err = TestReportSubscribeFabricsAttributeFromBeta_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Subscribe Fabrics Attribute from beta\n"); + err = TestSubscribeFabricsAttributeFromBeta_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Remove single own fabric\n"); + err = TestRemoveSingleOwnFabric_8(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 9; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mPayload; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadNumberOfCommissionedFabrics_1() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOperationalCredentials * cluster = + [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCommissionedFabricsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read number of commissioned fabrics Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CommissionedFabrics", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull ourFabricIndex; + + CHIP_ERROR TestReadCurrentFabricIndex_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOperationalCredentials * cluster = + [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentFabricIndexWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current fabric index Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("currentFabricIndex", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("currentFabricIndex", [value unsignedCharValue], 1U)); + { + ourFabricIndex = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOpenCommissioningWindowFromAlpha_3() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterAdministratorCommissioning * cluster = + [[MTRBaseClusterAdministratorCommissioning alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRAdministratorCommissioningClusterOpenBasicCommissioningWindowParams alloc] init]; + params.commissioningTimeout = [NSNumber numberWithUnsignedShort:180U]; + [cluster openBasicCommissioningWindowWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Open commissioning window from alpha Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCommissionFromBeta_4() + { + chip::app::Clusters::CommissionerCommands::Commands::PairWithCode::Type value; + value.nodeId = 74565ULL; + value.payload = mPayload.HasValue() ? mPayload.Value() : chip::Span("MT:-24J0AFN00KA0648G00", 22); + return PairWithCode("beta", value); + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrievedForBeta_5() + { + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = 74565ULL; + return WaitForCommissionee("beta", value); + } + bool testSendClusterTestFabricRemovalWhileSubscribed_6_WaitForReport_Fulfilled = false; + ResponseHandler _Nullable test_TestFabricRemovalWhileSubscribed_Fabrics_Reported = nil; + + CHIP_ERROR TestReportSubscribeFabricsAttributeFromBeta_6() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOperationalCredentials * cluster = + [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + test_TestFabricRemovalWhileSubscribed_Fabrics_Reported = ^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Report: Subscribe Fabrics Attribute from beta Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("fabrics", "", "list")); + testSendClusterTestFabricRemovalWhileSubscribed_6_WaitForReport_Fulfilled = true; + }; + + NextTest(); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSubscribeFabricsAttributeFromBeta_7() + { + MTRBaseDevice * device = GetDevice("beta"); + MTRBaseClusterOperationalCredentials * cluster = + [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + uint16_t minIntervalArgument = 2U; + uint16_t maxIntervalArgument = 5U; + MTRSubscribeParams * params = [[MTRSubscribeParams alloc] init]; + [cluster subscribeAttributeFabricsWithMinInterval:[NSNumber numberWithUnsignedInt:minIntervalArgument] + maxInterval:[NSNumber numberWithUnsignedInt:maxIntervalArgument] + params:params + subscriptionEstablished:^{ + VerifyOrReturn(testSendClusterTestFabricRemovalWhileSubscribed_6_WaitForReport_Fulfilled, + SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); + NextTest(); + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Subscribe Fabrics Attribute from beta Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + if (test_TestFabricRemovalWhileSubscribed_Fabrics_Reported != nil) { + ResponseHandler callback = test_TestFabricRemovalWhileSubscribed_Fabrics_Reported; + test_TestFabricRemovalWhileSubscribed_Fabrics_Reported = nil; + callback(value, err); + } + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestRemoveSingleOwnFabric_8() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterOperationalCredentials * cluster = + [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTROperationalCredentialsClusterRemoveFabricParams alloc] init]; + params.fabricIndex = [ourFabricIndex copy]; + [cluster removeFabricWithParams:params + completionHandler:^( + MTROperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Remove single own fabric Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class TestGeneralCommissioning : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -89305,10 +89535,10 @@ class TestUserLabelClusterConstraints : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); break; } @@ -89356,7 +89586,7 @@ class TestUserLabelClusterConstraints : public TestCommandBridge { completionHandler:^(NSError * _Nullable err) { NSLog(@"Attempt to write overly long item for label Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); }]; @@ -89382,7 +89612,7 @@ class TestUserLabelClusterConstraints : public TestCommandBridge { completionHandler:^(NSError * _Nullable err) { NSLog(@"Attempt to write overly long item for value Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); }]; @@ -103698,127 +103928,163 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Create new user\n"); + err = TestCreateNewUser_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the user back and verify its fields\n"); + err = TestReadTheUserBackAndVerifyItsFields_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Create new PIN credential and lock/unlock user\n"); + err = TestCreateNewPinCredentialAndLockUnlockUser_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Verify created PIN credential\n"); + err = TestVerifyCreatedPinCredential_4(); + break; + case 5: ChipLogProgress( - chipTool, " ***** Test Step 1 : TH writes the RequirePINforRemoteOperation attribute value as False on the DUT\n"); + chipTool, " ***** Test Step 5 : TH writes the RequirePINforRemoteOperation attribute value as False on the DUT\n"); if (ShouldSkip("DRLK.S.A0033")) { NextTest(); return; } - err = TestThWritesTheRequirePINforRemoteOperationAttributeValueAsFalseOnTheDut_1(); + err = TestThWritesTheRequirePINforRemoteOperationAttributeValueAsFalseOnTheDut_5(); break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH sends Lock Door Command to the DUT without PINCode\n"); + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH sends Lock Door Command to the DUT without PINCode\n"); if (ShouldSkip("DRLK.S.C00.Rsp")) { NextTest(); return; } - err = TestThSendsLockDoorCommandToTheDutWithoutPINCode_2(); + err = TestThSendsLockDoorCommandToTheDutWithoutPINCode_6(); break; - case 3: + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH sends Lock Door Command to the DUT with valid PINCode\n"); + if (ShouldSkip("DRLK.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsLockDoorCommandToTheDutWithValidPINCode_7(); + break; + case 8: ChipLogProgress( - chipTool, " ***** Test Step 3 : TH writes the RequirePINforRemoteOperation attribute value as True on the DUT\n"); + chipTool, " ***** Test Step 8 : TH writes the RequirePINforRemoteOperation attribute value as True on the DUT\n"); if (ShouldSkip("DRLK.S.A0033")) { NextTest(); return; } - err = TestThWritesTheRequirePINforRemoteOperationAttributeValueAsTrueOnTheDut_3(); + err = TestThWritesTheRequirePINforRemoteOperationAttributeValueAsTrueOnTheDut_8(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Create new PIN credential and lock/unlock user\n"); - if (ShouldSkip("DRLK.S.C22.Rsp")) { + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads the RequirePINforRemoteOperation attribute from the DUT\n"); + if (ShouldSkip("DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033")) { NextTest(); return; } - err = TestCreateNewPinCredentialAndLockUnlockUser_4(); + err = TestThReadsTheRequirePINforRemoteOperationAttributeFromTheDut_9(); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH sends Lock Door Command to the DUT with valid PINCode\n"); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH sends Lock Door Command to the DUT with valid PINCode\n"); if (ShouldSkip("DRLK.S.C00.Rsp")) { NextTest(); return; } - err = TestThSendsLockDoorCommandToTheDutWithValidPINCode_5(); + err = TestThSendsLockDoorCommandToTheDutWithValidPINCode_10(); break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : TH sends Lock Door Command to the DUT without any argument PINCode\n"); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH sends Lock Door Command to the DUT without valid PINCode\n"); if (ShouldSkip("DRLK.S.C00.Rsp")) { NextTest(); return; } - err = TestThSendsLockDoorCommandToTheDutWithoutAnyArgumentPINCode_6(); + err = TestThSendsLockDoorCommandToTheDutWithoutValidPINCode_11(); break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH writes WrongCodeEntryLimit attribute value as 3 on the DUT\n"); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : TH sends Lock Door Command to the DUT without any argument PINCode\n"); + if (ShouldSkip("DRLK.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsLockDoorCommandToTheDutWithoutAnyArgumentPINCode_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH writes WrongCodeEntryLimit attribute value as 3 on the DUT\n"); if (ShouldSkip("DRLK.S.A0030")) { NextTest(); return; } - err = TestThWritesWrongCodeEntryLimitAttributeValueAs3OnTheDut_7(); + err = TestThWritesWrongCodeEntryLimitAttributeValueAs3OnTheDut_13(); break; - case 8: + case 14: ChipLogProgress( - chipTool, " ***** Test Step 8 : TH writes UserCodeTemporaryDisableTime attribute value as 5 seconds on the DUT\n"); + chipTool, " ***** Test Step 14 : TH writes UserCodeTemporaryDisableTime attribute value as 5 seconds on the DUT\n"); if (ShouldSkip("DRLK.S.A0031")) { NextTest(); return; } - err = TestThWritesUserCodeTemporaryDisableTimeAttributeValueAs5SecondsOnTheDut_8(); + err = TestThWritesUserCodeTemporaryDisableTimeAttributeValueAs5SecondsOnTheDut_14(); break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); if (ShouldSkip("DRLK.S.C00.Rsp")) { NextTest(); return; } - err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_9(); + err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_15(); break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); if (ShouldSkip("DRLK.S.C00.Rsp")) { NextTest(); return; } - err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_10(); + err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_16(); break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); if (ShouldSkip("DRLK.S.C00.Rsp")) { NextTest(); return; } - err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_11(); + err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_17(); break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); if (ShouldSkip("DRLK.S.C00.Rsp")) { NextTest(); return; } - err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_12(); + err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_18(); break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads UserCodeTemporaryDisableTime attribute from DUT\n"); + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : TH reads UserCodeTemporaryDisableTime attribute from DUT\n"); if (ShouldSkip("DRLK.S.A0031")) { NextTest(); return; } - err = TestThReadsUserCodeTemporaryDisableTimeAttributeFromDut_13(); + err = TestThReadsUserCodeTemporaryDisableTimeAttributeFromDut_19(); break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : TH sends Lock Door Command to the DUT with valid PINCode\n"); + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : TH sends Lock Door Command to the DUT with valid PINCode\n"); if (ShouldSkip("DRLK.S.C00.Rsp")) { NextTest(); return; } - err = TestThSendsLockDoorCommandToTheDutWithValidPINCode_14(); + err = TestThSendsLockDoorCommandToTheDutWithValidPINCode_20(); break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Clean the created credential\n"); + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Clean the created user\n"); + err = TestCleanTheCreatedUser_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Cleanup the created credential\n"); if (ShouldSkip("DRLK.S.C26.Rsp")) { NextTest(); return; } - err = TestCleanTheCreatedCredential_15(); + err = TestCleanupTheCreatedCredential_22(); break; } @@ -103838,7 +104104,7 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -103850,7 +104116,7 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -103859,10 +104125,10 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); @@ -103877,6 +104143,27 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; } @@ -103892,7 +104179,7 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 16; + const uint16_t mTestCount = 23; chip::Optional mNodeId; chip::Optional mCluster; @@ -103906,7 +104193,207 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThWritesTheRequirePINforRemoteOperationAttributeValueAsFalseOnTheDut_1() + CHIP_ERROR TestCreateNewUser_1() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetUserParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.userName = @"xxx"; + params.userUniqueId = [NSNumber numberWithUnsignedInt:6452UL]; + params.userStatus = [NSNumber numberWithUnsignedChar:1U]; + params.userType = [NSNumber numberWithUnsignedChar:0U]; + params.credentialRule = [NSNumber numberWithUnsignedChar:0U]; + [cluster setUserWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create new user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheUserBackAndVerifyItsFields_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getUserWithParams:params + completionHandler:^(MTRDoorLockClusterGetUserResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Read the user back and verify its fields Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.userName; + VerifyOrReturn(CheckValueNonNull("userName", actualValue)); + VerifyOrReturn(CheckValueAsString("userName", actualValue, @"xxx")); + } + + { + id actualValue = values.userUniqueId; + VerifyOrReturn(CheckValueNonNull("userUniqueId", actualValue)); + VerifyOrReturn(CheckValue("userUniqueId", actualValue, 6452UL)); + } + + { + id actualValue = values.userStatus; + VerifyOrReturn(CheckValueNonNull("userStatus", actualValue)); + VerifyOrReturn(CheckValue("userStatus", actualValue, 1U)); + } + + { + id actualValue = values.userType; + VerifyOrReturn(CheckValueNonNull("userType", actualValue)); + VerifyOrReturn(CheckValue("userType", actualValue, 0U)); + } + + { + id actualValue = values.credentialRule; + VerifyOrReturn(CheckValueNonNull("credentialRule", actualValue)); + VerifyOrReturn(CheckValue("credentialRule", actualValue, 0U)); + } + + { + id actualValue = values.credentials; + VerifyOrReturn(CheckValueNull("credentials", actualValue)); + } + + { + id actualValue = values.creatorFabricIndex; + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("creatorFabricIndex", actualValue, 1U)); + } + + { + id actualValue = values.lastModifiedFabricIndex; + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextUserIndex; + VerifyOrReturn(CheckValueNull("nextUserIndex", actualValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_3() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0U]; + params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; + ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; + ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.userStatus = [NSNumber numberWithUnsignedChar:0U]; + params.userType = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setCredentialWithParams:params + completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNull("userIndex", actualValue)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyCreatedPinCredential_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetCredentialStatusParams alloc] init]; + params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; + ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; + ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + [cluster getCredentialStatusWithParams:params + completionHandler:^( + MTRDoorLockClusterGetCredentialStatusResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Verify created PIN credential Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.credentialExists; + VerifyOrReturn(CheckValue("credentialExists", actualValue, true)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.creatorFabricIndex; + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("creatorFabricIndex", actualValue, 1U)); + } + + { + id actualValue = values.lastModifiedFabricIndex; + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNull("nextCredentialIndex", actualValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesTheRequirePINforRemoteOperationAttributeValueAsFalseOnTheDut_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -103928,26 +104415,46 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithoutPINCode_2() + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithoutPINCode_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterLockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"" length:0]; [cluster lockDoorWithParams:params completionHandler:^(NSError * _Nullable err) { NSLog(@"TH sends Lock Door Command to the DUT without PINCode Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThWritesTheRequirePINforRemoteOperationAttributeValueAsTrueOnTheDut_3() + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithValidPINCode_7() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT with valid PINCode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesTheRequirePINforRemoteOperationAttributeValueAsTrueOnTheDut_8() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -103969,53 +104476,30 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_4() + CHIP_ERROR TestThReadsTheRequirePINforRemoteOperationAttributeFromTheDut_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; - params.operationType = [NSNumber numberWithUnsignedChar:0U]; - params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - - params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; - params.userIndex = nil; - params.userStatus = nil; - params.userType = nil; [cluster - setCredentialWithParams:params - completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); + readAttributeRequirePINforRemoteOperationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the RequirePINforRemoteOperation attribute from the DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.nextCredentialIndex; - VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); - VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("RequirePINforRemoteOperation", actualValue, true)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithValidPINCode_5() + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithValidPINCode_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -104035,7 +104519,26 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithoutAnyArgumentPINCode_6() + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithoutValidPINCode_11() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"645321" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT without valid PINCode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithoutAnyArgumentPINCode_12() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -104054,7 +104557,7 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThWritesWrongCodeEntryLimitAttributeValueAs3OnTheDut_7() + CHIP_ERROR TestThWritesWrongCodeEntryLimitAttributeValueAs3OnTheDut_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -104075,14 +104578,14 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThWritesUserCodeTemporaryDisableTimeAttributeValueAs5SecondsOnTheDut_8() + CHIP_ERROR TestThWritesUserCodeTemporaryDisableTimeAttributeValueAs5SecondsOnTheDut_14() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); id userCodeTemporaryDisableTimeArgument; - userCodeTemporaryDisableTimeArgument = [NSNumber numberWithUnsignedChar:5U]; + userCodeTemporaryDisableTimeArgument = [NSNumber numberWithUnsignedChar:15U]; [cluster writeAttributeUserCodeTemporaryDisableTimeWithValue:userCodeTemporaryDisableTimeArgument completionHandler:^(NSError * _Nullable err) { NSLog(@"TH writes UserCodeTemporaryDisableTime attribute value as 5 seconds " @@ -104097,7 +104600,7 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_9() + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_15() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -104116,7 +104619,7 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_10() + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -104135,7 +104638,7 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_11() + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_17() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -104154,7 +104657,7 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_12() + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_18() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -104173,7 +104676,7 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsUserCodeTemporaryDisableTimeAttributeFromDut_13() + CHIP_ERROR TestThReadsUserCodeTemporaryDisableTimeAttributeFromDut_19() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -104187,7 +104690,7 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("UserCodeTemporaryDisableTime", actualValue, 5U)); + VerifyOrReturn(CheckValue("UserCodeTemporaryDisableTime", actualValue, 15U)); } NextTest(); @@ -104196,7 +104699,7 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithValidPINCode_14() + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithValidPINCode_20() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -104216,7 +104719,27 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCleanTheCreatedCredential_15() + CHIP_ERROR TestCleanTheCreatedUser_21() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterClearUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster clearUserWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clean the created user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCleanupTheCreatedCredential_22() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -104229,7 +104752,7 @@ class Test_TC_DRLK_2_2 : public TestCommandBridge { [cluster clearCredentialWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clean the created credential Error: %@", err); + NSLog(@"Cleanup the created credential Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -104283,64 +104806,68 @@ class Test_TC_DRLK_2_3 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Create new PIN credential and lock/unlock user\n"); - if (ShouldSkip("DRLK.S.C22.Rsp")) { - NextTest(); - return; - } - err = TestCreateNewPinCredentialAndLockUnlockUser_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Create new user\n"); + err = TestCreateNewUser_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Precondition: Door is in locked state\n"); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the user back and verify its fields\n"); + err = TestReadTheUserBackAndVerifyItsFields_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Create new PIN credential and lock/unlock user\n"); + err = TestCreateNewPinCredentialAndLockUnlockUser_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Verify created PIN credential\n"); + err = TestVerifyCreatedPinCredential_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Precondition: Door is in locked state\n"); if (ShouldSkip("DRLK.S.C00.Rsp")) { NextTest(); return; } - err = TestPreconditionDoorIsInLockedState_2(); + err = TestPreconditionDoorIsInLockedState_5(); break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes AutoRelockTime attribute value as 10 seconds on the DUT\n"); + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH writes AutoRelockTime attribute value as 10 seconds on the DUT\n"); if (ShouldSkip("DRLK.S.A0023")) { NextTest(); return; } - err = TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3(); + err = TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_6(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends the unlock Door command to the DUT with valid PINCode\n"); + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH sends the unlock Door command to the DUT with valid PINCode\n"); if (ShouldSkip("DRLK.S.C01.Rsp")) { NextTest(); return; } - err = TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_4(); + err = TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_7(); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads AutoRelockTime attribute from DUT\n"); - if (ShouldSkip("DRLK.S.A0023")) { - NextTest(); - return; - } - err = TestThReadsAutoRelockTimeAttributeFromDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 10000ms\n"); - err = TestWait10000ms_6(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 10000ms\n"); + err = TestWait10000ms_8(); break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads LockState attribute\n"); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads LockState attribute\n"); if (ShouldSkip("DRLK.S.A0000")) { NextTest(); return; } - err = TestThReadsLockStateAttribute_7(); + err = TestThReadsLockStateAttribute_9(); break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Clean the created credential\n"); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Cleanup the created user\n"); + err = TestCleanupTheCreatedUser_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Clean the created credential\n"); if (ShouldSkip("DRLK.S.C26.Rsp")) { NextTest(); return; } - err = TestCleanTheCreatedCredential_8(); + err = TestCleanTheCreatedCredential_11(); break; } @@ -104380,6 +104907,15 @@ class Test_TC_DRLK_2_3 : public TestCommandBridge { case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -104393,7 +104929,7 @@ class Test_TC_DRLK_2_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -104407,7 +104943,110 @@ class Test_TC_DRLK_2_3 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_1() + CHIP_ERROR TestCreateNewUser_1() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetUserParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.userName = @"xxx"; + params.userUniqueId = [NSNumber numberWithUnsignedInt:6452UL]; + params.userStatus = [NSNumber numberWithUnsignedChar:1U]; + params.userType = [NSNumber numberWithUnsignedChar:0U]; + params.credentialRule = [NSNumber numberWithUnsignedChar:0U]; + [cluster setUserWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create new user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheUserBackAndVerifyItsFields_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getUserWithParams:params + completionHandler:^(MTRDoorLockClusterGetUserResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Read the user back and verify its fields Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.userName; + VerifyOrReturn(CheckValueNonNull("userName", actualValue)); + VerifyOrReturn(CheckValueAsString("userName", actualValue, @"xxx")); + } + + { + id actualValue = values.userUniqueId; + VerifyOrReturn(CheckValueNonNull("userUniqueId", actualValue)); + VerifyOrReturn(CheckValue("userUniqueId", actualValue, 6452UL)); + } + + { + id actualValue = values.userStatus; + VerifyOrReturn(CheckValueNonNull("userStatus", actualValue)); + VerifyOrReturn(CheckValue("userStatus", actualValue, 1U)); + } + + { + id actualValue = values.userType; + VerifyOrReturn(CheckValueNonNull("userType", actualValue)); + VerifyOrReturn(CheckValue("userType", actualValue, 0U)); + } + + { + id actualValue = values.credentialRule; + VerifyOrReturn(CheckValueNonNull("credentialRule", actualValue)); + VerifyOrReturn(CheckValue("credentialRule", actualValue, 0U)); + } + + { + id actualValue = values.credentials; + VerifyOrReturn(CheckValueNull("credentials", actualValue)); + } + + { + id actualValue = values.creatorFabricIndex; + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("creatorFabricIndex", actualValue, 1U)); + } + + { + id actualValue = values.lastModifiedFabricIndex; + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextUserIndex; + VerifyOrReturn(CheckValueNull("nextUserIndex", actualValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -104420,9 +105059,9 @@ class Test_TC_DRLK_2_3 : public TestCommandBridge { ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; - params.userIndex = nil; - params.userStatus = nil; - params.userType = nil; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.userStatus = [NSNumber numberWithUnsignedChar:0U]; + params.userType = [NSNumber numberWithUnsignedChar:0U]; [cluster setCredentialWithParams:params completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { @@ -104437,8 +105076,7 @@ class Test_TC_DRLK_2_3 : public TestCommandBridge { { id actualValue = values.userIndex; - VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + VerifyOrReturn(CheckValueNull("userIndex", actualValue)); } { @@ -104453,7 +105091,59 @@ class Test_TC_DRLK_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestPreconditionDoorIsInLockedState_2() + CHIP_ERROR TestVerifyCreatedPinCredential_4() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetCredentialStatusParams alloc] init]; + params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; + ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; + ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + [cluster getCredentialStatusWithParams:params + completionHandler:^( + MTRDoorLockClusterGetCredentialStatusResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Verify created PIN credential Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.credentialExists; + VerifyOrReturn(CheckValue("credentialExists", actualValue, true)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.creatorFabricIndex; + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("creatorFabricIndex", actualValue, 1U)); + } + + { + id actualValue = values.lastModifiedFabricIndex; + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNull("nextCredentialIndex", actualValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPreconditionDoorIsInLockedState_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -104473,14 +105163,14 @@ class Test_TC_DRLK_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3() + CHIP_ERROR TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); id autoRelockTimeArgument; - autoRelockTimeArgument = [NSNumber numberWithUnsignedInt:10UL]; + autoRelockTimeArgument = [NSNumber numberWithUnsignedInt:60UL]; [cluster writeAttributeAutoRelockTimeWithValue:autoRelockTimeArgument completionHandler:^(NSError * _Nullable err) { NSLog(@"TH writes AutoRelockTime attribute value as 10 seconds on the DUT Error: %@", err); @@ -104493,7 +105183,7 @@ class Test_TC_DRLK_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_4() + CHIP_ERROR TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -104513,20 +105203,28 @@ class Test_TC_DRLK_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsAutoRelockTimeAttributeFromDut_5() + CHIP_ERROR TestWait10000ms_8() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsLockStateAttribute_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAutoRelockTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads AutoRelockTime attribute from DUT Error: %@", err); + [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads LockState attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("AutoRelockTime", actualValue, 10UL)); + VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); + VerifyOrReturn(CheckValue("LockState", actualValue, 2U)); } NextTest(); @@ -104535,37 +105233,27 @@ class Test_TC_DRLK_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10000ms_6() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsLockStateAttribute_7() + CHIP_ERROR TestCleanupTheCreatedUser_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads LockState attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[MTRDoorLockClusterClearUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster clearUserWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Cleanup the created user Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); - VerifyOrReturn(CheckValue("LockState", actualValue, 1U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCleanTheCreatedCredential_8() + CHIP_ERROR TestCleanTheCreatedCredential_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -104948,78 +105636,82 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Create new PIN credential and lock/unlock user\n"); - if (ShouldSkip("DRLK.S.C22.Rsp")) { - NextTest(); - return; - } - err = TestCreateNewPinCredentialAndLockUnlockUser_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Create new user\n"); + err = TestCreateNewUser_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Get Max number of Week Day schedules for user\n"); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the user back and verify its fields\n"); + err = TestReadTheUserBackAndVerifyItsFields_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Get Max number of Week Day schedules for user\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.A0014")) { NextTest(); return; } - err = TestGetMaxNumberOfWeekDaySchedulesForUser_2(); + err = TestGetMaxNumberOfWeekDaySchedulesForUser_3(); break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Get number of supported users\n"); + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Get number of supported users\n"); if (ShouldSkip("DRLK.S.F08 && DRLK.S.A0011")) { NextTest(); return; } - err = TestGetNumberOfSupportedUsers_3(); + err = TestGetNumberOfSupportedUsers_4(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Send Set Week Day Schedule Command to DUT\n"); + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Send Set Week Day Schedule Command to DUT\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0B.Rsp")) { NextTest(); return; } - err = TestSendSetWeekDayScheduleCommandToDut_4(); + err = TestSendSetWeekDayScheduleCommandToDut_5(); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : send GetWeekDay Schedule Command \n"); + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : send GetWeekDay Schedule Command \n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0C.Rsp && DRLK.S.C0C.Tx")) { NextTest(); return; } - err = TestSendGetWeekDayScheduleCommand_5(); + err = TestSendGetWeekDayScheduleCommand_6(); break; - case 6: + case 7: ChipLogProgress( - chipTool, " ***** Test Step 6 : Send Set Week Day Schedule Command to DUT and verify INVALID_COMMAND response\n"); + chipTool, " ***** Test Step 7 : Send Set Week Day Schedule Command to DUT and verify INVALID_COMMAND response\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0B.Rsp")) { NextTest(); return; } - err = TestSendSetWeekDayScheduleCommandToDutAndVerifyInvalidCommandResponse_6(); + err = TestSendSetWeekDayScheduleCommandToDutAndVerifyInvalidCommandResponse_7(); break; - case 7: + case 8: ChipLogProgress( - chipTool, " ***** Test Step 7 : send GetWeekDay Schedule Command to DUT and verify INVALID_COMMAND response\n"); + chipTool, " ***** Test Step 8 : send GetWeekDay Schedule Command to DUT and verify INVALID_COMMAND response\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0C.Rsp && DRLK.S.C0C.Tx")) { NextTest(); return; } - err = TestSendGetWeekDayScheduleCommandToDutAndVerifyInvalidCommandResponse_7(); + err = TestSendGetWeekDayScheduleCommandToDutAndVerifyInvalidCommandResponse_8(); break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Clear all week day schedules for the first user\n"); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Clear all week day schedules for the first user\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0D.Rsp")) { NextTest(); return; } - err = TestClearAllWeekDaySchedulesForTheFirstUser_8(); + err = TestClearAllWeekDaySchedulesForTheFirstUser_9(); break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : send GetWeekDay Schedule Command \n"); + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : send GetWeekDay Schedule Command \n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0C.Rsp && DRLK.S.C0C.Tx")) { NextTest(); return; } - err = TestSendGetWeekDayScheduleCommand_9(); + err = TestSendGetWeekDayScheduleCommand_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Cleanup the created user\n"); + err = TestCleanupTheCreatedUser_11(); break; } @@ -105051,10 +105743,10 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -105062,6 +105754,12 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -105075,7 +105773,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -105089,54 +105787,111 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_1() + CHIP_ERROR TestCreateNewUser_1() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; + __auto_type * params = [[MTRDoorLockClusterSetUserParams alloc] init]; params.operationType = [NSNumber numberWithUnsignedChar:0U]; - params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.userName = @"xxx"; + params.userUniqueId = [NSNumber numberWithUnsignedInt:6452UL]; + params.userStatus = [NSNumber numberWithUnsignedChar:1U]; + params.userType = [NSNumber numberWithUnsignedChar:0U]; + params.credentialRule = [NSNumber numberWithUnsignedChar:0U]; + [cluster setUserWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create new user Error: %@", err); - params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; - params.userIndex = nil; - params.userStatus = nil; - params.userType = nil; - [cluster - setCredentialWithParams:params - completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + NextTest(); + }]; - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + return CHIP_NO_ERROR; + } - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + CHIP_ERROR TestReadTheUserBackAndVerifyItsFields_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - { - id actualValue = values.nextCredentialIndex; - VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); - VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); - } + __auto_type * params = [[MTRDoorLockClusterGetUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getUserWithParams:params + completionHandler:^(MTRDoorLockClusterGetUserResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Read the user back and verify its fields Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.userName; + VerifyOrReturn(CheckValueNonNull("userName", actualValue)); + VerifyOrReturn(CheckValueAsString("userName", actualValue, @"xxx")); + } + + { + id actualValue = values.userUniqueId; + VerifyOrReturn(CheckValueNonNull("userUniqueId", actualValue)); + VerifyOrReturn(CheckValue("userUniqueId", actualValue, 6452UL)); + } + + { + id actualValue = values.userStatus; + VerifyOrReturn(CheckValueNonNull("userStatus", actualValue)); + VerifyOrReturn(CheckValue("userStatus", actualValue, 1U)); + } + + { + id actualValue = values.userType; + VerifyOrReturn(CheckValueNonNull("userType", actualValue)); + VerifyOrReturn(CheckValue("userType", actualValue, 0U)); + } + + { + id actualValue = values.credentialRule; + VerifyOrReturn(CheckValueNonNull("credentialRule", actualValue)); + VerifyOrReturn(CheckValue("credentialRule", actualValue, 0U)); + } + + { + id actualValue = values.credentials; + VerifyOrReturn(CheckValueNull("credentials", actualValue)); + } + + { + id actualValue = values.creatorFabricIndex; + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("creatorFabricIndex", actualValue, 1U)); + } + + { + id actualValue = values.lastModifiedFabricIndex; + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextUserIndex; + VerifyOrReturn(CheckValueNull("nextUserIndex", actualValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } NSNumber * _Nonnull NumberOfWeekDaySchedulesSupportedPerUser; - CHIP_ERROR TestGetMaxNumberOfWeekDaySchedulesForUser_2() + CHIP_ERROR TestGetMaxNumberOfWeekDaySchedulesForUser_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -105148,10 +105903,10 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("NumberOfWeekDaySchedulesSupportedPerUser", actualValue, 10U)); - } + VerifyOrReturn( + CheckConstraintMinValue("numberOfWeekDaySchedulesSupportedPerUser", [value unsignedCharValue], 0U)); + VerifyOrReturn( + CheckConstraintMaxValue("numberOfWeekDaySchedulesSupportedPerUser", [value unsignedCharValue], 255U)); { NumberOfWeekDaySchedulesSupportedPerUser = value; } @@ -105163,33 +105918,31 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { } NSNumber * _Nonnull NumberOfTotalUsersSupported; - CHIP_ERROR TestGetNumberOfSupportedUsers_3() + CHIP_ERROR TestGetNumberOfSupportedUsers_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNumberOfTotalUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Get number of supported users Error: %@", err); + [cluster readAttributeNumberOfTotalUsersSupportedWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Get number of supported users Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("NumberOfTotalUsersSupported", actualValue, 10U)); - } - { - NumberOfTotalUsersSupported = value; - } + VerifyOrReturn(CheckConstraintMinValue("numberOfTotalUsersSupported", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("numberOfTotalUsersSupported", [value unsignedShortValue], 65534U)); + { + NumberOfTotalUsersSupported = value; + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendSetWeekDayScheduleCommandToDut_4() + CHIP_ERROR TestSendSetWeekDayScheduleCommandToDut_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -105215,7 +105968,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendGetWeekDayScheduleCommand_5() + CHIP_ERROR TestSendGetWeekDayScheduleCommand_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -105234,9 +105987,13 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { VerifyOrReturn( CheckConstraintMinValue("weekDayIndex", [values.weekDayIndex unsignedCharValue], 1U)); + VerifyOrReturn(CheckConstraintMaxValue( + "weekDayIndex", [values.weekDayIndex unsignedCharValue], NumberOfWeekDaySchedulesSupportedPerUser)); VerifyOrReturn( CheckConstraintMinValue("userIndex", [values.userIndex unsignedShortValue], 1U)); + VerifyOrReturn(CheckConstraintMaxValue( + "userIndex", [values.userIndex unsignedShortValue], NumberOfTotalUsersSupported)); { id actualValue = values.status; @@ -105292,7 +106049,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendSetWeekDayScheduleCommandToDutAndVerifyInvalidCommandResponse_6() + CHIP_ERROR TestSendSetWeekDayScheduleCommandToDutAndVerifyInvalidCommandResponse_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -105318,7 +106075,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendGetWeekDayScheduleCommandToDutAndVerifyInvalidCommandResponse_7() + CHIP_ERROR TestSendGetWeekDayScheduleCommandToDutAndVerifyInvalidCommandResponse_8() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -105376,14 +106133,14 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearAllWeekDaySchedulesForTheFirstUser_8() + CHIP_ERROR TestClearAllWeekDaySchedulesForTheFirstUser_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:254U]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster clearWeekDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { @@ -105397,7 +106154,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendGetWeekDayScheduleCommand_9() + CHIP_ERROR TestSendGetWeekDayScheduleCommand_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -105453,6 +106210,26 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestCleanupTheCreatedUser_11() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterClearUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster clearUserWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Cleanup the created user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_DRLK_2_7 : public TestCommandBridge { @@ -105498,12 +106275,12 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Create new PIN credential and lock/unlock user\n"); - err = TestCreateNewPinCredentialAndLockUnlockUser_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Create new user\n"); + err = TestCreateNewUser_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Create new PIN credential and lock/unlock for second user\n"); - err = TestCreateNewPinCredentialAndLockUnlockForSecondUser_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the user back and verify its fields\n"); + err = TestReadTheUserBackAndVerifyItsFields_2(); break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Get Max number of year Day schedules for user\n"); @@ -105565,29 +106342,49 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { err = TestSendGetYearDayScheduleCommandToDutAndVerifyFailureResponse_9(); break; case 10: - ChipLogProgress( - chipTool, " ***** Test Step 10 : send Get Year Day Schedule Command to DUT and verify NOT_FOUND response \n"); - if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0F.Rsp && DRLK.S.C0F.Tx")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : Clear a year day schedule for the first user\n"); + if (ShouldSkip("DRLK.S.C10.Rsp")) { NextTest(); return; } - err = TestSendGetYearDayScheduleCommandToDutAndVerifyNotFoundResponse_10(); + err = TestClearAYearDayScheduleForTheFirstUser_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Send Set Year Day Schedule Command to DUT\n"); - if (ShouldSkip("DRLK.S.C0E.Rsp")) { + ChipLogProgress( + chipTool, " ***** Test Step 11 : send Get Year Day Schedule Command to DUT and verify NOT_FOUND response\n"); + if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0F.Rsp && DRLK.S.C0F.Tx && DRLK.S.C10.Rsp")) { NextTest(); return; } - err = TestSendSetYearDayScheduleCommandToDut_11(); + err = TestSendGetYearDayScheduleCommandToDutAndVerifyNotFoundResponse_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : send Get Year Day Schedule Command \n"); + ChipLogProgress(chipTool, " ***** Test Step 12 : Send Set Year Day Schedule Command to DUT \n"); + if (ShouldSkip("DRLK.S.C0E.Rsp")) { + NextTest(); + return; + } + err = TestSendSetYearDayScheduleCommandToDut_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : send Get Year Day Schedule Command\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0F.Rsp && DRLK.S.C0F.Tx")) { NextTest(); return; } - err = TestSendGetYearDayScheduleCommand_12(); + err = TestSendGetYearDayScheduleCommand_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Clear a year day schedule for the first user\n"); + if (ShouldSkip("DRLK.S.F04 && DRLK.S.C10.Rsp")) { + NextTest(); + return; + } + err = TestClearAYearDayScheduleForTheFirstUser_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Cleanup the created user\n"); + err = TestCleanupTheCreatedUser_15(); break; } @@ -105639,6 +106436,15 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -105652,7 +106458,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 13; + const uint16_t mTestCount = 16; chip::Optional mNodeId; chip::Optional mCluster; @@ -105666,94 +106472,105 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_1() + CHIP_ERROR TestCreateNewUser_1() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; + __auto_type * params = [[MTRDoorLockClusterSetUserParams alloc] init]; params.operationType = [NSNumber numberWithUnsignedChar:0U]; - params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - - params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; - params.userIndex = nil; - params.userStatus = nil; - params.userType = nil; - [cluster - setCredentialWithParams:params - completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.userName = @"xxx"; + params.userUniqueId = [NSNumber numberWithUnsignedInt:6452UL]; + params.userStatus = [NSNumber numberWithUnsignedChar:1U]; + params.userType = [NSNumber numberWithUnsignedChar:0U]; + params.credentialRule = [NSNumber numberWithUnsignedChar:0U]; + [cluster setUserWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create new user Error: %@", err); - { - id actualValue = values.nextCredentialIndex; - VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); - VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockForSecondUser_2() + CHIP_ERROR TestReadTheUserBackAndVerifyItsFields_2() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; - params.operationType = [NSNumber numberWithUnsignedChar:0U]; - params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:2U]; + __auto_type * params = [[MTRDoorLockClusterGetUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getUserWithParams:params + completionHandler:^(MTRDoorLockClusterGetUserResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Read the user back and verify its fields Error: %@", err); - params.credentialData = [[NSData alloc] initWithBytes:"123457" length:6]; - params.userIndex = nil; - params.userStatus = nil; - params.userType = nil; - [cluster - setCredentialWithParams:params - completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Create new PIN credential and lock/unlock for second user Error: %@", err); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } + { + id actualValue = values.userName; + VerifyOrReturn(CheckValueNonNull("userName", actualValue)); + VerifyOrReturn(CheckValueAsString("userName", actualValue, @"xxx")); + } - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); - VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); - } + { + id actualValue = values.userUniqueId; + VerifyOrReturn(CheckValueNonNull("userUniqueId", actualValue)); + VerifyOrReturn(CheckValue("userUniqueId", actualValue, 6452UL)); + } - { - id actualValue = values.nextCredentialIndex; - VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); - VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 3U)); - } + { + id actualValue = values.userStatus; + VerifyOrReturn(CheckValueNonNull("userStatus", actualValue)); + VerifyOrReturn(CheckValue("userStatus", actualValue, 1U)); + } - NextTest(); - }]; + { + id actualValue = values.userType; + VerifyOrReturn(CheckValueNonNull("userType", actualValue)); + VerifyOrReturn(CheckValue("userType", actualValue, 0U)); + } + + { + id actualValue = values.credentialRule; + VerifyOrReturn(CheckValueNonNull("credentialRule", actualValue)); + VerifyOrReturn(CheckValue("credentialRule", actualValue, 0U)); + } + + { + id actualValue = values.credentials; + VerifyOrReturn(CheckValueNull("credentials", actualValue)); + } + + { + id actualValue = values.creatorFabricIndex; + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("creatorFabricIndex", actualValue, 1U)); + } + + { + id actualValue = values.lastModifiedFabricIndex; + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextUserIndex; + VerifyOrReturn(CheckValueNull("nextUserIndex", actualValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -105771,10 +106588,10 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("NumberOfYearDaySchedulesSupportedPerUser", actualValue, 10U)); - } + VerifyOrReturn( + CheckConstraintMinValue("numberOfYearDaySchedulesSupportedPerUser", [value unsignedCharValue], 0U)); + VerifyOrReturn( + CheckConstraintMaxValue("numberOfYearDaySchedulesSupportedPerUser", [value unsignedCharValue], 255U)); { NumberOfYearDaySchedulesSupportedPerUser = value; } @@ -105792,22 +106609,20 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeNumberOfTotalUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Get number of supported users Error: %@", err); + [cluster readAttributeNumberOfTotalUsersSupportedWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Get number of supported users Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("NumberOfTotalUsersSupported", actualValue, 10U)); - } - { - NumberOfTotalUsersSupported = value; - } + VerifyOrReturn(CheckConstraintMinValue("numberOfTotalUsersSupported", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("numberOfTotalUsersSupported", [value unsignedShortValue], 65534U)); + { + NumberOfTotalUsersSupported = value; + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -105821,8 +106636,8 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:10UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:20UL]; + params.localStartTime = [NSNumber numberWithUnsignedInt:960UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:1980UL]; [cluster setYearDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { NSLog(@"Send Set Year Day Schedule Command to DUT Error: %@", err); @@ -105853,9 +106668,13 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { VerifyOrReturn( CheckConstraintMinValue("yearDayIndex", [values.yearDayIndex unsignedCharValue], 1U)); + VerifyOrReturn(CheckConstraintMaxValue("yearDayIndex", + [values.yearDayIndex unsignedCharValue], NumberOfYearDaySchedulesSupportedPerUser)); VerifyOrReturn( CheckConstraintMinValue("userIndex", [values.userIndex unsignedShortValue], 1U)); + VerifyOrReturn(CheckConstraintMaxValue( + "userIndex", [values.userIndex unsignedShortValue], NumberOfTotalUsersSupported)); { id actualValue = values.status; @@ -105888,9 +106707,9 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; params.yearDayIndex = [NSNumber numberWithUnsignedChar:0U]; - params.userIndex = [NSNumber numberWithUnsignedShort:10U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:30UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:10UL]; + params.userIndex = [NSNumber numberWithUnsignedShort:15U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:1020UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:2040UL]; [cluster setYearDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { @@ -105994,35 +106813,56 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendGetYearDayScheduleCommandToDutAndVerifyNotFoundResponse_10() + CHIP_ERROR TestClearAYearDayScheduleForTheFirstUser_10() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster clearYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear a year day schedule for the first user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendGetYearDayScheduleCommandToDutAndVerifyNotFoundResponse_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:2U]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster getYearDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"send Get Year Day Schedule Command to DUT and verify NOT_FOUND response Error: %@", err); + NSLog(@"send Get Year Day Schedule Command to DUT and verify NOT_FOUND response Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 2U)); + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); } { id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); } { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139U)); + VerifyOrReturn(CheckValue("status", actualValue, 1U)); } VerifyOrReturn(CheckConstraintHasValue("localStartTime", values.localStartTime, false)); @@ -106039,20 +106879,20 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendSetYearDayScheduleCommandToDut_11() + CHIP_ERROR TestSendSetYearDayScheduleCommandToDut_12() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:2U]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:10UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:20UL]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:1080UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:2100UL]; [cluster setYearDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Set Year Day Schedule Command to DUT Error: %@", err); + NSLog(@"Send Set Year Day Schedule Command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -106062,30 +106902,30 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendGetYearDayScheduleCommand_12() + CHIP_ERROR TestSendGetYearDayScheduleCommand_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:2U]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster getYearDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"send Get Year Day Schedule Command Error: %@", err); + NSLog(@"send Get Year Day Schedule Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 2U)); + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); } { id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); } { @@ -106095,12 +106935,12 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { { id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 10UL)); + VerifyOrReturn(CheckValue("localStartTime", actualValue, 1080UL)); } { id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 20UL)); + VerifyOrReturn(CheckValue("localEndTime", actualValue, 2100UL)); } NextTest(); @@ -106108,6 +106948,47 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestClearAYearDayScheduleForTheFirstUser_14() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster clearYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear a year day schedule for the first user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCleanupTheCreatedUser_15() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterClearUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster clearUserWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Cleanup the created user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_DRLK_2_9 : public TestCommandBridge { @@ -106153,29 +107034,21 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress( - chipTool, " ***** Test Step 1 : TH reads NumberOfTotalUsersSupported attribute and saves for future use.\n"); - if (ShouldSkip("DRLK.C.F08 && DRLK.S.A0011")) { - NextTest(); - return; - } - err = TestThReadsNumberOfTotalUsersSupportedAttributeAndSavesForFutureUse_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Create new user with default parameters\n"); + err = TestCreateNewUserWithDefaultParameters_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH sends Set Credential Command to DUT\n"); - if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { - NextTest(); - return; - } - err = TestThSendsSetCredentialCommandToDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the user back and verify its fields\n"); + err = TestReadTheUserBackAndVerifyItsFields_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH sends Get Credential Status Command\n"); - if (ShouldSkip("DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx")) { + ChipLogProgress( + chipTool, " ***** Test Step 3 : TH reads NumberOfTotalUsersSupported attribute and saves for future use.\n"); + if (ShouldSkip("DRLK.C.F08 && DRLK.S.A0011")) { NextTest(); return; } - err = TestThSendsGetCredentialStatusCommand_3(); + err = TestThReadsNumberOfTotalUsersSupportedAttributeAndSavesForFutureUse_3(); break; case 4: ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends Set Credential Command to DUT\n"); @@ -106186,100 +107059,114 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { err = TestThSendsSetCredentialCommandToDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH sends Set Credential Command to DUT\n"); - if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : TH sends Get Credential Status Command\n"); + if (ShouldSkip("DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx")) { NextTest(); return; } - err = TestThSendsSetCredentialCommandToDut_5(); + err = TestThSendsGetCredentialStatusCommand_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : TH sends Set Credential Command to DUT\n"); + ChipLogProgress(chipTool, + " ***** Test Step 6 : TH sends Set Credential Command to DUT and verify the INVALID_COMMAND if any of the fields " + "are invalid\n"); if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { NextTest(); return; } - err = TestThSendsSetCredentialCommandToDut_6(); + err = TestThSendsSetCredentialCommandToDutAndVerifyTheInvalidCommandIfAnyOfTheFieldsAreInvalid_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH sends Set Credential Command to DUT\n"); + ChipLogProgress(chipTool, + " ***** Test Step 7 : TH sends Set Credential Command to DUT and verify response as DUPLICATE if CredentialData is " + "repeated\n"); if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { NextTest(); return; } - err = TestThSendsSetCredentialCommandToDut_7(); + err = TestThSendsSetCredentialCommandToDutAndVerifyResponseAsDuplicateIfCredentialDataIsRepeated_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : TH sends Set Credential Command to DUT\n"); + ChipLogProgress(chipTool, + " ***** Test Step 8 : TH sends Set Credential Command to DUT and verify response as OCCUPIED if CredentialIndex is " + "repeated\n"); if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { NextTest(); return; } - err = TestThSendsSetCredentialCommandToDut_8(); + err = TestThSendsSetCredentialCommandToDutAndVerifyResponseAsOccupiedIfCredentialIndexIsRepeated_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH sends Clear Credential Command to DUT\n"); - if (ShouldSkip("DRLK.S.F08 && DRLK.S.C26.Rsp")) { + ChipLogProgress(chipTool, + " ***** Test Step 9 : TH sends Set Credential Command to DUT and verify the DUT response as OCCUPIED if the " + "CredentialIndex is not associated with the UserIndex\n"); + if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { NextTest(); return; } - err = TestThSendsClearCredentialCommandToDut_9(); + err = TestThSendsSetCredentialCommandToDutAndVerifyTheDutResponseAsOccupiedIfTheCredentialIndexIsNotAssociatedWithTheUserIndex_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : TH sends Set Credential Command to DUT\n"); - if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : TH sends Clear Credential Command to DUT\n"); + if (ShouldSkip("DRLK.S.F08 && DRLK.S.C26.Rsp")) { NextTest(); return; } - err = TestThSendsSetCredentialCommandToDut_10(); + err = TestThSendsClearCredentialCommandToDut_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : TH sends Clear Credential Command to DUT\n"); - if (ShouldSkip("DRLK.S.F08 && DRLK.S.C26.Rsp")) { + ChipLogProgress(chipTool, + " ***** Test Step 11 : TH sends Get Credential Status Command and verify that the CredentialType and " + "CredentialIndex for the provided value is cleared\n"); + if (ShouldSkip("DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx")) { NextTest(); return; } - err = TestThSendsClearCredentialCommandToDut_11(); + err = TestThSendsGetCredentialStatusCommandAndVerifyThatTheCredentialTypeAndCredentialIndexForTheProvidedValueIsCleared_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : TH sends Set Credential Command to DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 12 : TH sends Set User Command to DUT\n"); + err = TestThSendsSetUserCommandToDut_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH sends Set Credential Command to DUT\n"); if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { NextTest(); return; } - err = TestThSendsSetCredentialCommandToDut_12(); + err = TestThSendsSetCredentialCommandToDut_13(); break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : TH sends Clear Credential Command to DUT\n"); + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TH sends Clear Credential Command to DUT\n"); if (ShouldSkip("DRLK.S.F08 && DRLK.S.C26.Rsp")) { NextTest(); return; } - err = TestThSendsClearCredentialCommandToDut_13(); + err = TestThSendsClearCredentialCommandToDut_14(); break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : TH sends Get Credential Status Command\n"); + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : TH sends Get Credential Status Command\n"); if (ShouldSkip("DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx")) { NextTest(); return; } - err = TestThSendsGetCredentialStatusCommand_14(); + err = TestThSendsGetCredentialStatusCommand_15(); break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : TH sends Set Credential Command to DUT\n"); - if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : TH sends Get Credential Status Command\n"); + if (ShouldSkip("DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx")) { NextTest(); return; } - err = TestThSendsSetCredentialCommandToDut_15(); + err = TestThSendsGetCredentialStatusCommand_16(); break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : TH sends Clear Credential Command to DUT\n"); + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : TH sends Clear Credential Command to DUT\n"); if (ShouldSkip("DRLK.S.F08 && DRLK.S.C26.Rsp")) { NextTest(); return; } - err = TestThSendsClearCredentialCommandToDut_16(); + err = TestThSendsClearCredentialCommandToDut_17(); break; } @@ -106338,9 +107225,12 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; } @@ -106356,7 +107246,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 17; + const uint16_t mTestCount = 18; chip::Optional mNodeId; chip::Optional mCluster; @@ -106369,9 +107259,112 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } + + CHIP_ERROR TestCreateNewUserWithDefaultParameters_1() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetUserParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.userName = @"xxx"; + params.userUniqueId = [NSNumber numberWithUnsignedInt:6452UL]; + params.userStatus = [NSNumber numberWithUnsignedChar:1U]; + params.userType = [NSNumber numberWithUnsignedChar:0U]; + params.credentialRule = [NSNumber numberWithUnsignedChar:0U]; + [cluster setUserWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create new user with default parameters Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheUserBackAndVerifyItsFields_2() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getUserWithParams:params + completionHandler:^(MTRDoorLockClusterGetUserResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Read the user back and verify its fields Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.userName; + VerifyOrReturn(CheckValueNonNull("userName", actualValue)); + VerifyOrReturn(CheckValueAsString("userName", actualValue, @"xxx")); + } + + { + id actualValue = values.userUniqueId; + VerifyOrReturn(CheckValueNonNull("userUniqueId", actualValue)); + VerifyOrReturn(CheckValue("userUniqueId", actualValue, 6452UL)); + } + + { + id actualValue = values.userStatus; + VerifyOrReturn(CheckValueNonNull("userStatus", actualValue)); + VerifyOrReturn(CheckValue("userStatus", actualValue, 1U)); + } + + { + id actualValue = values.userType; + VerifyOrReturn(CheckValueNonNull("userType", actualValue)); + VerifyOrReturn(CheckValue("userType", actualValue, 0U)); + } + + { + id actualValue = values.credentialRule; + VerifyOrReturn(CheckValueNonNull("credentialRule", actualValue)); + VerifyOrReturn(CheckValue("credentialRule", actualValue, 0U)); + } + + { + id actualValue = values.credentials; + VerifyOrReturn(CheckValueNull("credentials", actualValue)); + } + + { + id actualValue = values.creatorFabricIndex; + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("creatorFabricIndex", actualValue, 1U)); + } + + { + id actualValue = values.lastModifiedFabricIndex; + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextUserIndex; + VerifyOrReturn(CheckValueNull("nextUserIndex", actualValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } NSNumber * _Nonnull NumberOfTotalUsersSupported; - CHIP_ERROR TestThReadsNumberOfTotalUsersSupportedAttributeAndSavesForFutureUse_1() + CHIP_ERROR TestThReadsNumberOfTotalUsersSupportedAttributeAndSavesForFutureUse_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106383,10 +107376,8 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("NumberOfTotalUsersSupported", actualValue, 10U)); - } + VerifyOrReturn(CheckConstraintMinValue("numberOfTotalUsersSupported", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("numberOfTotalUsersSupported", [value unsignedShortValue], 255U)); { NumberOfTotalUsersSupported = value; } @@ -106397,7 +107388,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsSetCredentialCommandToDut_2() + CHIP_ERROR TestThSendsSetCredentialCommandToDut_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106420,13 +107411,29 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNull("userIndex", actualValue)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsGetCredentialStatusCommand_3() + CHIP_ERROR TestThSendsGetCredentialStatusCommand_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106449,6 +107456,25 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { VerifyOrReturn( CheckConstraintMinValue("userIndex", [values.userIndex unsignedShortValue], 1U)); + VerifyOrReturn(CheckConstraintMaxValue( + "userIndex", [values.userIndex unsignedShortValue], NumberOfTotalUsersSupported)); + } + + { + id actualValue = values.creatorFabricIndex; + VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("creatorFabricIndex", actualValue, 1U)); + } + + { + id actualValue = values.lastModifiedFabricIndex; + VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", actualValue)); + VerifyOrReturn(CheckValue("lastModifiedFabricIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNull("nextCredentialIndex", actualValue)); } NextTest(); @@ -106457,7 +107483,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsSetCredentialCommandToDut_4() + CHIP_ERROR TestThSendsSetCredentialCommandToDutAndVerifyTheInvalidCommandIfAnyOfTheFieldsAreInvalid_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106467,7 +107493,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { params.operationType = [NSNumber numberWithUnsignedChar:0U]; params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:2U]; params.credentialData = [[NSData alloc] initWithBytes:"1234" length:4]; params.userIndex = [NSNumber numberWithUnsignedShort:2U]; @@ -106476,17 +107502,35 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { [cluster setCredentialWithParams:params completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"TH sends Set Credential Command to DUT Error: %@", err); + NSLog(@"TH sends Set Credential Command to DUT and verify the INVALID_COMMAND if any of the fields are " + @"invalid Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNull("userIndex", actualValue)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 3U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsSetCredentialCommandToDut_5() + CHIP_ERROR TestThSendsSetCredentialCommandToDutAndVerifyResponseAsDuplicateIfCredentialDataIsRepeated_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106496,7 +107540,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { params.operationType = [NSNumber numberWithUnsignedChar:0U]; params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:2U]; params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; params.userIndex = [NSNumber numberWithUnsignedShort:2U]; @@ -106505,17 +107549,35 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { [cluster setCredentialWithParams:params completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"TH sends Set Credential Command to DUT Error: %@", err); + NSLog(@"TH sends Set Credential Command to DUT and verify response as DUPLICATE if CredentialData is " + @"repeated Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 2U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNull("userIndex", actualValue)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 3U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsSetCredentialCommandToDut_6() + CHIP_ERROR TestThSendsSetCredentialCommandToDutAndVerifyResponseAsOccupiedIfCredentialIndexIsRepeated_8() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106534,38 +107596,27 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { [cluster setCredentialWithParams:params completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"TH sends Set Credential Command to DUT Error: %@", err); + NSLog(@"TH sends Set Credential Command to DUT and verify response as OCCUPIED if CredentialIndex is " + @"repeated Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThSendsSetCredentialCommandToDut_7() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; - params.operationType = [NSNumber numberWithUnsignedChar:0U]; - params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:2U]; + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 2U)); + } - params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; - params.userIndex = [NSNumber numberWithUnsignedShort:3U]; - params.userStatus = [NSNumber numberWithUnsignedChar:0U]; - params.userType = [NSNumber numberWithUnsignedChar:0U]; - [cluster - setCredentialWithParams:params - completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"TH sends Set Credential Command to DUT Error: %@", err); + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNull("userIndex", actualValue)); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); + } NextTest(); }]; @@ -106573,7 +107624,8 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsSetCredentialCommandToDut_8() + CHIP_ERROR + TestThSendsSetCredentialCommandToDutAndVerifyTheDutResponseAsOccupiedIfTheCredentialIndexIsNotAssociatedWithTheUserIndex_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106586,23 +107638,41 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:3U]; params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; - params.userIndex = [NSNumber numberWithUnsignedShort:3U]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; params.userStatus = [NSNumber numberWithUnsignedChar:0U]; params.userType = [NSNumber numberWithUnsignedChar:0U]; [cluster setCredentialWithParams:params completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"TH sends Set Credential Command to DUT Error: %@", err); + NSLog(@"TH sends Set Credential Command to DUT and verify the DUT response as OCCUPIED if the " + @"CredentialIndex is not associated with the UserIndex Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 2U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNull("userIndex", actualValue)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 4U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsClearCredentialCommandToDut_9() + CHIP_ERROR TestThSendsClearCredentialCommandToDut_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106625,59 +107695,85 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsSetCredentialCommandToDut_10() + CHIP_ERROR + TestThSendsGetCredentialStatusCommandAndVerifyThatTheCredentialTypeAndCredentialIndexForTheProvidedValueIsCleared_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; - params.operationType = [NSNumber numberWithUnsignedChar:0U]; + __auto_type * params = [[MTRDoorLockClusterGetCredentialStatusParams alloc] init]; params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; - params.userStatus = [NSNumber numberWithUnsignedChar:0U]; - params.userType = [NSNumber numberWithUnsignedChar:0U]; - [cluster - setCredentialWithParams:params - completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"TH sends Set Credential Command to DUT Error: %@", err); + [cluster getCredentialStatusWithParams:params + completionHandler:^( + MTRDoorLockClusterGetCredentialStatusResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends Get Credential Status Command and verify that the CredentialType and " + @"CredentialIndex for the provided value is cleared Error: %@", + err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = values.credentialExists; + VerifyOrReturn(CheckValue("credentialExists", actualValue, false)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNull("userIndex", actualValue)); + } + + { + id actualValue = values.creatorFabricIndex; + VerifyOrReturn(CheckValueNull("creatorFabricIndex", actualValue)); + } + + { + id actualValue = values.lastModifiedFabricIndex; + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", actualValue)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNull("nextCredentialIndex", actualValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsClearCredentialCommandToDut_11() + CHIP_ERROR TestThSendsSetUserCommandToDut_12() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterClearCredentialParams alloc] init]; - params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:65534U]; - - [cluster clearCredentialWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Clear Credential Command to DUT Error: %@", err); + __auto_type * params = [[MTRDoorLockClusterSetUserParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0U]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + params.userName = @"xxx"; + params.userUniqueId = [NSNumber numberWithUnsignedInt:6452UL]; + params.userStatus = [NSNumber numberWithUnsignedChar:1U]; + params.userType = [NSNumber numberWithUnsignedChar:0U]; + params.credentialRule = [NSNumber numberWithUnsignedChar:0U]; + [cluster setUserWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Set User Command to DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsSetCredentialCommandToDut_12() + CHIP_ERROR TestThSendsSetCredentialCommandToDut_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106687,7 +107783,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { params.operationType = [NSNumber numberWithUnsignedChar:0U]; params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:3U]; params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; params.userIndex = [NSNumber numberWithUnsignedShort:2U]; @@ -106700,13 +107796,29 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNull("userIndex", actualValue)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 4U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsClearCredentialCommandToDut_13() + CHIP_ERROR TestThSendsClearCredentialCommandToDut_14() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106729,7 +107841,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsGetCredentialStatusCommand_14() + CHIP_ERROR TestThSendsGetCredentialStatusCommand_15() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106738,56 +107850,70 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterGetCredentialStatusParams alloc] init]; params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:65534U]; [cluster getCredentialStatusWithParams:params completionHandler:^( MTRDoorLockClusterGetCredentialStatusResponseParams * _Nullable values, NSError * _Nullable err) { NSLog(@"TH sends Get Credential Status Command Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValueNull("userIndex", actualValue)); - } - + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_INVALID_COMMAND)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsSetCredentialCommandToDut_15() + CHIP_ERROR TestThSendsGetCredentialStatusCommand_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; - params.operationType = [NSNumber numberWithUnsignedChar:0U]; + __auto_type * params = [[MTRDoorLockClusterGetCredentialStatusParams alloc] init]; params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; - params.userStatus = [NSNumber numberWithUnsignedChar:0U]; - params.userType = [NSNumber numberWithUnsignedChar:0U]; - [cluster - setCredentialWithParams:params - completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"TH sends Set Credential Command to DUT Error: %@", err); + [cluster getCredentialStatusWithParams:params + completionHandler:^( + MTRDoorLockClusterGetCredentialStatusResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends Get Credential Status Command Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = values.credentialExists; + VerifyOrReturn(CheckValue("credentialExists", actualValue, false)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNull("userIndex", actualValue)); + } + + { + id actualValue = values.creatorFabricIndex; + VerifyOrReturn(CheckValueNull("creatorFabricIndex", actualValue)); + } + + { + id actualValue = values.lastModifiedFabricIndex; + VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", actualValue)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNull("nextCredentialIndex", actualValue)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsClearCredentialCommandToDut_16() + CHIP_ERROR TestThSendsClearCredentialCommandToDut_17() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -108470,7 +109596,6 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), make_unique(), make_unique(), make_unique(), @@ -108600,6 +109725,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(),