From e9f64bb1836fd38dfb2799e769ed02abc499c4f4 Mon Sep 17 00:00:00 2001 From: Anu Biradar <104591549+abiradarti@users.noreply.github.com> Date: Mon, 19 Aug 2024 11:28:27 -0500 Subject: [PATCH 01/52] [TI] Switch Application for CC13x4_26x4 (#34916) * Switch Application for TI CC13x4_26x4 * Added light-switch to CI and restyled changes * OOB configs * CI fix * CI fix in all_targets_linux_x64.txt * revert CI changes for switch-app * updated args.gni comment for logging --- .github/workflows/examples-cc13xx_26xx.yaml | 2 +- examples/light-switch-app/cc13x4_26x4/.gn | 30 + .../light-switch-app/cc13x4_26x4/BUILD.gn | 117 +++ .../light-switch-app/cc13x4_26x4/README.md | 311 ++++++++ .../light-switch-app/cc13x4_26x4/args.gni | 74 ++ .../cc13x4_26x4/build_overrides | 1 + .../light-switch-app/cc13x4_26x4/chip.syscfg | 241 ++++++ .../cc13x4_26x4/include/CHIPProjectConfig.h | 119 +++ .../cc13x4_26x4/src/AppConfig.h | 35 + .../cc13x4_26x4/src/AppEvent.h | 86 +++ .../cc13x4_26x4/src/AppTask.cpp | 722 ++++++++++++++++++ .../cc13x4_26x4/src/AppTask.h | 99 +++ .../cc13x4_26x4/src/BindingHandler.cpp | 163 ++++ .../cc13x4_26x4/src/BindingHandler.h | 33 + .../cc13x4_26x4/src/LightSwitchManager.cpp | 193 +++++ .../cc13x4_26x4/src/LightSwitchManager.h | 87 +++ .../cc13x4_26x4/src/ZclCallbacks.cpp | 57 ++ .../light-switch-app/cc13x4_26x4/src/main.cpp | 96 +++ .../cc13x4_26x4/third_party/connectedhomeip | 1 + 19 files changed, 2466 insertions(+), 1 deletion(-) create mode 100644 examples/light-switch-app/cc13x4_26x4/.gn create mode 100644 examples/light-switch-app/cc13x4_26x4/BUILD.gn create mode 100644 examples/light-switch-app/cc13x4_26x4/README.md create mode 100644 examples/light-switch-app/cc13x4_26x4/args.gni create mode 120000 examples/light-switch-app/cc13x4_26x4/build_overrides create mode 100644 examples/light-switch-app/cc13x4_26x4/chip.syscfg create mode 100644 examples/light-switch-app/cc13x4_26x4/include/CHIPProjectConfig.h create mode 100644 examples/light-switch-app/cc13x4_26x4/src/AppConfig.h create mode 100644 examples/light-switch-app/cc13x4_26x4/src/AppEvent.h create mode 100644 examples/light-switch-app/cc13x4_26x4/src/AppTask.cpp create mode 100644 examples/light-switch-app/cc13x4_26x4/src/AppTask.h create mode 100644 examples/light-switch-app/cc13x4_26x4/src/BindingHandler.cpp create mode 100644 examples/light-switch-app/cc13x4_26x4/src/BindingHandler.h create mode 100644 examples/light-switch-app/cc13x4_26x4/src/LightSwitchManager.cpp create mode 100644 examples/light-switch-app/cc13x4_26x4/src/LightSwitchManager.h create mode 100644 examples/light-switch-app/cc13x4_26x4/src/ZclCallbacks.cpp create mode 100644 examples/light-switch-app/cc13x4_26x4/src/main.cpp create mode 120000 examples/light-switch-app/cc13x4_26x4/third_party/connectedhomeip diff --git a/.github/workflows/examples-cc13xx_26xx.yaml b/.github/workflows/examples-cc13xx_26xx.yaml index b486415dbcc1ee..53c813d0b4c433 100644 --- a/.github/workflows/examples-cc13xx_26xx.yaml +++ b/.github/workflows/examples-cc13xx_26xx.yaml @@ -105,7 +105,7 @@ jobs: run: | .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ cc13x4_26x4 LP_EM_CC1354P10_6 lighting-app \ - out/artifacts/ti-cc13x4_26x4-lighting-mtd/chip-LP_EM_CC1354P10_6-lighting-example.out \ + out/artifacts/ti-cc13x4_26x4-lighting-ftd/chip-LP_EM_CC1354P10_6-lighting-example.out \ /tmp/bloat_reports/ - name: Uploading Size Reports uses: ./.github/actions/upload-size-reports diff --git a/examples/light-switch-app/cc13x4_26x4/.gn b/examples/light-switch-app/cc13x4_26x4/.gn new file mode 100644 index 00000000000000..cf974b2eb1df22 --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/.gn @@ -0,0 +1,30 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + + import("//args.gni") + pw_build_PIP_REQUIREMENTS += + [ "${chip_root}/scripts/setup/requirements.ti.txt" ] +} diff --git a/examples/light-switch-app/cc13x4_26x4/BUILD.gn b/examples/light-switch-app/cc13x4_26x4/BUILD.gn new file mode 100644 index 00000000000000..2994ab5dccb6ea --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/BUILD.gn @@ -0,0 +1,117 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") +import("//build_overrides/openthread.gni") +import("//build_overrides/ti_simplelink_sdk.gni") + +import("${build_root}/config/defaults.gni") + +import("${chip_root}/src/platform/device.gni") + +import("${ti_simplelink_sdk_build_root}/ti_simplelink_executable.gni") +import("${ti_simplelink_sdk_build_root}/ti_simplelink_sdk.gni") + +assert(current_os == "freertos") + +project_dir = "${chip_root}/examples/light-switch-app/cc13x4_26x4" + +ti_simplelink_sdk("sdk") { + include_dirs = [ "${project_dir}/include" ] + public_configs = [ ":light-switch_app_config" ] +} + +ti_sysconfig("sysconfig") { + sources = [ "${project_dir}/chip.syscfg" ] + + outputs = [ + "ti_radio_config.c", + "ti_radio_config.h", + "ti_drivers_config.c", + "ti_drivers_config.h", + "ti_ble_config.c", + "ti_ble_config.h", + "ti_dmm_application_policy.c", + "ti_dmm_application_policy.h", + + # CCFG generation disabled for OTA-able application + #"ti_devices_config.c", + #"ti_devices_config.h", + ] + + public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ] + + cflags = [ + "-Wno-comment", + "@" + rebase_path("${target_gen_dir}/sysconfig/ti_utils_build_compiler.opt", + root_build_dir), + ] +} + +ti_simplelink_executable("light-switch_app") { + output_name = "chip-${ti_simplelink_board}-light-switch-example.out" + + sources = [ + "${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp", + "${chip_root}/src/app/clusters/general-diagnostics-server/GenericFaultTestEventTriggerHandler.cpp", + "${project_dir}/src/AppTask.cpp", + "${project_dir}/src/BindingHandler.cpp", + "${project_dir}/src/LightSwitchManager.cpp", + "${project_dir}/src/ZclCallbacks.cpp", + "${project_dir}/src/main.cpp", + ] + + public = [ + "${chip_root}/src/platform/cc13xx_26xx/DefaultTestEventTriggerDelegate.h", + ] + + deps = [ + ":sdk", + ":sysconfig", + "${chip_root}/examples/light-switch-app/light-switch-common", + "${chip_root}/examples/platform/cc13x4_26x4:cc13x4_26x4-attestation-credentials", + "${chip_root}/src/lib", + "${chip_root}/third_party/openthread:openthread", + ] + defines = [] + if (custom_factory_data) { + defines += [ "CC13XX_26XX_FACTORY_DATA" ] + } + + if (chip_enable_icd_server) { + defines += [ "TI_ICD_ENABLE_SERVER" ] + } + + include_dirs = [ + "${project_dir}", + "${chip_root}/examples/providers/", + ] + + cflags = [ + "-Wno-implicit-fallthrough", + "-Wno-sign-compare", + "-Wconversion", + ] + + output_dir = root_out_dir +} + +group("cc13x4_26x4") { + deps = [ ":light-switch_app" ] +} + +group("default") { + deps = [ ":cc13x4_26x4" ] +} diff --git a/examples/light-switch-app/cc13x4_26x4/README.md b/examples/light-switch-app/cc13x4_26x4/README.md new file mode 100644 index 00000000000000..a27c702714c5a8 --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/README.md @@ -0,0 +1,311 @@ +# Matter Light Switch Example Application + +An example application showing the use of [Matter][matter] on the Texas +Instruments CC13XX_26XX family of Wireless MCUs. + +--- + +- [Matter Light Switch Example Application](#matter-light-switch-example-application) + - [Introduction](#introduction) + - [Device UI](#device-ui) + - [Building](#building) + - [Preparation](#preparation) + - [Compilation](#compilation) + - [Programming](#programming) + - [Code Composer Studio](#code-composer-studio) + - [UniFlash](#uniflash) + - [Viewing Logging Output](#viewing-logging-output) + - [Running the Example](#running-the-example) + - [TI Support](#ti-support) + +--- + +## Introduction + +The CC13XX_26XX light-switch example application provides a working +demonstration of a connected light-switch device. This uses the open-source +Matter implementation and the Texas Instruments SimpleLinkā„¢ CC13XX and CC26XX +software development kit. + +This example is enabled to build for CC1354P10 devices. + +The light-switch example is intended to serve both as a means to explore the +workings of Matter, as well as a template for creating real products based on +the Texas Instruments devices. + +## Device UI + +| Action | Functionality | +| ------------------------------------------------ | ---------------------------------- | +| Left Button (`BTN-1`) Press (less than 1000 ms) | Turns connected bulb off | +| Left Button (`BTN-1`) Press (more than 1000 ms) | Factory Reset | +| Right Button (`BTN-2`) Press (less than 1000 ms) | Turns connected bulb on | +| Right Button (`BTN-2`) Press (more than 1000 ms) | BLE Advertisement (Enable/Disable) | + +## Building + +### Preparation + +Some initial setup is necessary for preparing the build environment. This +section will need to be done when migrating to new versions of the SDK. This +guide assumes that the environment is linux based, and recommends Ubuntu 20.04. + +- Download and install [SysConfig][sysconfig]. This can be done simply with + the following commands. + + ``` + $ cd ~ + $ wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.18.1.3343/sysconfig-1.18.1_3343-setup.run + $ chmod +x sysconfig-1.18.1_3343-setup.run + $ ./sysconfig-1.18.1_3343-setup.run + ``` + +- Run the bootstrap script to setup the build environment. +- Note, a recursive submodule checkout is required to utilize TI's Openthread + reference commit. +- Note, in order to build the chip-tool and ota-provider examples, a recursive + submodule checkout is required for the linux platform as seen in the command + below. + + ``` + $ cd ~/connectedhomeip + $ source ./scripts/bootstrap.sh + $ ./scripts/checkout_submodules.py --shallow --platform cc13xx_26xx linux --recursive + + ``` + +### Compilation + +It is necessary to activate the environment in every new shell. Then run GN and +Ninja to build the executable. + +- Activate the build environment with the repository activate script. + + ``` + $ cd ~/connectedhomeip + $ source ./scripts/activate.sh + + ``` + +- Run the build to produce a default executable. By default on Linux both the + TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's + home directory, and you must provide the absolute path to them. For example + `/home/username/ti/sysconfig_1.18.1`. On Windows the default directory is + `C:\ti`. Take note of this install path, as it will be used in the next + step. + + ``` + $ cd ~/connectedhomeip/examples/lock-app/cc13x4_26x4 + $ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\"" + $ ninja -C out/debug + + ``` + + If you would like to define arguments on the command line you may add them + to the GN call. + + ``` + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"] chip_generate_link_map_file=true" + + ``` + +## Programming + +Loading the built image onto a LaunchPad is supported through two methods; +Uniflash and Code Composer Studio (CCS). UniFlash can be used to load the image. +Code Composer Studio can be used to load the image and debug the source code. + +### Code Composer Studio + +Programming with CCS will allow for a full debug environment within the IDE. +This is accomplished by creating a target connection to the XDS110 debugger and +starting a project-less debug session. The CCS IDE will attempt to find the +source files on the local machine based on the debug information embedded within +the ELF. CCS may prompt you to find the source code if the image was built on +another machine or the source code is located in a different location than is +recorded within the ELF. + +Download and install [Code Composer Studio][ccs]. + +First open CCS and create a new workspace. + +Create a target connection (sometimes called the CCXML) for your target SoC and +debugger as described in the [Manual Method][ccs_manual_method] section of the +CCS User's Guide. + +Next initiate a project-less debug session as described in the [Manual +Launch][ccs_manual_launch] section of the CCS User's Guide. + +CCS should switch to the debug view described in the [After +Launch][ccs_after_launch] section of the User's Guide. The SoC core will likely +be disconnected and symbols will not be loaded. Connect to the core as described +in the [Debug View][ccs_debug_view] section of the User's Guide. Once the core +is connected, use the `Load` button on the toolbar to load the ELF image. + +Note that the default configuration of the CCXML uses 2-wire cJTAG instead of +the full 4-wire JTAG connection to match the default jumper configuration of the +LaunchPad. + +### UniFlash + +Uniflash is Texas Instrument's uniform programming tool for embedded processors. +This will allow you to erase, flash, and inspect the SoC without setting up a +debugging environment. + +Download and install [UniFlash][uniflash]. + +First open UniFlash. Debug probes connected to the computer will usually be +displayed under the Detected Devices due to the automatic device detection +feature. If your device does not show up in this view it my be disconnected, or +you may have to create a New Configuration. If you already have a CCXML for your +SoC and debug connection you can use that in the section at the bottom. Once +your device is selected, click the `Start` button within the section to launch +the session. + +Select the ELF image to load on the device with the `Browse` button. This file +is placed in the `out/debug` folder by this guide and ends with the `*.out` file +extension. For OTA enabled applications, the standalone image will instead end +with the `*-mcuboot.hex` file extension. This this is a combined image with +application and `MCUBoot` included. The flag to enable or disable the OTA +feature is determined by "chip_enable_ota_requestor" in the application's +args.gni file. + +Finally click the `Load Image` button to load the executable image onto the +device. You should be able to see the log output over the XDS110 User UART. + +Note that programming the device through JTAG sets the Halt-in-Boot flag and may +cause issues when performing a software reset. This flag can be reset by +power-cycling the LaunchPad. + +## Viewing Logging Output + +By default the log output will be sent to the Application/User UART. Open a +terminal emulator to that port to see the output with the following options: + +| Parameter | Value | +| ------------ | -------- | +| Speed (baud) | `115200` | +| Data bits | `8` | +| Stop bits | `1` | +| Parity | `None` | +| Flow control | `None` | + +## Running the Example + +Once a device has been flashed with this example, it can now join and operate in +an existing Matter network. The following sections assume that a Matter network +is already active, and has at least one [OpenThread Border +Router][ot_border_router_setup]. + +For insight into what other components are needed to run this example, please +refer to our [Matter Getting Started Guide][matter-e2e-faq]. + +The steps below should be followed to commission the light-switch device onto +the network and control it once it has been commissioned. + +**Step 0** + +Set up the CHIP tool by following the instructions outlined in our [Matter +Getting Started Guide][matter-e2e-faq]. + +**Step 1** + +First, you will need to have a lighting app device setup and commissioned into +the Matter network. Look through the README.md file for lighting app for +building and commissioning instructions for the default lighting app. + +Commission the light-switch device onto the Matter network. Run the following +command on the CHIP tool: + +``` + +./chip-tool pairing ble-thread hex: 20202021 3840 + +``` + +Interacting with the application begins by enabling BLE advertisements and then +pairing the device into a Thread network. To provision this example onto a +Matter network, the device must be discoverable over Bluetooth LE. + +On the LaunchPad, press and hold the right button, labeled `BTN-2`, for more +than 1 second. Upon release, the Bluetooth LE advertising will begin. Once the +device is fully provisioned, BLE advertising will stop. + +Once the device has been successfully commissioned, you will see the following +message on the CHIP tool output: + +``` + +[1677648218.370754][39785:39790] CHIP:CTL: Received CommissioningComplete response, errorCode=0 +[1677648218.370821][39785:39790] CHIP:CTL: Successfully finished commissioning step 'SendComplete' + +``` + +An accompanying message will be seen from the device: + +``` + +Commissioning complete, notify platform driver to persist network credentials. + +``` + +You can check if the light-switch is able to receive commands from CHIP-TOOL by +using this command: + +``` +./chip-tool basicinformation read vendor-id 0 +``` + +**Step 2** + +Send commands to the light-switch app. + +Here is how you can bind the light-switch app to a lighting app device: + +Tell the lighting device to give the light-switch device access to it's onoff +cluster (replace <> with lighting/light-switch node IDs): + +``` +./chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": [], "targets": [{"cluster": 6, "endpoint": 1, "deviceType": null}]}]' 0 + +``` + +Tell the light-switch device to bind to the onoff cluster on the lighting device +(replace <> with lighting/light-switch node IDs): + +``` +./chip-tool binding write binding '[{"fabricIndex": 1, "node": , "endpoint": 1, "cluster": 6}]' 1 + +``` + +Now you can press the Right BTN on the light-switch device and it will turn ON +the RED LED on the lighting device. Press the Left BTN on the light-switch +device to turn OFF the RED LED on the lighting device. If the devices aren't +bound properly the light-switch will display on UART that the Switch On/Off +operation has been completed but the lighting device's LEDs will not turn on/off +accordingly. + +## TI Support + +For technical support, please consider creating a post on TI's [E2E forum][e2e]. +Additionally, we welcome any feedback. + +[matter]: https://csa-iot.org/all-solutions/matter/ +[ccs]: https://www.ti.com/tool/CCSTUDIO +[ccs_after_launch]: + https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-main.html?configuration#after-launch +[ccs_debug_view]: + https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-main.html?configuration#debug-view +[ccs_manual_launch]: + https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-main.html?configuration#manual-launch +[ccs_manual_method]: + https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-main.html?configuration#manual-method +[e2e]: + https://e2e.ti.com/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum +[matter-e2e-faq]: + https://e2e.ti.com/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/1082428/faq-cc2652r7-matter----getting-started-guide +[sysconfig]: https://www.ti.com/tool/SYSCONFIG +[ti_thread_dnd]: + https://www.ti.com/wireless-connectivity/thread/design-development.html +[ot_border_router_setup]: https://openthread.io/guides/border-router/build +[uniflash]: https://www.ti.com/tool/download/UNIFLASH diff --git a/examples/light-switch-app/cc13x4_26x4/args.gni b/examples/light-switch-app/cc13x4_26x4/args.gni new file mode 100644 index 00000000000000..1223bfef03d761 --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/args.gni @@ -0,0 +1,74 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("//build_overrides/freertos.gni") +import("${chip_root}/config/standalone/args.gni") +import("${chip_root}/examples/platform/cc13x4_26x4/args.gni") + +ti_simplelink_sdk_target = get_label_info(":sdk", "label_no_toolchain") +ti_simplelink_sysconfig_target = + get_label_info(":sysconfig", "label_no_toolchain") + +ti_simplelink_board = "LP_EM_CC1354P10_6" + +# Size Optimizations +# use -Os instead of -Og, LWIP release build +optimize_debug_level = "s" +lwip_debug = false + +chip_enable_ota_requestor = true + +chip_openthread_ftd = true + +ot_ti_lib_dir = "" +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti" + +# When using TI Certified Openthread libs set to ${chip_root}/third_party/openthread/platforms/ti:ot-ti-cert +# For source builds, set to empty string. +chip_openthread_target = + "${chip_root}/third_party/openthread/platforms/ti:ot-ti-cert" + +# Enable CHIP Logging +chip_progress_logging = true +chip_detail_logging = true +chip_automation_logging = true + +# BLE options +chip_config_network_layer_ble = true + +# Disable lock tracking, since our FreeRTOS configuration does not set +# INCLUDE_xSemaphoreGetMutexHolder +chip_stack_lock_tracking = "none" + +matter_device_vid = "0xFFF1" +matter_device_pid = "0x8004" +matter_software_ver = "0x0001" +matter_software_ver_str = "1.0.1+1" + +custom_factory_data = false + +# ICD Default configurations +# when enabled the device will be configured as a sleepy end device +chip_enable_icd_server = false +chip_persist_subscriptions = false +chip_subscription_timeout_resumption = false + +freertos_root = "//third_party/connectedhomeip/third_party/ti_simplelink_sdk/repo_cc13xx_cc26xx/source/third_party/freertos" + +if (chip_openthread_target != "") { + openthread_root = + "//third_party/connectedhomeip/third_party/openthread/ot-ti/openthread" +} diff --git a/examples/light-switch-app/cc13x4_26x4/build_overrides b/examples/light-switch-app/cc13x4_26x4/build_overrides new file mode 120000 index 00000000000000..e578e73312ebd1 --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/light-switch-app/cc13x4_26x4/chip.syscfg b/examples/light-switch-app/cc13x4_26x4/chip.syscfg new file mode 100644 index 00000000000000..e4ae2b6acfbbd2 --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/chip.syscfg @@ -0,0 +1,241 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/* Modules */ +var AESCCM = scripting.addModule("/ti/drivers/AESCCM"); +var AESECB = scripting.addModule("/ti/drivers/AESECB"); +var Button = scripting.addModule("/ti/drivers/apps/Button"); +var LED = scripting.addModule("/ti/drivers/apps/LED"); +var NVS = scripting.addModule("/ti/drivers/NVS"); +var RF = scripting.addModule("/ti/drivers/RF"); +var RFDesign = scripting.addModule("ti/devices/radioconfig/rfdesign"); +var RFCustom = scripting.addModule("/ti/devices/radioconfig/custom"); +var TRNG = scripting.addModule("/ti/drivers/TRNG"); +var SHA2 = scripting.addModule("/ti/drivers/SHA2"); +var UART2 = scripting.addModule("/ti/drivers/UART2"); +var ble = scripting.addModule("/ti/ble5stack/ble"); +var dmm = scripting.addModule("/ti/dmm/dmm"); +var AESCTRDRBG = scripting.addModule("/ti/drivers/AESCTRDRBG"); +var ECDH = scripting.addModule("/ti/drivers/ECDH"); + +/* Instances */ +var AESCCM1 = AESCCM.addInstance(); +var AESECB1 = AESECB.addInstance(); +var AESECB2 = AESECB.addInstance(); +var Button1 = Button.addInstance(); +var Button2 = Button.addInstance(); +var NVS1 = NVS.addInstance(); +var NVS2 = NVS.addInstance(); +var SHA21 = SHA2.addInstance(); +var LED1 = LED.addInstance(); +var LED2 = LED.addInstance(); +var TRNG1 = TRNG.addInstance(); +var TRNG2 = TRNG.addInstance(); +var TRNG3 = TRNG.addInstance(); +var UART2 = UART2.addInstance(); +var AESCTRDRBG1 = AESCTRDRBG.addInstance(); +var ECDH1 = ECDH.addInstance(); + +AESCTRDRBG1.$name = "CONFIG_AESCTRDRBG_0"; + +AESCCM1.$name = "CONFIG_AESCCM0"; + +AESECB1.$name = "CONFIG_AESECB0"; +AESECB2.$name = "CONFIG_AESECB_1"; + +ECDH1.$name = "CONFIG_ECDH0"; + +/* Left Button */ +Button1.$name = "CONFIG_BTN_LEFT"; +Button1.$hardware = system.deviceData.board.components["BTN-1"]; +Button1.gpioPin.$name = "CONFIG_GPIO_BTN1"; +Button1.gpioPin.pull = "Pull Up"; +Button1.gpioPin.interruptTrigger = "Falling Edge"; + +/* Left Button */ +Button2.$name = "CONFIG_BTN_RIGHT"; +Button2.$hardware = system.deviceData.board.components["BTN-2"]; +Button2.gpioPin.$name = "CONFIG_GPIO_BTN2"; +Button2.gpioPin.pull = "Pull Up"; +Button2.gpioPin.interruptTrigger = "Falling Edge"; + +/* ======== CCFG ======== */ +var CCFG = scripting.addModule("/ti/devices/CCFG"); +const ccfgSettings = system.getScript("/ti/common/lprf_ccfg_settings.js").ccfgSettings; +for(var setting in ccfgSettings) +{ + CCFG[setting] = ccfgSettings[setting]; +} + +/* disable CCFG for OTA-able application */ +CCFG.enableCodeGeneration = false; + + +/* NVS */ +NVS1.$name = "CONFIG_NVSINTERNAL"; +NVS1.internalFlash.regionBase = 0xFB800; +NVS1.internalFlash.regionSize = 0x2800; + + +NVS2.$name = "CONFIG_NVSEXTERNAL"; +NVS2.nvsType = "External"; // NVS Region Type +NVS2.$hardware = system.deviceData.board.components.MX25R8035F; + +/* RF */ +/* if an antenna component exists, assign it to the rf instance */ +if (system.deviceData.board && system.deviceData.board.components.RF) { + RF.$hardware = system.deviceData.board.components.RF; +} + +const rfDesignSettings = system.getScript("/ti/common/lprf_rf_design_settings.js").rfDesignSettings; +for(var setting in rfDesignSettings) +{ + RFDesign[setting] = rfDesignSettings[setting]; +} + + + +/* Handling for RF frontend characterization */ +if(RFDesign.rfDesign.match(/LP_CC2652PSIP/)) +{ + RFCustom.ieee = ["ieee154p10"]; + var rfCodeExportConfig = RFCustom.radioConfigieee154p10.codeExportConfig +} +else +{ + RFCustom.ieee = ["ieee154"]; + var rfCodeExportConfig = RFCustom.radioConfigieee154.codeExportConfig +} + +var cmdList = [ + "cmdIeeeTx", + "cmdIeeeRx", + "cmdIeeeCsma", + "cmdIeeeEdScan", + "cmdIeeeRxAck", + "cmdTxTest" +]; + +rfCodeExportConfig.useConst = true; +rfCodeExportConfig.useMulti = true; +rfCodeExportConfig.symGenMethod = "Custom"; + +const deviceId = system.deviceData.deviceId; + +// Add high PA options if present +if(deviceId.match(/CC(265[12]R|2674R|1352R1|1354R)/)) +{ + cmdList.push("cmdRadioSetup"); + rfCodeExportConfig.cmdRadioSetup = "RF_cmdIeeeRadioSetup"; +} +else if(deviceId.match(/CC(265[12]P|2674P|1352P)/)) +{ + cmdList.push("cmdRadioSetupPa"); + rfCodeExportConfig.cmdRadioSetupPa = "RF_cmdIeeeRadioSetup"; + rfCodeExportConfig.paExport = "combined"; +} +else if(deviceId.match(/CC(265[34]|1354)P/)) +{ + cmdList.push("cmdRadioSetupPa"); + rfCodeExportConfig.cmdRadioSetupPa = "RF_cmdIeeeRadioSetup"; + // currently not characterized for high PA +} +else +{ + throw new Error("Could not match platform to any known platform types"); +} + +rfCodeExportConfig.cmdList_ieee_15_4 = cmdList; + +/* Red LED */ +LED1.$name = "CONFIG_LED_RED"; +LED1.$hardware = system.deviceData.board.components.LED_RED; +LED1.gpioPin.$name = "CONFIG_GPIO_RLED"; +LED1.gpioPin.mode = "Output"; + +/* Green LED */ +LED2.$name = "CONFIG_LED_GREEN"; +LED2.$hardware = system.deviceData.board.components.LED_GREEN; +LED2.gpioPin.$name = "CONFIG_GPIO_GLED"; +LED2.gpioPin.mode = "Output"; + +/* Debug UART */ +UART2.$hardware = system.deviceData.board.components.XDS110UART; +UART2.$name = "CONFIG_UART2_DEBUG"; + +/* TRNG */ +TRNG1.$name = "CONFIG_TRNG_0"; +TRNG2.$name = "CONFIG_TRNG_THREAD"; +TRNG3.$name = "CONFIG_TRNG_APP"; + +/* BLE */ +ble.addressMode = "ADDRMODE_RP_WITH_PUBLIC_ID"; +ble.maxConnNum = 1; +ble.numOfAdvSets = 1; +ble.lockProject = true; +ble.oneLibSizeOpt = true; +ble.maxPDUSize = 255; +ble.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param1"; +ble.connUpdateParamsPeripheral.$name = "ti_ble5stack_general_ble_conn_update_params0"; +ble.connUpdateParamsPeripheral.reqMinConnInt = 30; +ble.connUpdateParamsPeripheral.reqMaxConnInt = 50; + +ble.advSet1.$name = "ti_ble5stack_broadcaster_advertisement_set0"; +ble.advSet1.advParam1.$name = "ti_ble5stack_broadcaster_advertisement_params0"; + +ble.rfDesign = "LP_EM_CC1354P10_6"; + +ble.thorPg = 2; +/* DMM */ +dmm.project = "ti_thread_thermostat_remote_display"; +dmm.stackRoles = ["blePeripheral","threadFTD"]; +dmm.lockStackRoles = true; +dmm.numApplicationStates = 10; +dmm.applicationState0 = "ANY"; +dmm.applicationState1 = "DMMPOLICY_BLE_IDLE"; +dmm.applicationState2 = "DMMPOLICY_BLE_ADV"; +dmm.applicationState3 = "DMMPOLICY_BLE_CONNECTING"; +dmm.applicationState4 = "DMMPOLICY_BLE_HIGH_BANDWIDTH"; +dmm.applicationState5 = "DMMPOLICY_BLE_CONNECTED"; +dmm.applicationState6 = "DMMPOLICY_BLE_OAD"; +dmm.applicationState7 = "DMMPOLICY_THREAD_IDLE"; +dmm.applicationState8 = "DMMPOLICY_THREAD_LINK_EST"; +dmm.applicationState9 = "DMMPOLICY_THREAD_DATA"; +dmm.policyArray.create(4); +dmm.policyArray[0].$name = "ti_dmm_policy_dmm_policy0"; +dmm.policyArray[0].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble0"; +dmm.policyArray[0].blePeripheral.applicationStates = ["applicationState6"]; +dmm.policyArray[0].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread0"; +dmm.policyArray[0].threadFTD.pause = "DMMPOLICY_PAUSED"; +dmm.policyArray[1].$name = "ti_dmm_policy_dmm_policy1"; +dmm.policyArray[1].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble1"; +dmm.policyArray[1].blePeripheral.applicationStates = ["applicationState3","applicationState4"]; +dmm.policyArray[1].blePeripheral.weight = 25; +dmm.policyArray[1].blePeripheral.appliedActivity = ["DMMPOLICY_APPLIED_ACTIVITY_BLE_CONNECTION"]; +dmm.policyArray[1].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread1"; +dmm.policyArray[2].$name = "ti_dmm_policy_dmm_policy2"; +dmm.policyArray[2].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble2"; +dmm.policyArray[2].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread2"; +dmm.policyArray[2].threadFTD.weight = 30; +dmm.policyArray[2].threadFTD.applicationStates = ["applicationState8"]; +dmm.policyArray[2].threadFTD.appliedActivity = ["DMMPOLICY_APPLIED_ACTIVITY_ALL"]; +dmm.policyArray[3].$name = "ti_dmm_policy_dmm_policy3"; +dmm.policyArray[3].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble3"; +dmm.policyArray[3].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread3"; +dmm.policyArray[3].threadFTD.weight = 1; diff --git a/examples/light-switch-app/cc13x4_26x4/include/CHIPProjectConfig.h b/examples/light-switch-app/cc13x4_26x4/include/CHIPProjectConfig.h new file mode 100644 index 00000000000000..88e08c63321770 --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/include/CHIPProjectConfig.h @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#ifndef CHIP_PROJECT_CONFIG_H +#define CHIP_PROJECT_CONFIG_H + +#if BUILD_RELEASE // release build +// Note: Default Pairing/PIN/Serial Numbers being used. These should not be enabled for production builds +#endif // BUILD_RELEASE + +// Use a default pairing code if one hasn't been provisioned in flash. +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 + +/** + * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER + * + * Enables the use of a hard-coded default serial number if none + * is found in CHIP NV storage. + */ +#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" + +/** + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION + * + * The hardware version number assigned to device or product by the device vendor. This + * number is scoped to the device product id, and typically corresponds to a revision of the + * physical device, a change to its packaging, and/or a change to its marketing presentation. + * This value is generally *not* incremented for device software versions. + */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 +#endif + +/** + * Values set by args.gni: + * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION + */ + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + * + * Enable support for CHIP-over-BLE (CHIPOBLE). + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 + +/** + * CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE + * + * A size, in bytes, of the individual debug event logging buffer. + */ +#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512) + +#define MATTER_CC13XX_26XX_PLATFORM_LOG_ENABLED 1 + +/** + * CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT + * + * Enable the OpenThread SRP client to allow for CHIP device discovery. + */ +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 1 + +/** + * CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE + * + * For a development build, set the default importance of events to be logged as Debug. + * Since debug is the lowest importance level, this means all standard, critical, info and + * debug importance level vi events get logged. + */ +#if BUILD_RELEASE +#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Production +#else +#define CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE chip::Profiles::DataManagement::Debug +#endif // BUILD_RELEASE + +#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 + +/** + * @def CHIP_IM_MAX_NUM_COMMAND_HANDLER + * + * @brief Defines the maximum number of CommandHandler, limits the number of active commands transactions on server. + */ +#define CHIP_IM_MAX_NUM_COMMAND_HANDLER 2 + +/** + * @def CHIP_IM_MAX_NUM_WRITE_HANDLER + * + * @brief Defines the maximum number of WriteHandler, limits the number of active write transactions on server. + */ +#define CHIP_IM_MAX_NUM_WRITE_HANDLER 2 + +#endif // CHIP_PROJECT_CONFIG_H diff --git a/examples/light-switch-app/cc13x4_26x4/src/AppConfig.h b/examples/light-switch-app/cc13x4_26x4/src/AppConfig.h new file mode 100644 index 00000000000000..a818b21d641875 --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/src/AppConfig.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APP_CONFIG_H +#define APP_CONFIG_H + +// Logging +#ifdef __cplusplus +extern "C" { +#endif + +int cc13xx_26xxLogInit(void); +void cc13xx_26xxLog(const char * aFormat, ...); +#define PLAT_LOG(...) cc13xx_26xxLog(__VA_ARGS__); + +#define ACTUATOR_MOVEMENT_PERIOD_MS 1000 + +#ifdef __cplusplus +} +#endif +#endif // APP_CONFIG_H diff --git a/examples/light-switch-app/cc13x4_26x4/src/AppEvent.h b/examples/light-switch-app/cc13x4_26x4/src/AppEvent.h new file mode 100644 index 00000000000000..07f414bd414dc7 --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/src/AppEvent.h @@ -0,0 +1,86 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APP_EVENT_H +#define APP_EVENT_H + +struct AppEvent; +typedef void (*EventHandler)(AppEvent *); + +struct AppEvent +{ + enum AppEventType + { + kEventType_None = 0, + kEventType_ButtonLeft, + kEventType_ButtonRight, + kEventType_AppEvent, + kEventType_IdentifyStart, + kEventType_IdentifyStop, + kEventType_Light, + kEventType_Timer, + kEventType_Identify, + }; + + enum AppEventButtonType + { + kAppEventButtonType_None = 0, + kAppEventButtonType_Clicked, + kAppEventButtonType_LongClicked, + }; + + enum AppEventIdentifyType + { + kAppEventIdentifyType_Blink = 0, + kAppEventIdentifyType_Breathe, + kAppEventIdentifyType_Okay, + kAppEventIdentifyType_Finish, + kAppEventIdentifyType_Stop, + }; + + enum AppEventType Type; + + union + { + struct + { + enum AppEventButtonType Type; + } ButtonEvent; + + struct + { + void * Context; + } TimerEvent; + + struct + { + uint8_t Action; + int32_t Actor; + void * Context; + } LightSwitchEvent; + + struct + { + enum AppEventIdentifyType Type; + } IdentifyEvent; + }; + + EventHandler Handler; +}; + +#endif // APP_EVENT_H diff --git a/examples/light-switch-app/cc13x4_26x4/src/AppTask.cpp b/examples/light-switch-app/cc13x4_26x4/src/AppTask.cpp new file mode 100644 index 00000000000000..eec72be98096b7 --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/src/AppTask.cpp @@ -0,0 +1,722 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AppTask.h" +#include "AppConfig.h" +#include "AppEvent.h" +#include +#include + +#include "FreeRTOS.h" + +#include +#include +#include + +#include +#include + +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR +#include +#include +#include +#include +#include +#endif + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +/* syscfg */ +#include + +#define APP_TASK_STACK_SIZE (4096) +#define APP_TASK_PRIORITY 4 +#define APP_EVENT_QUEUE_SIZE 10 + +#define IDENTIFY_TRIGGER_EFFECT_BLINK 0 +#define IDENTIFY_TRIGGER_EFFECT_BREATHE 1 +#define IDENTIFY_TRIGGER_EFFECT_OKAY 2 +#define IDENTIFY_TRIGGER_EFFECT_FINISH_STOP 3 + +static uint32_t identify_trigger_effect = IDENTIFY_TRIGGER_EFFECT_FINISH_STOP; + +#define SWITCH_APPLICATION_IDENTIFY_ENDPOINT 1 + +#if (CHIP_CONFIG_ENABLE_ICD_SERVER == 1) +#define LED_ENABLE 0 +#else +#define LED_ENABLE 1 +#endif +#define BUTTON_ENABLE 1 + +#define OTAREQUESTOR_INIT_TIMER_DELAY_MS 10000 + +using namespace ::chip; +using namespace ::chip::app; +using namespace ::chip::Credentials; +using namespace ::chip::DeviceLayer; + +static TaskHandle_t sAppTaskHandle; +static QueueHandle_t sAppEventQueue; + +#if (LED_ENABLE == 1) +static LED_Handle sAppRedHandle; +static LED_Handle sAppGreenHandle; +#endif +static Button_Handle sAppLeftHandle; +static Button_Handle sAppRightHandle; + +static DeviceInfoProviderImpl sExampleDeviceInfoProvider; + +AppTask AppTask::sAppTask; + +void uiSwitchOnStart(void); +void uiSwitchOnDone(void); +void uiSwitchOffStart(void); +void uiSwitchOffDone(void); + +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR +void StartTimer(uint32_t aTimeoutMs); +void CancelTimer(void); +#endif + +uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, + 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; + +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR +static DefaultOTARequestor sRequestorCore; +static DefaultOTARequestorStorage sRequestorStorage; +static DefaultOTARequestorDriver sRequestorUser; +static BDXDownloader sDownloader; +static OTAImageProcessorImpl sImageProcessor; + +void InitializeOTARequestor(void) +{ + // Initialize and interconnect the Requestor and Image Processor objects + SetRequestorInstance(&sRequestorCore); + + sRequestorStorage.Init(Server::GetInstance().GetPersistentStorage()); + sRequestorCore.Init(Server::GetInstance(), sRequestorStorage, sRequestorUser, sDownloader); + sImageProcessor.SetOTADownloader(&sDownloader); + sDownloader.SetImageProcessorDelegate(&sImageProcessor); + sRequestorUser.Init(&sRequestorCore, &sImageProcessor); +} + +TimerHandle_t sOTAInitTimer = 0; +#endif + +// The OTA Init Timer is only started upon the first Thread State Change +// detected if the device is already on a Thread Network, or during the AppTask +// Init sequence if the device is not yet on a Thread Network. Once the timer +// has been started once, it does not need to be started again so the flag will +// be set to false. +bool isAppStarting = true; + +::Identify stIdentify = { SWITCH_APPLICATION_IDENTIFY_ENDPOINT, AppTask::IdentifyStartHandler, AppTask::IdentifyStopHandler, + Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator, AppTask::TriggerIdentifyEffectHandler }; + +int AppTask::StartAppTask() +{ + int ret = 0; + + sAppEventQueue = xQueueCreate(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent)); + if (sAppEventQueue == NULL) + { + PLAT_LOG("Failed to allocate app event queue"); + while (1) + ; + } + + // Start App task. + if (xTaskCreate(AppTaskMain, "APP", APP_TASK_STACK_SIZE / sizeof(StackType_t), NULL, APP_TASK_PRIORITY, &sAppTaskHandle) != + pdPASS) + { + PLAT_LOG("Failed to create app task"); + while (1) + ; + } + return ret; +} + +// Identify take action +void identify_TakeAction(void) +{ +#if (LED_ENABLE == 1) + LED_setOn(sAppGreenHandle, LED_BRIGHTNESS_MAX); + LED_startBlinking(sAppGreenHandle, 1000, LED_BLINK_FOREVER); +#endif // LED_ENABLE +} + +// Identify stop action +void identify_StopAction(void) +{ +#if (LED_ENABLE == 1) + LED_stopBlinking(sAppGreenHandle); + LED_setOff(sAppGreenHandle); +#endif // LED_ENABLE +} + +void DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg) +{ + switch (event->Type) + { + case DeviceEventType::kCHIPoBLEConnectionEstablished: + PLAT_LOG("CHIPoBLE connection established"); + break; + + case DeviceEventType::kCHIPoBLEConnectionClosed: + PLAT_LOG("CHIPoBLE disconnected"); + break; + + case DeviceEventType::kCommissioningComplete: + PLAT_LOG("Commissioning complete"); + break; + case DeviceEventType::kThreadStateChange: + PLAT_LOG("Thread State Change"); + bool isThreadAttached = ThreadStackMgrImpl().IsThreadAttached(); + + if (isThreadAttached) + { + PLAT_LOG("Device is on the Thread Network"); +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR + if (isAppStarting) + { + StartTimer(OTAREQUESTOR_INIT_TIMER_DELAY_MS); + isAppStarting = false; + } +#endif + } + break; + } +} + +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR +void OTAInitTimerEventHandler(TimerHandle_t xTimer) +{ + InitializeOTARequestor(); +} +#endif + +int AppTask::Init() +{ + cc13xx_26xxLogInit(); + + // Init Chip memory management before the stack + Platform::MemoryInit(); + + PLAT_LOG("Software Version: %d", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION); + PLAT_LOG("Software Version String: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); + + CHIP_ERROR ret = PlatformMgr().InitChipStack(); + if (ret != CHIP_NO_ERROR) + { + PLAT_LOG("PlatformMgr().InitChipStack() failed"); + while (1) + ; + } +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR + // Create FreeRTOS sw timer for OTA timer. + sOTAInitTimer = xTimerCreate("OTAInitTmr", // Just a text name, not used by the RTOS kernel + OTAREQUESTOR_INIT_TIMER_DELAY_MS, // timer period (mS) + false, // no timer reload (==one-shot) + (void *) this, // init timer id = light obj context + OTAInitTimerEventHandler // timer callback handler + ); + + if (sOTAInitTimer == NULL) + { + PLAT_LOG("sOTAInitTimer timer create failed"); + } + else + { + PLAT_LOG("sOTAInitTimer timer created successfully "); + } +#endif + + ret = ThreadStackMgr().InitThreadStack(); + if (ret != CHIP_NO_ERROR) + { + PLAT_LOG("ThreadStackMgr().InitThreadStack() failed"); + while (1) + ; + } +#if CHIP_DEVICE_CONFIG_THREAD_FTD + ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router); +#elif CHIP_CONFIG_ENABLE_ICD_SERVER + ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice); +#else + ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice); +#endif + + if (ret != CHIP_NO_ERROR) + { + PLAT_LOG("ConnectivityMgr().SetThreadDeviceType() failed"); + while (1) + ; + } + + ret = ThreadStackMgrImpl().StartThreadTask(); + if (ret != CHIP_NO_ERROR) + { + PLAT_LOG("ThreadStackMgr().StartThreadTask() failed"); + while (1) + ; + } + + // Initialize device attestation config +#ifdef CC13X4_26X4_ATTESTATION_CREDENTIALS +#ifdef CC13XX_26XX_FACTORY_DATA + SetDeviceInstanceInfoProvider(&mFactoryDataProvider); + SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); + SetCommissionableDataProvider(&mFactoryDataProvider); +#else + SetDeviceAttestationCredentialsProvider(CC13X4_26X4::GetCC13X4_26X4DacProvider()); +#endif +#else + SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); +#endif + + // Init ZCL Data Model and start server + PLAT_LOG("Initialize Server"); + static CommonCaseDeviceServerInitParams initParams; + static DefaultTestEventTriggerDelegate sTestEventTriggerDelegate{ ByteSpan(sTestEventTriggerEnableKey) }; + initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate; + (void) initParams.InitializeStaticResourcesBeforeServerInit(); + + // Initialize info provider + sExampleDeviceInfoProvider.SetStorageDelegate(initParams.persistentStorageDelegate); + SetDeviceInfoProvider(&sExampleDeviceInfoProvider); + + Server::GetInstance().Init(initParams); + + ret = PlatformMgr().StartEventLoopTask(); + if (ret != CHIP_NO_ERROR) + { + PLAT_LOG("PlatformMgr().StartEventLoopTask() failed"); + while (1) + ; + } + + PlatformMgr().AddEventHandler(DeviceEventCallback, reinterpret_cast(nullptr)); + + uiInit(); + + PlatformMgr().LockChipStack(); + { + ret = LightSwitchMgr().Init(); + } + + PlatformMgr().UnlockChipStack(); + + if (ret != CHIP_NO_ERROR) + { + PLAT_LOG("LightSwitchMgr().Init() failed"); + while (1) + ; + } + + LightSwitchMgr().SetCallbacks(ActionInitiated, ActionCompleted); + + ConfigurationMgr().LogDeviceConfig(); + + bool isThreadEnabled = ThreadStackMgrImpl().IsThreadEnabled(); + if (!isThreadEnabled && isAppStarting) + { +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR + PLAT_LOG("Thread is Disabled, enable OTA Requestor"); + StartTimer(OTAREQUESTOR_INIT_TIMER_DELAY_MS); + isAppStarting = false; +#endif + } + + // QR code will be used with CHIP Tool + PrintOnboardingCodes(RendezvousInformationFlags(RendezvousInformationFlag::kBLE)); + + return 0; +} + +void AppTask::AppTaskMain(void * pvParameter) +{ + AppEvent event; + + sAppTask.Init(); + + while (1) + { + /* Task pend until we have stuff to do */ + if (xQueueReceive(sAppEventQueue, &event, portMAX_DELAY) == pdTRUE) + { + sAppTask.DispatchEvent(&event); + } + } +} + +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR +void StartTimer(uint32_t aTimeoutMs) +{ + PLAT_LOG("Start OTA Init Timer") + if (xTimerIsTimerActive(sOTAInitTimer)) + { + PLAT_LOG("app timer already started!"); + CancelTimer(); + } + + // timer is not active, change its period to required value (== restart). + // FreeRTOS- Block for a maximum of 100 ticks if the change period command + // cannot immediately be sent to the timer command queue. + if (xTimerChangePeriod(sOTAInitTimer, pdMS_TO_TICKS(aTimeoutMs), 100) != pdPASS) + { + PLAT_LOG("sOTAInitTimer timer start() failed"); + } +} + +void CancelTimer(void) +{ + if (xTimerStop(sOTAInitTimer, 0) == pdFAIL) + { + PLAT_LOG("sOTAInitTimer stop() failed"); + } +} +#endif +void AppTask::ActionInitiated(LightSwitchManager::Action_t aAction, int32_t aActor) +{ + if (aAction == LightSwitchManager::SWITCH_ON_ACTION) + { + uiSwitchOnStart(); + } + else if (aAction == LightSwitchManager::SWITCH_OFF_ACTION) + { + uiSwitchOffStart(); + } +} + +void AppTask::ActionCompleted(LightSwitchManager::Action_t aAction) +{ + if (aAction == LightSwitchManager::SWITCH_ON_ACTION) + { + uiSwitchOnDone(); + } + else if (aAction == LightSwitchManager::SWITCH_OFF_ACTION) + { + uiSwitchOffDone(); + } +} + +void AppTask::PostEvent(const AppEvent * aEvent) +{ + if (sAppEventQueue != NULL) + { + BaseType_t status; + if (xPortIsInsideInterrupt()) + { + BaseType_t higherPrioTaskWoken = pdFALSE; + status = xQueueSendFromISR(sAppEventQueue, aEvent, &higherPrioTaskWoken); + +#ifdef portYIELD_FROM_ISR + portYIELD_FROM_ISR(higherPrioTaskWoken); +#elif portEND_SWITCHING_ISR // portYIELD_FROM_ISR or portEND_SWITCHING_ISR + portEND_SWITCHING_ISR(higherPrioTaskWoken); +#else // portYIELD_FROM_ISR or portEND_SWITCHING_ISR +#error "Must have portYIELD_FROM_ISR or portEND_SWITCHING_ISR" +#endif // portYIELD_FROM_ISR or portEND_SWITCHING_ISR + } + else + { + status = xQueueSend(sAppEventQueue, aEvent, 1); + } + + if (status != pdTRUE) + { + PLAT_LOG("Failed to post event to app task event queue"); + } + } + else + { + PLAT_LOG("Event Queue is NULL should never happen"); + } +} + +void AppTask::DispatchEvent(AppEvent * aEvent) +{ + int32_t actor; + + switch (aEvent->Type) + { + case AppEvent::kEventType_ButtonLeft: + if (AppEvent::kAppEventButtonType_Clicked == aEvent->ButtonEvent.Type) + { + actor = AppEvent::kEventType_ButtonLeft; + LightSwitchMgr().InitiateAction(actor, LightSwitchManager::SWITCH_OFF_ACTION); + } + else if (AppEvent::kAppEventButtonType_LongClicked == aEvent->ButtonEvent.Type) + { + chip::Server::GetInstance().ScheduleFactoryReset(); + } + break; + + case AppEvent::kEventType_ButtonRight: + if (AppEvent::kAppEventButtonType_Clicked == aEvent->ButtonEvent.Type) + { + actor = AppEvent::kEventType_ButtonRight; + LightSwitchMgr().InitiateAction(actor, LightSwitchManager::SWITCH_ON_ACTION); + } + else if (AppEvent::kAppEventButtonType_LongClicked == aEvent->ButtonEvent.Type) + { + // Enable BLE advertisements + if (!ConnectivityMgr().IsBLEAdvertisingEnabled()) + { + if (Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() == CHIP_NO_ERROR) + { + PLAT_LOG("Enabled BLE Advertisements"); + } + else + { + PLAT_LOG("OpenBasicCommissioningWindow() failed"); + } + } + else + { + // Disable BLE advertisements + ConnectivityMgr().SetBLEAdvertisingEnabled(false); + PLAT_LOG("Disabled BLE Advertisements"); + } + } + break; + + case AppEvent::kEventType_IdentifyStart: + switch (identify_trigger_effect) + { + case IDENTIFY_TRIGGER_EFFECT_BLINK: + identify_TakeAction(); + break; + case IDENTIFY_TRIGGER_EFFECT_BREATHE: + identify_TakeAction(); + break; + case IDENTIFY_TRIGGER_EFFECT_OKAY: + identify_TakeAction(); + break; + default: + break; + } + PLAT_LOG("Identify started"); + break; + + case AppEvent::kEventType_Identify: + // blink LED + PLAT_LOG("Identify cmd received, will blink green led three times now"); +#if (LED_ENABLE == 1) + LED_startBlinking(sAppGreenHandle, 250, 3); +#endif + break; + + case AppEvent::kEventType_IdentifyStop: +#if (LED_ENABLE == 1) + LED_stopBlinking(sAppGreenHandle); + LED_setOff(sAppGreenHandle); +#endif + PLAT_LOG("Identify stopped"); + break; + + case AppEvent::kEventType_AppEvent: + if (NULL != aEvent->Handler) + { + aEvent->Handler(aEvent); + } + break; + + case AppEvent::kEventType_None: + default: + break; + } +} + +void AppTask::IdentifyStartHandler(::Identify *) +{ + AppEvent event; + event.Type = AppEvent::kEventType_IdentifyStart; + sAppTask.PostEvent(&event); +} + +void AppTask::IdentifyStopHandler(::Identify *) +{ + AppEvent event; + event.Type = AppEvent::kEventType_IdentifyStop; + sAppTask.PostEvent(&event); +} + +void AppTask::TriggerIdentifyEffectHandler(::Identify * identify) +{ + switch (identify->mCurrentEffectIdentifier) + { + case Clusters::Identify::EffectIdentifierEnum::kBlink: + PLAT_LOG("Starting blink identifier effect"); + identify_trigger_effect = IDENTIFY_TRIGGER_EFFECT_BLINK; + IdentifyStartHandler(identify); + break; + case Clusters::Identify::EffectIdentifierEnum::kBreathe: + PLAT_LOG("Starting breathe identifier effect"); + identify_trigger_effect = IDENTIFY_TRIGGER_EFFECT_BREATHE; + IdentifyStartHandler(identify); + break; + case Clusters::Identify::EffectIdentifierEnum::kOkay: + PLAT_LOG("Starting okay identifier effect"); + identify_trigger_effect = IDENTIFY_TRIGGER_EFFECT_OKAY; + IdentifyStartHandler(identify); + break; + case Clusters::Identify::EffectIdentifierEnum::kChannelChange: + PLAT_LOG("Channel Change identifier effect not implemented"); + break; + case Clusters::Identify::EffectIdentifierEnum::kFinishEffect: + PLAT_LOG("Finish identifier effect"); + identify_trigger_effect = IDENTIFY_TRIGGER_EFFECT_FINISH_STOP; + IdentifyStopHandler(identify); + break; + case Clusters::Identify::EffectIdentifierEnum::kStopEffect: + PLAT_LOG("Stop identifier effect"); + identify_trigger_effect = IDENTIFY_TRIGGER_EFFECT_FINISH_STOP; + IdentifyStopHandler(identify); + break; + default: + PLAT_LOG("No identifier effect"); + } +} + +#if (BUTTON_ENABLE == 1) +void AppTask::ButtonLeftEventHandler(Button_Handle handle, Button_EventMask events) +{ + AppEvent event; + event.Type = AppEvent::kEventType_ButtonLeft; + + if (events & Button_EV_CLICKED) + { + event.ButtonEvent.Type = AppEvent::kAppEventButtonType_Clicked; + } + else if (events & Button_EV_LONGCLICKED) + { + event.ButtonEvent.Type = AppEvent::kAppEventButtonType_LongClicked; + } + // button callbacks are in ISR context + if (xQueueSendFromISR(sAppEventQueue, &event, NULL) != pdPASS) + { + /* Failed to post the message */ + } +} + +void AppTask::ButtonRightEventHandler(Button_Handle handle, Button_EventMask events) +{ + AppEvent event; + event.Type = AppEvent::kEventType_ButtonRight; + + if (events & Button_EV_CLICKED) + { + event.ButtonEvent.Type = AppEvent::kAppEventButtonType_Clicked; + } + else if (events & Button_EV_LONGCLICKED) + { + event.ButtonEvent.Type = AppEvent::kAppEventButtonType_LongClicked; + } + // button callbacks are in ISR context + if (xQueueSendFromISR(sAppEventQueue, &event, NULL) != pdPASS) + { + /* Failed to post the message */ + } +} +#endif // BUTTON_ENABLE + +// Action initiated callback +void uiSwitchOnStart(void) +{ + PLAT_LOG("Switch On initiated"); +} + +// Action completed callback +void uiSwitchOnDone(void) +{ + PLAT_LOG("Switch On completed"); +} + +// Action initiated callback +void uiSwitchOffStart(void) +{ + PLAT_LOG("Switch Off initiated"); +} + +// Action completed callback +void uiSwitchOffDone(void) +{ + PLAT_LOG("Switch Off completed"); +} + +void AppTask::uiInit(void) +{ +#if (LED_ENABLE == 1) + + LED_Params ledParams; + + // Initialize LEDs + PLAT_LOG("Initialize LEDs"); + LED_init(); + + LED_Params_init(&ledParams); // default PWM LED + sAppRedHandle = LED_open(CONFIG_LED_RED, &ledParams); + LED_setOff(sAppRedHandle); + + LED_Params_init(&ledParams); // default PWM LED + sAppGreenHandle = LED_open(CONFIG_LED_GREEN, &ledParams); + LED_setOff(sAppGreenHandle); +#endif // LED ENABLE + +#if (BUTTON_ENABLE == 1) + Button_Params buttonParams; + + // Initialize buttons + PLAT_LOG("Initialize buttons"); + Button_init(); + + Button_Params_init(&buttonParams); + buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED; + buttonParams.longPressDuration = 1000U; // ms + sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, &buttonParams); + Button_setCallback(sAppLeftHandle, ButtonLeftEventHandler); + + Button_Params_init(&buttonParams); + buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED; + buttonParams.longPressDuration = 1000U; // ms + sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, &buttonParams); + Button_setCallback(sAppRightHandle, ButtonRightEventHandler); +#endif // BUTTON ENABLE +} diff --git a/examples/light-switch-app/cc13x4_26x4/src/AppTask.h b/examples/light-switch-app/cc13x4_26x4/src/AppTask.h new file mode 100644 index 00000000000000..85eb6e5203ead0 --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/src/AppTask.h @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include "FreeRTOS.h" +#include "semphr.h" +#include "task.h" + +#include "AppEvent.h" +#include "LightSwitchManager.h" + +#include + +#ifdef CC13XX_26XX_FACTORY_DATA +#include +#endif + +// Application-defined error codes in the CHIP_ERROR space. +#define APP_ERROR_EVENT_QUEUE_FAILED CHIP_APPLICATION_ERROR(0x01) +#define APP_ERROR_CREATE_TASK_FAILED CHIP_APPLICATION_ERROR(0x02) +#define APP_ERROR_UNHANDLED_EVENT CHIP_APPLICATION_ERROR(0x03) +#define APP_ERROR_CREATE_TIMER_FAILED CHIP_APPLICATION_ERROR(0x04) +#define APP_ERROR_START_TIMER_FAILED CHIP_APPLICATION_ERROR(0x05) +#define APP_ERROR_STOP_TIMER_FAILED CHIP_APPLICATION_ERROR(0x06) +#define APP_ERROR_ALLOCATION_FAILED CHIP_APPLICATION_ERROR(0x07) + +struct Identify; + +class AppTask +{ + +public: + int StartAppTask(); + static void AppTaskMain(void * pvParameter); + + static AppTask & GetAppTask() { return sAppTask; } + void PostEvent(const AppEvent * event); + + static void IdentifyStartHandler(::Identify *); + static void IdentifyStopHandler(::Identify *); + static void TriggerIdentifyEffectHandler(::Identify * identify); + +private: + friend AppTask & GetAppTask(void); + + int Init(); + + static void ActionInitiated(LightSwitchManager::Action_t aAction, int32_t aActor); + static void ActionCompleted(LightSwitchManager::Action_t aAction); + + void DispatchEvent(AppEvent * event); + void uiInit(void); + static void ButtonLeftEventHandler(Button_Handle handle, Button_EventMask events); + static void ButtonRightEventHandler(Button_Handle handle, Button_EventMask events); + static void TimerEventHandler(void * p_context); + + enum Function_t + { + kFunction_NoneSelected = 0, + kFunction_SoftwareUpdate = 0, + kFunction_FactoryReset, + + kFunction_Invalid + } Function; + + Function_t mFunction; + bool mFunctionTimerActive; + + static AppTask sAppTask; + + // bool mSyncClusterToButtonAction; +#ifdef CC13XX_26XX_FACTORY_DATA + chip::DeviceLayer::FactoryDataProvider mFactoryDataProvider; +#endif +}; + +inline AppTask & GetAppTask(void) +{ + return AppTask::sAppTask; +} diff --git a/examples/light-switch-app/cc13x4_26x4/src/BindingHandler.cpp b/examples/light-switch-app/cc13x4_26x4/src/BindingHandler.cpp new file mode 100644 index 00000000000000..67fd1c9ed1dbea --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/src/BindingHandler.cpp @@ -0,0 +1,163 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "BindingHandler.h" + +#include "AppConfig.h" +#include "app/CommandSender.h" +#include "app/clusters/bindings/BindingManager.h" +#include "app/server/Server.h" +#include "controller/InvokeInteraction.h" +#include "platform/CHIPDeviceLayer.h" +#include +#include +#include + +using namespace chip; +using namespace chip::app; + +namespace { + +void ProcessOnOffUnicastBindingCommand(CommandId commandId, const EmberBindingTableEntry & binding, + Messaging::ExchangeManager * exchangeMgr, const SessionHandle & sessionHandle) +{ + auto onSuccess = [](const ConcreteCommandPath & commandPath, const StatusIB & status, const auto & dataResponse) { + ChipLogProgress(NotSpecified, "OnOff command succeeds"); + }; + auto onFailure = [](CHIP_ERROR error) { + ChipLogError(NotSpecified, "OnOff command failed: %" CHIP_ERROR_FORMAT, error.Format()); + }; + + switch (commandId) + { + case Clusters::OnOff::Commands::Toggle::Id: + Clusters::OnOff::Commands::Toggle::Type toggleCommand; + Controller::InvokeCommandRequest(exchangeMgr, sessionHandle, binding.remote, toggleCommand, onSuccess, onFailure); + break; + + case Clusters::OnOff::Commands::On::Id: + Clusters::OnOff::Commands::On::Type onCommand; + Controller::InvokeCommandRequest(exchangeMgr, sessionHandle, binding.remote, onCommand, onSuccess, onFailure); + break; + + case Clusters::OnOff::Commands::Off::Id: + Clusters::OnOff::Commands::Off::Type offCommand; + Controller::InvokeCommandRequest(exchangeMgr, sessionHandle, binding.remote, offCommand, onSuccess, onFailure); + break; + } +} + +void ProcessOnOffGroupBindingCommand(CommandId commandId, const EmberBindingTableEntry & binding) +{ + Messaging::ExchangeManager & exchangeMgr = Server::GetInstance().GetExchangeManager(); + switch (commandId) + { + case Clusters::OnOff::Commands::Toggle::Id: + Clusters::OnOff::Commands::Toggle::Type toggleCommand; + Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, toggleCommand); + break; + + case Clusters::OnOff::Commands::On::Id: + Clusters::OnOff::Commands::On::Type onCommand; + Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, onCommand); + + break; + + case Clusters::OnOff::Commands::Off::Id: + Clusters::OnOff::Commands::Off::Type offCommand; + Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, offCommand); + break; + } +} + +void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, OperationalDeviceProxy * peer_device, void * context) +{ + VerifyOrReturn(context != nullptr, ChipLogError(NotSpecified, "OnDeviceConnectedFn: context is null")); + BindingCommandData * data = static_cast(context); + if (binding.type == MATTER_MULTICAST_BINDING && data->isGroup) + { + switch (data->clusterId) + { + case Clusters::OnOff::Id: + + ProcessOnOffGroupBindingCommand(data->commandId, binding); + + break; + } + } + else if (binding.type == MATTER_UNICAST_BINDING && !data->isGroup) + { + switch (data->clusterId) + { + case Clusters::OnOff::Id: + VerifyOrDie(peer_device != nullptr && peer_device->ConnectionReady()); + ProcessOnOffUnicastBindingCommand(data->commandId, binding, peer_device->GetExchangeManager(), + peer_device->GetSecureSession().Value()); + break; + } + } +} + +void LightSwitchContextReleaseHandler(void * context) +{ + VerifyOrReturn(context != nullptr, ChipLogError(NotSpecified, "LightSwitchContextReleaseHandler: context is null")); + Platform::Delete(static_cast(context)); +} + +void InitBindingHandlerInternal(intptr_t arg) +{ + ChipLogProgress(NotSpecified, "Initializing Binding Handler"); + auto & server = chip::Server::GetInstance(); + if (CHIP_NO_ERROR != + BindingManager::GetInstance().Init( + { &server.GetFabricTable(), server.GetCASESessionManager(), &server.GetPersistentStorage() })) + { + ChipLogError(NotSpecified, "InitBindingHandlerInternal failed"); + } + chip::BindingManager::GetInstance().RegisterBoundDeviceChangedHandler(LightSwitchChangedHandler); + chip::BindingManager::GetInstance().RegisterBoundDeviceContextReleaseHandler(LightSwitchContextReleaseHandler); +} + +} // namespace + +/******************************************************** + * Switch functions + *********************************************************/ + +void SwitchWorkerFunction(intptr_t context) +{ + VerifyOrReturn(context != 0, ChipLogError(NotSpecified, "SwitchWorkerFunction - Invalid work data")); + BindingCommandData * data = reinterpret_cast(context); + BindingManager::GetInstance().NotifyBoundClusterChanged(data->localEndpointId, data->clusterId, static_cast(data)); +} + +void BindingWorkerFunction(intptr_t context) +{ + VerifyOrReturn(context != 0, ChipLogError(NotSpecified, "BindingWorkerFunction - Invalid work data")); + EmberBindingTableEntry * entry = reinterpret_cast(context); + AddBindingEntry(*entry); + Platform::Delete(entry); +} + +CHIP_ERROR InitBindingHandler() +{ + // The initialization of binding manager will try establishing connection with unicast peers + // so it requires the Server instance to be correctly initialized. Post the init function to + // the event queue so that everything is ready when initialization is conducted. + chip::DeviceLayer::PlatformMgr().ScheduleWork(InitBindingHandlerInternal); + return CHIP_NO_ERROR; +} diff --git a/examples/light-switch-app/cc13x4_26x4/src/BindingHandler.h b/examples/light-switch-app/cc13x4_26x4/src/BindingHandler.h new file mode 100644 index 00000000000000..aed08be25eb5bc --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/src/BindingHandler.h @@ -0,0 +1,33 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include "app-common/zap-generated/ids/Clusters.h" +#include "app-common/zap-generated/ids/Commands.h" +#include "lib/core/CHIPError.h" + +CHIP_ERROR InitBindingHandler(); +void SwitchWorkerFunction(intptr_t context); +void BindingWorkerFunction(intptr_t context); + +struct BindingCommandData +{ + chip::EndpointId localEndpointId = 1; + chip::CommandId commandId; + chip::ClusterId clusterId; + bool isGroup = false; +}; diff --git a/examples/light-switch-app/cc13x4_26x4/src/LightSwitchManager.cpp b/examples/light-switch-app/cc13x4_26x4/src/LightSwitchManager.cpp new file mode 100644 index 00000000000000..020378f3e388f9 --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/src/LightSwitchManager.cpp @@ -0,0 +1,193 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "LightSwitchManager.h" +#include "BindingHandler.h" + +#include "AppConfig.h" +#include "AppTask.h" +#include + +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace ::chip::DeviceLayer; + +LightSwitchManager LightSwitchManager::sLightSwitch; + +TimerHandle_t sSwitchTimer; + +CHIP_ERROR LightSwitchManager::Init() +{ + // Create FreeRTOS sw timer for light timer. + sSwitchTimer = xTimerCreate("switchTmr", // Just a text name, not used by the RTOS kernel + 1, // == default timer period (mS) + false, // no timer reload (==one-shot) + (void *) this, // init timer id = light obj context + TimerEventHandler // timer callback handler + ); + + if (sSwitchTimer == NULL) + { + PLAT_LOG("sSwitchTimer timer create failed"); + return APP_ERROR_CREATE_TIMER_FAILED; + } + + // Configure Bindings + CHIP_ERROR error = InitBindingHandler(); + if (error != CHIP_NO_ERROR) + { + PLAT_LOG("InitBindingHandler() failed!"); + return APP_ERROR_CREATE_TIMER_FAILED; + } + + mState = kState_SwitchOffCompleted; + + return CHIP_NO_ERROR; +} + +void LightSwitchManager::SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB) +{ + mActionInitiated_CB = aActionInitiated_CB; + mActionCompleted_CB = aActionCompleted_CB; +} + +bool LightSwitchManager::InitiateAction(int32_t aActor, Action_t aAction) +{ + bool action_initiated = false; + + State_t new_state; + + BindingCommandData * data = Platform::New(); + + data->clusterId = chip::app::Clusters::OnOff::Id; + + // need to create logic to separate this + data->isGroup = false; + + // Initiate Switch On/Off Action only when the previous one is complete. + if ((mState == kState_SwitchOffCompleted || mState == kState_SwitchOnCompleted) && aAction == SWITCH_ON_ACTION) + { + action_initiated = true; + new_state = kState_SwitchOnInitiated; + data->commandId = chip::app::Clusters::OnOff::Commands::On::Id; + } + else if ((mState == kState_SwitchOffCompleted || mState == kState_SwitchOnCompleted) && aAction == SWITCH_OFF_ACTION) + { + action_initiated = true; + new_state = kState_SwitchOffInitiated; + data->commandId = chip::app::Clusters::OnOff::Commands::Off::Id; + } + + if (action_initiated) + { + StartTimer(ACTUATOR_MOVEMENT_PERIOD_MS); + // Since the timer started successfully, update the state and trigger callback + mState = new_state; + + if (mActionInitiated_CB) + { + mActionInitiated_CB(aAction, aActor); + } + } + // Platform::Delete(data); + return action_initiated; +} + +void LightSwitchManager::StartTimer(uint32_t aTimeoutMs) +{ + if (xTimerIsTimerActive(sSwitchTimer)) + { + PLAT_LOG("app timer already started!"); + CancelTimer(); + } + // timer is not active, change its period to required value (== restart). + // FreeRTOS- Block for a maximum of 100 ticks if the change period command + // cannot immediately be sent to the timer command queue. + if (xTimerChangePeriod(sSwitchTimer, pdMS_TO_TICKS(aTimeoutMs), 100) != pdPASS) + { + PLAT_LOG("sSwitchTimer timer start() failed"); + } +} + +void LightSwitchManager::CancelTimer(void) +{ + if (xTimerStop(sSwitchTimer, 0) == pdFAIL) + { + PLAT_LOG("sSwitchTimer stop() failed"); + } +} + +void LightSwitchManager::TimerEventHandler(TimerHandle_t xTimer) +{ + // Get light obj context from timer id. + LightSwitchManager * lightswitch = static_cast(pvTimerGetTimerID(xTimer)); + // The timer event handler will be called in the context of the timer task + // once sLightTimer expires. Post an event to apptask queue with the actual handler + // so that the event can be handled in the context of the apptask. + AppEvent event; + event.Type = AppEvent::kEventType_AppEvent; + event.LightSwitchEvent.Context = lightswitch; + event.Handler = ActuatorMovementTimerEventHandler; + AppTask::GetAppTask().PostEvent(&event); +} + +void LightSwitchManager::ActuatorMovementTimerEventHandler(AppEvent * aEvent) +{ + Action_t actionCompleted = INVALID_ACTION; + BindingCommandData * data = Platform::New(); + data->clusterId = chip::app::Clusters::OnOff::Id; + + LightSwitchManager * lightswitch = static_cast(aEvent->LightSwitchEvent.Context); + if (lightswitch->mState == kState_SwitchOffInitiated) + { + lightswitch->mState = kState_SwitchOffCompleted; + actionCompleted = SWITCH_OFF_ACTION; + data->commandId = chip::app::Clusters::OnOff::Commands::Off::Id; + } + else if (lightswitch->mState == kState_SwitchOnInitiated) + { + lightswitch->mState = kState_SwitchOnCompleted; + actionCompleted = SWITCH_ON_ACTION; + data->commandId = chip::app::Clusters::OnOff::Commands::On::Id; + } + + if (actionCompleted != INVALID_ACTION) + { + DeviceLayer::PlatformMgr().ScheduleWork(SwitchWorkerFunction, reinterpret_cast(data)); + + if (lightswitch->mActionCompleted_CB) + { + lightswitch->mActionCompleted_CB(actionCompleted); + } + } +} + +void LightSwitchManager::IdentifyEventHandler() +{ + AppEvent event; + event.Type = AppEvent::kEventType_Identify; + AppTask::GetAppTask().PostEvent(&event); +} diff --git a/examples/light-switch-app/cc13x4_26x4/src/LightSwitchManager.h b/examples/light-switch-app/cc13x4_26x4/src/LightSwitchManager.h new file mode 100644 index 00000000000000..05db8172df1df4 --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/src/LightSwitchManager.h @@ -0,0 +1,87 @@ +/* + * + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include + +#include "AppEvent.h" + +#include "FreeRTOS.h" +#include "timers.h" // provides FreeRTOS timer support +#include + +#include +#include + +using namespace ::chip; + +class LightSwitchManager +{ +public: + enum Action_t + { + SWITCH_ON_ACTION = 0, + SWITCH_OFF_ACTION, + INVALID_ACTION + } Action; + + enum State_t + { + kState_SwitchOffInitiated = 0, + kState_SwitchOffCompleted, + kState_SwitchOnInitiated, + kState_SwitchOnCompleted, + } State; + + CHIP_ERROR Init(); + + bool InitiateAction(int32_t aActor, Action_t aAction); + + typedef void (*Callback_fn_initiated)(Action_t, int32_t aActor); + typedef void (*Callback_fn_completed)(Action_t); + void SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB); + + bool SwitchOn(chip::EndpointId endpointId); + bool SwitchOff(chip::EndpointId endpointId); + + void IdentifyEventHandler(); + +private: + friend LightSwitchManager & LightSwitchMgr(void); + State_t mState; + + Callback_fn_initiated mActionInitiated_CB; + Callback_fn_completed mActionCompleted_CB; + + void CancelTimer(void); + void StartTimer(uint32_t aTimeoutMs); + + static void TimerEventHandler(TimerHandle_t xTimer); + static void ActuatorMovementTimerEventHandler(AppEvent * aEvent); + + static LightSwitchManager sLightSwitch; +}; + +inline LightSwitchManager & LightSwitchMgr(void) +{ + return LightSwitchManager::sLightSwitch; +} diff --git a/examples/light-switch-app/cc13x4_26x4/src/ZclCallbacks.cpp b/examples/light-switch-app/cc13x4_26x4/src/ZclCallbacks.cpp new file mode 100644 index 00000000000000..0ef772323fe39c --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/src/ZclCallbacks.cpp @@ -0,0 +1,57 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file implements the handler for data model messages. + */ + +#include "AppConfig.h" +#include "LightSwitchManager.h" + +#include +#include +#include +#include + +using namespace ::chip; +using namespace ::chip::app::Clusters; + +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, + uint8_t * value) +{ + ClusterId clusterId = attributePath.mClusterId; + AttributeId attributeId = attributePath.mAttributeId; + (void) attributeId; + ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); + + if (clusterId == OnOffSwitchConfiguration::Id) + { + ChipLogProgress(Zcl, "OnOffSwitchConfiguration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", + ChipLogValueMEI(attributeId), type, *value, size); + } + else if (clusterId == Identify::Id) + { + ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", + ChipLogValueMEI(attributeId), type, *value, size); + } + else if (clusterId == Groups::Id) + { + ChipLogProgress(Zcl, "Groups attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", + ChipLogValueMEI(attributeId), type, *value, size); + } +} diff --git a/examples/light-switch-app/cc13x4_26x4/src/main.cpp b/examples/light-switch-app/cc13x4_26x4/src/main.cpp new file mode 100644 index 00000000000000..d2635ed96e2e28 --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/src/main.cpp @@ -0,0 +1,96 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include + +#include "AppConfig.h" +#include "AppTask.h" + +#include + +/* Driver Header files */ +#include +#include +#include + +#include +#include +#include +#include + +#include +#define TOTAL_ICALL_HEAP_SIZE (0xc600) + +using namespace ::chip; +using namespace ::chip::Inet; +using namespace ::chip::DeviceLayer; + +__attribute__((section(".heap"))) uint8_t GlobalHeapZoneBuffer[TOTAL_ICALL_HEAP_SIZE]; +uint32_t heapSize = TOTAL_ICALL_HEAP_SIZE; + +// ================================================================================ +// FreeRTOS Callbacks +// ================================================================================ +/* Wrapper functions for using the queue registry regardless of whether it is enabled or disabled */ +extern "C" void vQueueAddToRegistryWrapper(QueueHandle_t xQueue, const char * pcQueueName) +{ + /* This function is intentionally left empty as the Queue Registry is disabled */ +} + +extern "C" void vQueueUnregisterQueueWrapper(QueueHandle_t xQueue) +{ + /* This function is intentionally left empty as the Queue Registry is disabled */ +} + +// ================================================================================ +// Main Code +// ================================================================================ +int main(void) +{ + Board_init(); + bpool((void *) GlobalHeapZoneBuffer, TOTAL_ICALL_HEAP_SIZE); + + GPIO_init(); + + NVS_init(); + + ECDH_init(); + + ECDSA_init(); + + AESECB_init(); + + SHA2_init(); + + int ret = GetAppTask().StartAppTask(); + if (ret != 0) + { + // can't log until the kernel is started + // PLAT_LOG("GetAppTask().StartAppTask() failed"); + while (1) + ; + } + + vTaskStartScheduler(); + + // Should never get here. + while (1) + ; +} diff --git a/examples/light-switch-app/cc13x4_26x4/third_party/connectedhomeip b/examples/light-switch-app/cc13x4_26x4/third_party/connectedhomeip new file mode 120000 index 00000000000000..c866b86874994d --- /dev/null +++ b/examples/light-switch-app/cc13x4_26x4/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../.. \ No newline at end of file From 7705be9b28c079f9d899b925d1bcf59e2d838e12 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 19 Aug 2024 09:37:08 -0700 Subject: [PATCH 02/52] [Fabric-Admin] Fix the new added device failed to get reported (#35058) * [Fabric-Admin] Fix the new added device failed to get reported * Restyled by prettier-markdown --------- Co-authored-by: Restyled.io --- docs/guides/fabric_synchronization_guide.md | 10 ++++++++-- examples/fabric-admin/device_manager/DeviceManager.cpp | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/guides/fabric_synchronization_guide.md b/docs/guides/fabric_synchronization_guide.md index 5944105512776d..50fa3202f8ba84 100644 --- a/docs/guides/fabric_synchronization_guide.md +++ b/docs/guides/fabric_synchronization_guide.md @@ -98,6 +98,12 @@ Run the Fabric Synchronization script: In Ecosystem 1 Fabric-Admin console: +Pair the local bridge of Ecosystem 1 with node ID 1: + +``` +fabricsync add-local-bridge 1 +``` + Pair the Ecosystem 2 bridge to Ecosystem 1 with node ID 2: ``` @@ -130,8 +136,8 @@ Pair the Light Example with node ID 3 using its payload number: pairing already-discovered 3 20202021 5543 ``` -After the device is successfully added, you will observe the following on -Ecosystem 2 with the newly assigned Node ID: +After the device is successfully added, you will observe the following message +on Ecosystem 2 with the newly assigned Node ID: ``` >>> New device with Node ID: 0x3 has been successfully added. diff --git a/examples/fabric-admin/device_manager/DeviceManager.cpp b/examples/fabric-admin/device_manager/DeviceManager.cpp index fe0c8aea4da5cb..56f8591ab54e13 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.cpp +++ b/examples/fabric-admin/device_manager/DeviceManager.cpp @@ -215,8 +215,8 @@ void DeviceManager::SubscribeRemoteFabricBridge() // Prepare and push the commissioner control subscribe command commandBuilder.Add("commissionercontrol subscribe-event commissioning-request-result "); - commandBuilder.AddFormat("%d %d %lu %d --is-urgent true", kSubscribeMinInterval, kSubscribeMaxInterval, mRemoteBridgeNodeId, - kRootEndpointId); + commandBuilder.AddFormat("%d %d %lu %d --is-urgent true --keepSubscriptions true", kSubscribeMinInterval, kSubscribeMaxInterval, + mRemoteBridgeNodeId, kRootEndpointId); PushCommand(commandBuilder.c_str()); } @@ -413,7 +413,7 @@ void DeviceManager::HandleAttributeData(const app::ConcreteDataAttributePath & p for (const auto & endpoint : addedEndpoints) { // print to console - fprintf(stderr, "A new devie is added on Endpoint: %u\n", endpoint); + fprintf(stderr, "A new device is added on Endpoint: %u\n", endpoint); if (mAutoSyncEnabled) { From baba33d9ac6cce2508c86cb102504e62913a17ef Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 19 Aug 2024 09:57:02 -0700 Subject: [PATCH 03/52] Fix failed to sync device when using dynamic setupPIN (#35061) --- examples/fabric-admin/device_manager/DeviceManager.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/fabric-admin/device_manager/DeviceManager.cpp b/examples/fabric-admin/device_manager/DeviceManager.cpp index 56f8591ab54e13..849d557f0be81d 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.cpp +++ b/examples/fabric-admin/device_manager/DeviceManager.cpp @@ -144,7 +144,6 @@ void DeviceManager::OpenRemoteDeviceCommissioningWindow(EndpointId remoteEndpoin commandBuilder.Add("pairing open-commissioning-window "); commandBuilder.AddFormat("%lu %d %d %d %d %d", mRemoteBridgeNodeId, remoteEndpointId, kEnhancedCommissioningMethod, kWindowTimeout, kIteration, discriminator); - commandBuilder.Add(" --setup-pin 20202021"); PushCommand(commandBuilder.c_str()); } From b7b67388b4da84182abef13f9bfe8421551a51e8 Mon Sep 17 00:00:00 2001 From: Kiel Oleson Date: Mon, 19 Aug 2024 10:08:13 -0700 Subject: [PATCH 04/52] improve `MTRDeviceController`/`_Concrete` (#35060) logging --- src/darwin/Framework/CHIP/MTRDeviceController.mm | 14 +++++++------- .../CHIP/MTRDeviceController_Concrete.mm | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index bfbb62fa2fa8c8..322593312ccea4 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -306,7 +306,7 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory - (NSString *)description { - return [NSString stringWithFormat:@"", self, _uniqueIdentifier]; + return [NSString stringWithFormat:@"<%@: %p uuid %@>", NSStringFromClass(self.class), self, _uniqueIdentifier]; } - (BOOL)isRunning @@ -322,7 +322,7 @@ - (void)shutdown return; } - MTR_LOG("Shutting down MTRDeviceController: %@", self); + MTR_LOG("Shutting down %@: %@", NSStringFromClass(self.class), self); [self cleanupAfterStartup]; } @@ -334,7 +334,7 @@ - (void)cleanupAfterStartup // do the secure session shutdowns. Since we don't want to hold the lock // while calling out into arbitrary invalidation code, snapshot the list of // devices before we start invalidating. - MTR_LOG("cleanupAfterStartup MTRDeviceController: %@", self); + MTR_LOG("%s: %@", __PRETTY_FUNCTION__, self); os_unfair_lock_lock(self.deviceMapLock); NSEnumerator * devices = [_nodeIDToDeviceMap objectEnumerator]; [_nodeIDToDeviceMap removeAllObjects]; @@ -352,7 +352,7 @@ - (void)cleanupAfterStartup // in a very specific way that only MTRDeviceControllerFactory knows about. - (void)shutDownCppController { - MTR_LOG("shutDownCppController MTRDeviceController: %p", self); + MTR_LOG("%s: %p", __PRETTY_FUNCTION__, self); assertChipStackLockedByCurrentThread(); // Shut down all our endpoints. @@ -659,7 +659,7 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams }); }]; } - MTR_LOG("MTRDeviceController startup: %@", self); + MTR_LOG("%@ startup: %@", NSStringFromClass(self.class), self); return YES; } @@ -1174,7 +1174,7 @@ - (BOOL)addServerEndpoint:(MTRServerEndpoint *)endpoint } if (![endpoint associateWithController:self]) { - MTR_LOG_ERROR("%@ Failed to associate MTRServerEndpoint with MTRDeviceController", self); + MTR_LOG_ERROR("%@ Failed to associate MTRServerEndpoint with %@", self, NSStringFromClass(self.class)); [_factory removeServerEndpoint:endpoint]; return NO; } @@ -1294,7 +1294,7 @@ - (BOOL)checkIsRunning:(NSError * __autoreleasing *)error return YES; } - MTR_LOG_ERROR("MTRDeviceController: %@ Error: %s", self, [kErrorNotRunning UTF8String]); + MTR_LOG_ERROR("%@: %@ Error: %s", NSStringFromClass(self.class), self, [kErrorNotRunning UTF8String]); if (error) { *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; } diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index b3152a9e34c207..0ea7bf9232d766 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -317,7 +317,7 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory - (NSString *)description { - return [NSString stringWithFormat:@"", self, _uniqueIdentifier]; + return [NSString stringWithFormat:@"<%@: %p uuid %@>", NSStringFromClass(self.class), self, _uniqueIdentifier]; } - (BOOL)isRunning @@ -333,7 +333,7 @@ - (void)shutdown return; } - MTR_LOG("Shutting down MTRDeviceController: %@", self); + MTR_LOG("Shutting down %@: %@", NSStringFromClass(self.class), self); [self cleanupAfterStartup]; } @@ -345,7 +345,7 @@ - (void)cleanupAfterStartup // do the secure session shutdowns. Since we don't want to hold the lock // while calling out into arbitrary invalidation code, snapshot the list of // devices before we start invalidating. - MTR_LOG("cleanupAfterStartup MTRDeviceController: %@", self); + MTR_LOG("%s: %@", __PRETTY_FUNCTION__, self); os_unfair_lock_lock(self.deviceMapLock); NSEnumerator * devices = [self.nodeIDToDeviceMap objectEnumerator]; [self.nodeIDToDeviceMap removeAllObjects]; @@ -363,7 +363,7 @@ - (void)cleanupAfterStartup // in a very specific way that only MTRDeviceControllerFactory knows about. - (void)shutDownCppController { - MTR_LOG("shutDownCppController MTRDeviceController: %p", self); + MTR_LOG("%s: %p", __PRETTY_FUNCTION__, self); assertChipStackLockedByCurrentThread(); // Shut down all our endpoints. @@ -668,7 +668,7 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams }); }]; } - MTR_LOG("MTRDeviceController startup: %@", self); + MTR_LOG("%s: startup: %@", __PRETTY_FUNCTION__, self); return YES; } @@ -1020,7 +1020,7 @@ - (MTRDevice *)_setupDeviceForNodeID:(NSNumber *)nodeID prefetchedClusterData:(N { os_unfair_lock_assert_owner(self.deviceMapLock); - MTRDevice * deviceToReturn = [[MTRDevice alloc] initWithNodeID:nodeID controller:self]; + MTRDevice * deviceToReturn = [[MTRDevice_Concrete alloc] initWithNodeID:nodeID controller:self]; // If we're not running, don't add the device to our map. That would // create a cycle that nothing would break. Just return the device, // which will be in exactly the state it would be in if it were created @@ -1183,7 +1183,7 @@ - (BOOL)addServerEndpoint:(MTRServerEndpoint *)endpoint } if (![endpoint associateWithController:self]) { - MTR_LOG_ERROR("%@ Failed to associate MTRServerEndpoint with MTRDeviceController", self); + MTR_LOG_ERROR("%@ Failed to associate MTRServerEndpoint with %@", self, NSStringFromClass(self.class)); [_factory removeServerEndpoint:endpoint]; return NO; } @@ -1303,7 +1303,7 @@ - (BOOL)checkIsRunning:(NSError * __autoreleasing *)error return YES; } - MTR_LOG_ERROR("MTRDeviceController: %@ Error: %s", self, [kDeviceControllerErrorNotRunning UTF8String]); + MTR_LOG_ERROR("%@: %@ Error: %s", NSStringFromClass(self.class), self, [kDeviceControllerErrorNotRunning UTF8String]); if (error) { *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; } From c4a5a95348c66f60a5a33e6ff0389e949589aaa6 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Mon, 19 Aug 2024 13:59:11 -0400 Subject: [PATCH 05/52] Updates to BRBINFO_4_1 after issues discovered during TE2 (#35040) * Updates to BRBINFO_4_1 after issues discovered during TE2 * Update test step 3 text * Restyled by autopep8 --------- Co-authored-by: Restyled.io --- src/python_testing/TC_BRBINFO_4_1.py | 96 +++++++++++++++++----------- 1 file changed, 57 insertions(+), 39 deletions(-) diff --git a/src/python_testing/TC_BRBINFO_4_1.py b/src/python_testing/TC_BRBINFO_4_1.py index 8e920d8bc6013e..ea230150c27fdb 100644 --- a/src/python_testing/TC_BRBINFO_4_1.py +++ b/src/python_testing/TC_BRBINFO_4_1.py @@ -15,10 +15,10 @@ # limitations under the License. # -# This test requires a TH_SERVER application. Please specify with --string-arg th_server_app_path: -# TH_SERVER must support following arguments: --secured-device-port --discriminator --passcode --KVS +# This test requires a TH_ICD_SERVER application. Please specify with --string-arg th_icd_server_app_path: +# TH_ICD_SERVER must support following arguments: --secured-device-port --discriminator --passcode --KVS # E.g: python3 src/python_testing/TC_BRBINFO_4_1.py --commissioning-method on-network --qr-code MT:-24J042C00KA0648G00 \ -# --string-arg th_server_app_path:out/linux-x64-lit-icd/lit-icd-app +# --string-arg th_icd_server_app_path:out/linux-x64-lit-icd/lit-icd-app import logging import os @@ -62,7 +62,8 @@ def steps_TC_BRBINFO_4_1(self) -> list[TestStep]: TestStep("1a", "TH reads from the ICD the A_IDLE_MODE_DURATION, A_ACTIVE_MODE_DURATION, and ACTIVE_MODE_THRESHOLD attributes"), TestStep("1b", "Simple KeepActive command w/ subscription. ActiveChanged event received by TH contains PromisedActiveDuration"), TestStep("2", "Sends 3x KeepActive commands w/ subscription. ActiveChanged event received ONCE and contains PromisedActiveDuration"), - TestStep("3", "KeepActive not returned after 60 minutes of offline ICD"), + TestStep("3", "TH waits for check-in from TH_ICD to confirm no additional ActiveChanged events are recieved"), + TestStep("4", "KeepActive not returned after 60 minutes of offline ICD"), ] return steps @@ -110,9 +111,10 @@ async def setup_class(self): super().setup_class() self.app_process = None - app = self.user_params.get("th_server_app_path", None) + self.app_process_paused = False + app = self.user_params.get("th_icd_server_app_path", None) if not app: - asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:') + asserts.fail('This test requires a TH_ICD_SERVER app. Specify app path with --string-arg th_icd_server_app_path:') self.kvs = f'kvs_{str(uuid.uuid4())}' self.port = 5543 @@ -129,6 +131,7 @@ async def setup_class(self): logging.info("Commissioning of ICD to fabric one (TH)") self.icd_nodeid = 1111 + self.default_controller.EnableICDRegistration(self.default_controller.GenerateICDRegistrationParameters()) await self.default_controller.CommissionOnNetwork(nodeId=self.icd_nodeid, setupPinCode=passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=discriminator) logging.info("Commissioning of ICD to fabric two (DUT)") @@ -138,9 +141,10 @@ async def setup_class(self): params.commissioningParameters.setupManualCode, params.commissioningParameters.setupQRCode) def teardown_class(self): - # In case the th_server_app_path does not exist, then we failed the test + # In case the th_icd_server_app_path does not exist, then we failed the test # and there is nothing to remove if self.app_process is not None: + self.resume_th_icd_server(check_state=False) logging.warning("Stopping app with SIGTERM") self.app_process.send_signal(signal.SIGTERM.value) self.app_process.wait() @@ -150,6 +154,24 @@ def teardown_class(self): super().teardown_class() + def pause_th_icd_server(self, check_state): + if check_state: + asserts.assert_false(self.app_process_paused, "ICD TH Server unexpectedly is already paused") + if self.app_process_paused: + return + # stops (halts) the ICD server process by sending a SIGTOP signal + self.app_process.send_signal(signal.SIGSTOP.value) + self.app_process_paused = True + + def resume_th_icd_server(self, check_state): + if check_state: + asserts.assert_true(self.app_process_paused, "ICD TH Server unexpectedly is already running") + if not self.app_process_paused: + return + # resumes (continues) the ICD server process by sending a SIGCONT signal + self.app_process.send_signal(signal.SIGCONT.value) + self.app_process_paused = False + # # BRBINFO 4.1 Test Body # @@ -232,58 +254,54 @@ async def test_TC_BRBINFO_4_1(self): self.step("2") - stay_active_duration_ms = 1500 - logging.info(f"Sending KeepActiveCommand({stay_active_duration_ms}ms)") - await self._send_keep_active_command(stay_active_duration_ms, dynamic_endpoint_id) - - logging.info("Waiting for ActiveChanged from DUT...") - timeout_s = idle_mode_duration_s + max(active_mode_duration_ms, stay_active_duration_ms)/1000 - promised_active_duration_ms = await self._wait_for_active_changed_event(timeout_s) - - # wait for active time duration - sleep_time_s = max(stay_active_duration_ms, promised_active_duration_ms)/1000 - time.sleep(sleep_time_s) - # ICD now should be in idle mode - + # Prevent icd app from sending any check-in messages. + self.pause_th_icd_server(check_state=True) # sends 3x keep active commands - logging.info(f"Step3 Sending first KeepActiveCommand({stay_active_duration_ms})") + stay_active_duration_ms = 2000 + logging.info(f"Sending first KeepActiveCommand({stay_active_duration_ms})") await self._send_keep_active_command(stay_active_duration_ms, dynamic_endpoint_id) - time.sleep(0.1) - logging.info(f"Step3 Sending second KeepActiveCommand({stay_active_duration_ms})") + logging.info(f"Sending second KeepActiveCommand({stay_active_duration_ms})") await self._send_keep_active_command(stay_active_duration_ms, dynamic_endpoint_id) - time.sleep(0.1) - logging.info(f"Step3 Sending third KeepActiveCommand({stay_active_duration_ms})") + logging.info(f"Sending third KeepActiveCommand({stay_active_duration_ms})") await self._send_keep_active_command(stay_active_duration_ms, dynamic_endpoint_id) - time.sleep(0.1) + self.resume_th_icd_server(check_state=True) logging.info("Waiting for ActiveChanged from DUT...") promised_active_duration_ms = await self._wait_for_active_changed_event((idle_mode_duration_s + max(active_mode_duration_ms, stay_active_duration_ms))/1000) - - asserts.assert_equal(self.q.qSize(), 0, "More than one event received from DUT") + asserts.assert_equal(self.q.qsize(), 0, "More than one event received from DUT") self.step("3") + await self.default_controller.WaitForActive(self.icd_nodeid, stayActiveDurationMs=5000) + asserts.assert_equal(self.q.qsize(), 0, "More than one event received from DUT") + + self.step("4") + logging.info("TH waiting for checkin from TH_ICD...") + await self.default_controller.WaitForActive(self.icd_nodeid, stayActiveDurationMs=10000) stay_active_duration_ms = 10000 logging.info(f"Sending KeepActiveCommand({stay_active_duration_ms})") await self._send_keep_active_command(stay_active_duration_ms, dynamic_endpoint_id) - # stops (halts) the ICD server process by sending a SIGTOP signal - self.app_process.send_signal(signal.SIGSTOP.value) + self.pause_th_icd_server(check_state=True) + # If we are seeing assertion below fail test assumption is likely incorrect. + # Test assumes after TH waits for check-in from TH_ICD it has enough time to + # call the KeepActive command and pause the app to prevent it from checking in + # after DUT recieved the KeepActive command. Should this assumption be incorrect + # we could look into using existing ICDTestEventTriggerEvent, or adding test + # event trigger that will help suppress check-ins from the TH_ICD_SERVER. + asserts.assert_equal(self.q.qsize(), 0, "") if not self.is_ci: logging.info("Waiting for 60 minutes") - self._timeout time.sleep(60*60) - # resumes (continues) the ICD server process by sending a SIGCONT signal - self.app_process.send_signal(signal.SIGCONT.value) + self.resume_th_icd_server(check_state=True) - # wait for active changed event, expect no event will be sent - event_timeout = (idle_mode_duration_s + max(active_mode_duration_ms, stay_active_duration_ms))/1000 - try: - promised_active_duration_ms = self.q.get(block=True, timeout=event_timeout) - finally: - asserts.assert_true(queue.Empty(), "ActiveChanged event received when not expected") + logging.info("TH waiting for first checkin from TH_ICD...") + await self.default_controller.WaitForActive(self.icd_nodeid, stayActiveDurationMs=10000) + logging.info("TH waiting for second checkin from TH_ICD...") + await self.default_controller.WaitForActive(self.icd_nodeid, stayActiveDurationMs=10000) + asserts.assert_equal(self.q.qsize(), 0, "More than one event received from DUT") if __name__ == "__main__": From 96ee61efe249438fd01055736921dfa9520706db Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Mon, 19 Aug 2024 14:30:25 -0400 Subject: [PATCH 06/52] Add fabric scoping to ECOINFO cluster attributes (#35022) --------- Co-authored-by: Restyled.io Co-authored-by: Andrei Litvin --- .../ecosystem-information-server.cpp | 40 +++++++++++-------- .../ecosystem-information-server.h | 40 +++++++++++-------- 2 files changed, 47 insertions(+), 33 deletions(-) diff --git a/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp b/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp index c51a5165f3ca9d..2ce82394a57464 100644 --- a/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp +++ b/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp @@ -128,6 +128,13 @@ EcosystemDeviceStruct::Builder & EcosystemDeviceStruct::Builder::AddUniqueLocati return *this; } +EcosystemDeviceStruct::Builder & EcosystemDeviceStruct::Builder::SetFabricIndex(FabricIndex aFabricIndex) +{ + VerifyOrDie(!mIsAlreadyBuilt); + mFabricIndex = aFabricIndex; + return *this; +} + std::unique_ptr EcosystemDeviceStruct::Builder::Build() { VerifyOrReturnValue(!mIsAlreadyBuilt, nullptr, ChipLogError(Zcl, "Build() already called")); @@ -136,6 +143,8 @@ std::unique_ptr EcosystemDeviceStruct::Builder::Build() VerifyOrReturnValue(!mDeviceTypes.empty(), nullptr, ChipLogError(Zcl, "No device types added")); VerifyOrReturnValue(mUniqueLocationIds.size() <= kUniqueLocationIdsListMaxSize, nullptr, ChipLogError(Zcl, "Too many location ids")); + VerifyOrReturnValue(mFabricIndex >= kMinValidFabricIndex, nullptr, ChipLogError(Zcl, "Fabric index is invalid")); + VerifyOrReturnValue(mFabricIndex <= kMaxValidFabricIndex, nullptr, ChipLogError(Zcl, "Fabric index is invalid")); for (auto & locationId : mUniqueLocationIds) { @@ -145,12 +154,12 @@ std::unique_ptr EcosystemDeviceStruct::Builder::Build() // std::make_unique does not have access to private constructor we workaround with using new std::unique_ptr ret{ new EcosystemDeviceStruct( std::move(mDeviceName), mDeviceNameLastEditEpochUs, mBridgedEndpoint, mOriginalEndpoint, std::move(mDeviceTypes), - std::move(mUniqueLocationIds), mUniqueLocationIdsLastEditEpochUs) }; + std::move(mUniqueLocationIds), mUniqueLocationIdsLastEditEpochUs, mFabricIndex) }; mIsAlreadyBuilt = true; return ret; } -CHIP_ERROR EcosystemDeviceStruct::Encode(const AttributeValueEncoder::ListEncodeHelper & aEncoder, const FabricIndex & aFabricIndex) +CHIP_ERROR EcosystemDeviceStruct::Encode(const AttributeValueEncoder::ListEncodeHelper & aEncoder) { Structs::EcosystemDeviceStruct::Type deviceStruct; if (!mDeviceName.empty()) @@ -172,9 +181,7 @@ CHIP_ERROR EcosystemDeviceStruct::Encode(const AttributeValueEncoder::ListEncode deviceStruct.uniqueLocationIDs = DataModel::List(locationIds.data(), locationIds.size()); deviceStruct.uniqueLocationIDsLastEdit = mUniqueLocationIdsLastEditEpochUs; - - // TODO(#33223) this is a hack, use mFabricIndex when it exists. - deviceStruct.SetFabricIndex(aFabricIndex); + deviceStruct.SetFabricIndex(mFabricIndex); return aEncoder.Encode(deviceStruct); } @@ -226,12 +233,9 @@ CHIP_ERROR EcosystemLocationStruct::Encode(const AttributeValueEncoder::ListEnco const std::string & aUniqueLocationId, const FabricIndex & aFabricIndex) { Structs::EcosystemLocationStruct::Type locationStruct; - VerifyOrDie(!aUniqueLocationId.empty()); locationStruct.uniqueLocationID = CharSpan(aUniqueLocationId.c_str(), aUniqueLocationId.size()); locationStruct.locationDescriptor = GetEncodableLocationDescriptorStruct(mLocationDescriptor); locationStruct.locationDescriptorLastEdit = mLocationDescriptorLastEditEpochUs; - - // TODO(#33223) this is a hack, use mFabricIndex when it exists. locationStruct.SetFabricIndex(aFabricIndex); return aEncoder.Encode(locationStruct); } @@ -266,16 +270,20 @@ CHIP_ERROR EcosystemInformationServer::AddDeviceInfo(EndpointId aEndpoint, std:: } CHIP_ERROR EcosystemInformationServer::AddLocationInfo(EndpointId aEndpoint, const std::string & aLocationId, - std::unique_ptr aLocation) + FabricIndex aFabricIndex, std::unique_ptr aLocation) { VerifyOrReturnError(aLocation, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError((aEndpoint != kRootEndpointId && aEndpoint != kInvalidEndpointId), CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(!aLocationId.empty(), CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(aFabricIndex >= kMinValidFabricIndex, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(aFabricIndex <= kMaxValidFabricIndex, CHIP_ERROR_INVALID_ARGUMENT); - auto & deviceInfo = mDevicesMap[aEndpoint]; - VerifyOrReturnError((deviceInfo.mLocationDirectory.find(aLocationId) == deviceInfo.mLocationDirectory.end()), + auto & deviceInfo = mDevicesMap[aEndpoint]; + EcosystemLocationKey key = { .mUniqueLocationId = aLocationId, .mFabricIndex = aFabricIndex }; + VerifyOrReturnError((deviceInfo.mLocationDirectory.find(key) == deviceInfo.mLocationDirectory.end()), CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError((deviceInfo.mLocationDirectory.size() < kLocationDirectoryMaxSize), CHIP_ERROR_NO_MEMORY); - deviceInfo.mLocationDirectory[aLocationId] = std::move(aLocation); + deviceInfo.mLocationDirectory[key] = std::move(aLocation); return CHIP_NO_ERROR; } @@ -352,11 +360,10 @@ CHIP_ERROR EcosystemInformationServer::EncodeDeviceDirectoryAttribute(EndpointId return aEncoder.EncodeEmptyList(); } - FabricIndex fabricIndex = aEncoder.AccessingFabricIndex(); return aEncoder.EncodeList([&](const auto & encoder) -> CHIP_ERROR { for (auto & device : deviceInfo.mDeviceDirectory) { - ReturnErrorOnFailure(device->Encode(encoder, fabricIndex)); + ReturnErrorOnFailure(device->Encode(encoder)); } return CHIP_NO_ERROR; }); @@ -379,11 +386,10 @@ CHIP_ERROR EcosystemInformationServer::EncodeLocationStructAttribute(EndpointId return aEncoder.EncodeEmptyList(); } - FabricIndex fabricIndex = aEncoder.AccessingFabricIndex(); return aEncoder.EncodeList([&](const auto & encoder) -> CHIP_ERROR { - for (auto & [id, device] : deviceInfo.mLocationDirectory) + for (auto & [key, device] : deviceInfo.mLocationDirectory) { - ReturnErrorOnFailure(device->Encode(encoder, id, fabricIndex)); + ReturnErrorOnFailure(device->Encode(encoder, key.mUniqueLocationId, key.mFabricIndex)); } return CHIP_NO_ERROR; }); diff --git a/src/app/clusters/ecosystem-information-server/ecosystem-information-server.h b/src/app/clusters/ecosystem-information-server/ecosystem-information-server.h index dce12e745bf14e..d4f4d7dc3a6fc1 100644 --- a/src/app/clusters/ecosystem-information-server/ecosystem-information-server.h +++ b/src/app/clusters/ecosystem-information-server/ecosystem-information-server.h @@ -49,6 +49,7 @@ class EcosystemDeviceStruct Builder & SetOriginalEndpoint(EndpointId aOriginalEndpoint); Builder & AddDeviceType(Structs::DeviceTypeStruct::Type aDeviceType); Builder & AddUniqueLocationId(std::string aUniqueLocationId, uint64_t aUniqueLocationIdsLastEditEpochUs); + Builder & SetFabricIndex(FabricIndex aFabricIndex); // Upon success this object will have moved all ownership of underlying // types to EcosystemDeviceStruct and should not be used afterwards. @@ -62,21 +63,25 @@ class EcosystemDeviceStruct std::vector mDeviceTypes; std::vector mUniqueLocationIds; uint64_t mUniqueLocationIdsLastEditEpochUs = 0; + FabricIndex mFabricIndex = kUndefinedFabricIndex; bool mIsAlreadyBuilt = false; }; - CHIP_ERROR Encode(const AttributeValueEncoder::ListEncodeHelper & aEncoder, const FabricIndex & aFabricIndex); + CHIP_ERROR Encode(const AttributeValueEncoder::ListEncodeHelper & aEncoder); private: // Constructor is intentionally private. This is to ensure that it is only constructed with // values that conform to the spec. explicit EcosystemDeviceStruct(std::string && aDeviceName, uint64_t aDeviceNameLastEditEpochUs, EndpointId aBridgedEndpoint, EndpointId aOriginalEndpoint, std::vector && aDeviceTypes, - std::vector && aUniqueLocationIds, uint64_t aUniqueLocationIdsLastEditEpochUs) : + std::vector && aUniqueLocationIds, uint64_t aUniqueLocationIdsLastEditEpochUs, + FabricIndex aFabricIndex) : mDeviceName(std::move(aDeviceName)), mDeviceNameLastEditEpochUs(aDeviceNameLastEditEpochUs), mBridgedEndpoint(aBridgedEndpoint), mOriginalEndpoint(aOriginalEndpoint), mDeviceTypes(std::move(aDeviceTypes)), - mUniqueLocationIds(std::move(aUniqueLocationIds)), mUniqueLocationIdsLastEditEpochUs(aUniqueLocationIdsLastEditEpochUs) + mUniqueLocationIds(std::move(aUniqueLocationIds)), mUniqueLocationIdsLastEditEpochUs(aUniqueLocationIdsLastEditEpochUs), + mFabricIndex(aFabricIndex) + {} const std::string mDeviceName; @@ -86,10 +91,7 @@ class EcosystemDeviceStruct std::vector mDeviceTypes; std::vector mUniqueLocationIds; uint64_t mUniqueLocationIdsLastEditEpochUs; - // TODO(#33223) This structure needs to contain fabric index to be spec compliant. - // To keep initial PR smaller, we are going to assume that all entries - // here are for any fabric. This will allow follow up PR introducing - // fabric scoped to be more throughly reviewed with focus on fabric scoping. + FabricIndex mFabricIndex; }; struct LocationDescriptorStruct @@ -134,15 +136,11 @@ class EcosystemLocationStruct mLocationDescriptor(aLocationDescriptor), mLocationDescriptorLastEditEpochUs(aLocationDescriptorLastEditEpochUs) {} // EcosystemLocationStruct is used as a value in a key-value map. - // Because UniqueLocationId is manditory when an entry exist, and - // it is unique, we use it as a key to the key-value pair and is why it is + // Because UniqueLocationId and FabricIndex are mandatory when an entry exist, + // and needs to be unique, we use it as a key to the key-value pair and is why it is // not explicitly in this struct. LocationDescriptorStruct mLocationDescriptor; uint64_t mLocationDescriptorLastEditEpochUs; - // TODO(#33223) This structure needs to contain fabric index to be spec compliant. - // To keep initial PR smaller, we are going to assume that all entries - // here are for any fabric. This will allow follow up PR introducing - // fabric scoped to be more throughly reviewed with focus on fabric scoping. }; class EcosystemInformationServer @@ -186,7 +184,7 @@ class EcosystemInformationServer * @return #CHIP_NO_ERROR on success. * @return Other CHIP_ERROR associated with issue. */ - CHIP_ERROR AddLocationInfo(EndpointId aEndpoint, const std::string & aLocationId, + CHIP_ERROR AddLocationInfo(EndpointId aEndpoint, const std::string & aLocationId, FabricIndex aFabricIndex, std::unique_ptr aLocation); /** @@ -203,12 +201,22 @@ class EcosystemInformationServer CHIP_ERROR ReadAttribute(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder); private: + struct EcosystemLocationKey + { + bool operator<(const EcosystemLocationKey & other) const + { + return mUniqueLocationId < other.mUniqueLocationId || + (mUniqueLocationId == other.mUniqueLocationId && mFabricIndex < other.mFabricIndex); + } + std::string mUniqueLocationId; + FabricIndex mFabricIndex; + }; + struct DeviceInfo { Optional mRemovedOn = NullOptional; std::vector> mDeviceDirectory; - // Map key is using the UniqueLocationId - std::map> mLocationDirectory; + std::map> mLocationDirectory; }; CHIP_ERROR EncodeRemovedOnAttribute(EndpointId aEndpoint, AttributeValueEncoder & aEncoder); From dec73c63e0c01d8ec9aeee7285ab86b1ba351214 Mon Sep 17 00:00:00 2001 From: Harshith-GRL <145322529+Harshith-GRL@users.noreply.github.com> Date: Tue, 20 Aug 2024 01:31:08 +0530 Subject: [PATCH 07/52] RVC DirectModeChange Feature Update for RVCCLEANM and RVCRUNM (#34994) * Python Scripts TC_RVCCLEANM_2_2.py and TC_RVCRUNM_2_2.py updated * Updated the python script TC_RVCCLEANM_2_2.py with two new steps '7a' For reading FeatureMap Attribute and '7b' for send ChangeToMode Command * Updated the python script TC_RVCRUNM_2_2.py with two new steps '6a' For reading FeatureMap Attribute and '6b' for send ChangeToMode Command * Updated TC_RVCOPSTATE_2_4.py with updated PICS as per Test Plan * Python Script TC_RVCOPSTATE_2_4.py * Updated TC_RVCOPSTATE_2_4.py with steps numbers update * Restyled by autopep8 * Python Scripts TC_RVCCLEANM_2_2.py and TC_RVCRUNM_2_2.py updated * Updated the python script TC_RVCCLEANM_2_2.py with two new steps '7a' For reading FeatureMap Attribute and '7b' for send ChangeToMode Command * Updated the python script TC_RVCRUNM_2_2.py with two new steps '6a' For reading FeatureMap Attribute and '6b' for send ChangeToMode Command * Updated TC_RVCOPSTATE_2_4.py with updated PICS as per Test Plan * Python Script TC_RVCOPSTATE_2_4.py * Updated TC_RVCOPSTATE_2_4.py with steps numbers update * Restyled by autopep8 * Python Script TC_RVCRUNM_2_2.py and TC_RVCCLEANM_2_2.py * Updated TC_RVCRUNM_2_2.py and TC_RVCCLEANM_2_2.py as per comments from ROB * Restyled by autopep8 * Updated CI PICS Value For TC_RVCOPSTATE_2_4.py * Updated PICS.yaml For TC_RVCOPSTATE_2_4.py * Updated CI PICS file by removing RVCOPSTATE.S.C128.Rsp * Updated RVC PICS value at location examples/rvc-app/rvc-common/pics/rvc-app-pics-values --------- Co-authored-by: Restyled.io --- .../rvc-common/pics/rvc-app-pics-values | 4 +- src/app/tests/suites/certification/PICS.yaml | 2 +- .../tests/suites/certification/ci-pics-values | 3 +- src/python_testing/TC_RVCCLEANM_2_2.py | 38 +++++++++++++++--- src/python_testing/TC_RVCOPSTATE_2_4.py | 8 ++-- src/python_testing/TC_RVCRUNM_2_2.py | 40 ++++++++++++++----- 6 files changed, 72 insertions(+), 23 deletions(-) diff --git a/examples/rvc-app/rvc-common/pics/rvc-app-pics-values b/examples/rvc-app/rvc-common/pics/rvc-app-pics-values index c38f0c1b7e00a0..4ad084ec618dd4 100644 --- a/examples/rvc-app/rvc-common/pics/rvc-app-pics-values +++ b/examples/rvc-app/rvc-common/pics/rvc-app-pics-values @@ -20,7 +20,7 @@ RVCOPSTATE.S.E01=1 RVCOPSTATE.S.C00.Rsp=1 RVCOPSTATE.S.C03.Rsp=1 RVCOPSTATE.S.C04.Tx=1 -RVCOPSTATE.S.C128.Rsp=1 +RVCOPSTATE.S.C80.Rsp=1 RVCOPSTATE.S.M.ST_STOPPED=1 RVCOPSTATE.S.M.ST_RUNNING=1 RVCOPSTATE.S.M.ST_PAUSED=1 @@ -77,4 +77,4 @@ SEAR.S.M.HAS_MANUAL_SKIP_STATE_CONTROL=1 SEAR.S.M.INVALID_STATE_FOR_SKIP=1 SEAR.S.M.NO_SELAREA_FOR_SKIP=1 SEAR.S.M.VALID_STATE_FOR_SKIP=1 -SEAR.S.M.HAS_MANUAL_OPERATING_STATE_CONTROL=1 \ No newline at end of file +SEAR.S.M.HAS_MANUAL_OPERATING_STATE_CONTROL=1 diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 1fc182bd9ba867..c575bd348fc518 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -9740,7 +9740,7 @@ PICS: id: RVCOPSTATE.S.C03.Rsp - label: "Does the device implement receiving the GoHome command?" - id: RVCOPSTATE.S.C128.Rsp + id: RVCOPSTATE.S.C80.Rsp #Commands generated - label: diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index f64941bb688890..9109f30bec4d73 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -2532,7 +2532,7 @@ RVCOPSTATE.S.C01.Rsp=0 RVCOPSTATE.S.C02.Rsp=0 RVCOPSTATE.S.C03.Rsp=1 RVCOPSTATE.S.C04.Tx=1 -RVCOPSTATE.S.C128.Rsp=1 +RVCOPSTATE.S.C80.Rsp=1 RVCOPSTATE.S.M.ST_STOPPED=1 RVCOPSTATE.S.M.ST_RUNNING=1 RVCOPSTATE.S.M.ST_PAUSED=1 @@ -2618,6 +2618,7 @@ PIXIT.RVCRUNM.MODE_CHANGE_OK=0 # RVCOPSTATE.S.C02.Rsp=0 # RVCOPSTATE.S.C03.Rsp=1 # RVCOPSTATE.S.C04.Tx=1 +# RVCOPSTATE.S.C80.Rsp=1 # RVCOPSTATE.S.C128.Rsp=1 # RVCOPSTATE.C.C00.Tx=1 # RVCOPSTATE.C.C01.Tx=1 diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index 8aaae7ff78738f..e3a92033b3bdf4 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -27,13 +27,22 @@ # test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # === END CI TEST ARGUMENTS === +import enum from time import sleep import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts +class RvcStatusEnum(enum.IntEnum): + # TODO remove this class once InvalidInMode response code is implemented in python SDK + Success = 0x0 + UnsupportedMode = 0x1 + GenericFailure = 0x2 + InvalidInMode = 0x3 + + class TC_RVCCLEANM_2_2(MatterBaseTest): def __init__(self, *args): @@ -64,6 +73,11 @@ async def read_clean_supported_modes(self) -> Clusters.Objects.RvcCleanMode.Attr Clusters.RvcCleanMode.Attributes.SupportedModes) return ret + async def read_feature_map_attribute(self): + ret = await self.read_mod_attribute_expect_success(Clusters.RvcCleanMode, + Clusters.RvcCleanMode.Attributes.FeatureMap) + return ret + async def send_clean_change_to_mode_cmd(self, newMode) -> Clusters.Objects.RvcCleanMode.Commands.ChangeToModeResponse: ret = await self.send_single_cmd(cmd=Clusters.Objects.RvcCleanMode.Commands.ChangeToMode(newMode=newMode), endpoint=self.endpoint) return ret @@ -90,6 +104,9 @@ def write_to_app_pipe(self, command): @async_test_body async def test_TC_RVCCLEANM_2_2(self): + # TODO Replace 0x8000 with python object of RVCCLEAN FEATURE bit map when implemented + # 0x8000 corresponds to 16 bit DIRECTMODECH Feature map + self.directmodech_bit_mask = 0x8000 self.endpoint = self.matter_test_config.endpoint self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") if self.is_ci: @@ -157,11 +174,22 @@ async def test_TC_RVCCLEANM_2_2(self): self.new_clean_mode_th = mode break - self.print_step(7, "Send ChangeToMode command") + self.print_step("7a", "Read FeatureMap Attribute") + feature_map = await self.read_feature_map_attribute() + directmode_enabled = feature_map & self.directmodech_bit_mask + + self.print_step("7b", "Send ChangeToMode command") response = await self.send_clean_change_to_mode_cmd(self.new_clean_mode_th) - asserts.assert_equal(response.status, 3, - "The response should contain a ChangeToModeResponse command " - "with the Status set to InvalidInMode(0x03).") + asserts.assert_true(type_matches(response, Clusters.RvcCleanMode.Commands.ChangeToModeResponse), + "The response should ChangeToModeResponse command") + if directmode_enabled: + asserts.assert_equal(response.status, RvcStatusEnum.Success, + "The response should contain a ChangeToModeResponse command " + "with the Status set to Success(0x0).") + else: + asserts.assert_equal(response.status, RvcStatusEnum.InvalidInMode, + "The response should contain a ChangeToModeResponse command " + "with the Status set to InvalidInMode(0x03).") if __name__ == "__main__": diff --git a/src/python_testing/TC_RVCOPSTATE_2_4.py b/src/python_testing/TC_RVCOPSTATE_2_4.py index b680453b06c287..7f03d33b196833 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_4.py +++ b/src/python_testing/TC_RVCOPSTATE_2_4.py @@ -114,7 +114,7 @@ async def test_TC_RVCOPSTATE_2_4(self): asserts.assert_true(self.check_pics("RVCOPSTATE.S.A0004"), "RVCOPSTATE.S.A0004 must be supported") asserts.assert_true(self.check_pics("RVCOPSTATE.S.C04.Tx"), "RVCOPSTATE.S.C04.Tx must be supported") - asserts.assert_true(self.check_pics("RVCOPSTATE.S.C128.Rsp"), "RVCOPSTATE.S.C128.Rsp must be supported") + asserts.assert_true(self.check_pics("RVCOPSTATE.S.C80.Rsp"), "RVCOPSTATE.S.C80.Rsp must be supported") op_states = Clusters.OperationalState.Enums.OperationalStateEnum rvc_op_states = Clusters.RvcOperationalState.Enums.OperationalStateEnum @@ -170,16 +170,16 @@ async def test_TC_RVCOPSTATE_2_4(self): if self.check_pics("PICS_M_ST_SEEKING_CHARGER"): step_name = "Manually put the device in the SEEKING CHARGER operational state" - self.print_step(8, step_name) + self.print_step(11, step_name) if self.is_ci: await self.send_run_change_to_mode_cmd(rvc_app_run_mode_cleaning) await self.send_run_change_to_mode_cmd(rvc_app_run_mode_idle) else: self.wait_for_user_input(prompt_msg=f"{step_name}, and press Enter when ready.") - await self.read_operational_state_with_check(9, rvc_op_states.kSeekingCharger) + await self.read_operational_state_with_check(12, rvc_op_states.kSeekingCharger) - await self.send_go_home_cmd_with_check(10, op_errors.kNoError) + await self.send_go_home_cmd_with_check(13, op_errors.kNoError) if __name__ == "__main__": diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index dca866adb9f62e..b0d1233010f932 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -27,6 +27,7 @@ # test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --int-arg PIXIT.RVCRUNM.MODE_A:1 PIXIT.RVCRUNM.MODE_B:2 # === END CI TEST ARGUMENTS === +import enum from time import sleep import chip.clusters as Clusters @@ -38,17 +39,25 @@ # --int-arg PIXIT.RVCRUNM.MODE_A: PIXIT.RVCRUNM.MODE_B: +class RvcStatusEnum(enum.IntEnum): + # TODO remove this class once InvalidInMode response code is implemented in python SDK + Success = 0x0 + UnsupportedMode = 0x1 + GenericFailure = 0x2 + InvalidInMode = 0x3 + + def error_enum_to_text(error_enum): try: return f'{Clusters.RvcRunMode.Enums.ModeTag(error_enum).name} 0x{error_enum:02x}' except AttributeError: - if error_enum == 0: + if error_enum == RvcStatusEnum.Success: return "Success(0x00)" - elif error_enum == 0x1: + elif error_enum == RvcStatusEnum.UnsupportedMode: return "UnsupportedMode(0x01)" - elif error_enum == 0x2: + elif error_enum == RvcStatusEnum.GenericFailure: return "GenericFailure(0x02)" - elif error_enum == 0x3: + elif error_enum == RvcStatusEnum.InvalidInMode: return "InvalidInMode(0x03)" raise AttributeError("Unknown Enum value") @@ -122,6 +131,9 @@ async def test_TC_RVCRUNM_2_2(self): "PIXIT.RVCRUNM.MODE_A: \n" "PIXIT.RVCRUNM.MODE_B:") + # TODO Replace 0x8000 with python object of RVCRUN FEATURE bit when implemented + # 0x8000 corresponds to 16 bit DIRECTMODECH Feature map + self.directmodech_bit_mask = 0x8000 self.endpoint = self.matter_test_config.endpoint self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") self.mode_a = self.matter_test_config.global_test_params['PIXIT.RVCRUNM.MODE_A'] @@ -193,15 +205,23 @@ async def test_TC_RVCRUNM_2_2(self): asserts.assert_true(idle_tag_present, "The device must be in a mode with the Idle (0x4000) mode tag.") self.print_step(5, "Send ChangeToMode MODE_A command") - await self.send_change_to_mode_with_check(self.mode_a, 0) + await self.send_change_to_mode_with_check(self.mode_a, RvcStatusEnum.Success) # This step is not described in the test plan, but it ought to be await self.read_current_mode_with_check(self.mode_a) - self.print_step(6, "Send ChangeToMode MODE_B command") - await self.send_change_to_mode_with_check(self.mode_b, 3) + self.print_step("6a", "Read Attribute FeatureMap") + feature_map = await self.read_mod_attribute_expect_success(cluster=Clusters.RvcRunMode, + attribute=Clusters.RvcRunMode.Attributes.FeatureMap) + directmode_enabled = feature_map & self.directmodech_bit_mask + + self.print_step('6b', "Send ChangeToMode MODE_B command") + if directmode_enabled: + await self.send_change_to_mode_with_check(self.mode_b, RvcStatusEnum.Success) + else: + await self.send_change_to_mode_with_check(self.mode_b, RvcStatusEnum.InvalidInMode) self.print_step(7, "Send ChangeToMode idle command") - await self.send_change_to_mode_with_check(self.idle_mode_dut, 0) + await self.send_change_to_mode_with_check(self.idle_mode_dut, RvcStatusEnum.Success) # This step is not described in the test plan, but it ought to be await self.read_current_mode_with_check(self.idle_mode_dut) @@ -228,12 +248,12 @@ async def test_TC_RVCRUNM_2_2(self): "Expected RVCOPSTATE's OperationalState attribute to be one of Stopped(0x00), Paused(0x02), Charging(0x41) or Docked(0x42)") self.print_step(11, "Send ChangeToMode MODE_B command") - await self.send_change_to_mode_with_check(self.mode_b, 0) + await self.send_change_to_mode_with_check(self.mode_b, RvcStatusEnum.Success) # This step is not described in the test plan, but it ought to be await self.read_current_mode_with_check(self.mode_b) self.print_step(12, "Send ChangeToMode idle command") - await self.send_change_to_mode_with_check(self.idle_mode_dut, 0) + await self.send_change_to_mode_with_check(self.idle_mode_dut, RvcStatusEnum.Success) # This step is not described in the test plan, but it ought to be await self.read_current_mode_with_check(self.idle_mode_dut) From b13f8ac59c964f50dbdf784e45a2d3d2392ec9a5 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 19 Aug 2024 13:15:56 -0700 Subject: [PATCH 08/52] [Fabric-Admin] We should only start the reverse commission process if the local fabric bridge is ready. (#35079) * [Fabric-Admin] We should only start the reverse commission process if the local fabric is ready. * Fix compile error --- .../commands/fabric-sync/FabricSyncCommand.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp index 704996d189d9c2..6a7b5be05bb3bd 100644 --- a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp +++ b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp @@ -64,13 +64,16 @@ void FabricSyncAddBridgeCommand::OnCommissioningComplete(NodeId deviceId, CHIP_E DeviceMgr().SubscribeRemoteFabricBridge(); - // After successful commissioning of the Commissionee, initiate Reverse Commissioning - // via the Commissioner Control Cluster. However, we must first verify that the - // remote Fabric-Bridge supports Fabric Synchronization. - // - // Note: The Fabric-Admin MUST NOT send the RequestCommissioningApproval command - // if the remote Fabric-Bridge lacks Fabric Synchronization support. - DeviceLayer::PlatformMgr().ScheduleWork(CheckFabricBridgeSynchronizationSupport, 0); + if (DeviceMgr().IsLocalBridgeReady()) + { + // After successful commissioning of the Commissionee, initiate Reverse Commissioning + // via the Commissioner Control Cluster. However, we must first verify that the + // remote Fabric-Bridge supports Fabric Synchronization. + // + // Note: The Fabric-Admin MUST NOT send the RequestCommissioningApproval command + // if the remote Fabric-Bridge lacks Fabric Synchronization support. + DeviceLayer::PlatformMgr().ScheduleWork(CheckFabricBridgeSynchronizationSupport, 0); + } } else { From 20caa91fea35cc5629aa0a6b9aa864eddceed15e Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:23:01 -0400 Subject: [PATCH 09/52] [ICD] Add ICDM 3.2 Python Certification Script (#34782) * Add ICDM 3.2 Python Certification Script * fix restyle * Restyled by prettier-json * Restyled by isort * restyle and linter fix * Add CI test arguments --------- Co-authored-by: Restyled.io --- .../certification/Test_TC_ICDM_3_2.yaml | 346 --------------- src/app/tests/suites/manualTests.json | 2 +- src/python_testing/TC_ICDM_3_2.py | 419 ++++++++++++++++++ 3 files changed, 420 insertions(+), 347 deletions(-) delete mode 100644 src/app/tests/suites/certification/Test_TC_ICDM_3_2.yaml create mode 100644 src/python_testing/TC_ICDM_3_2.py diff --git a/src/app/tests/suites/certification/Test_TC_ICDM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_ICDM_3_2.yaml deleted file mode 100644 index f6104a53d411d1..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_ICDM_3_2.yaml +++ /dev/null @@ -1,346 +0,0 @@ -# Copyright (c) 2024 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 217.2.3. [TC-ICDM-3.2] Verify RegisterClient command with DUT as Server - -PICS: - - ICDM.S - - ICDM.S.C00.Rsp - - ICDM.S.C02.Rsp - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Preconditions" - verification: | - 1.Commission DUT to TH (can be skipped if done in a preceding test). - 2a.TH reads from the DUT the RegisteredClients attribute. - 2b.If list of registered clients is not empty, unregister existing client(s) - 2c.TH reads from the DUT the RegisteredClients attribute. Verify that the DUT response contains empty list of registered clients. - disabled: true - - - label: - "Step 1a: TH sends RegisterClient command. - CheckInNodeID: - registering clients node ID (CheckInNodeID1) - MonitoredSubject: - monitored subject ID (MonitorSubID1) - Key: shared secret between the - client and the ICD (Key1)" - PICS: ICDM.S.C00.Rsp - verification: | - ./chip-tool icdmanagement register-client 1 1 hex:1234567890abcdef1234567890abcdef 1 0 - - [1702418857.289325][1350:1352] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0046 Command=0x0000_0001 - [1702418857.289426][1350:1352] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Command 0x0000_0001 - [1702418857.289635][1350:1352] CHIP:TOO: RegisterClientResponse: { - [1702418857.289725][1350:1352] CHIP:TOO: ICDCounter: 1321491095 - [1702418857.289781][1350:1352] CHIP:TOO: } - disabled: true - - - label: "Step 1b: TH reads from the DUT the RegisteredClients attribute." - PICS: ICDM.S.A0003 - verification: | - ./chip-tool icdmanagement read registered-clients 1 0 - - [1702418868.283920][1353:1355] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Attribute 0x0000_0003 DataVersion: 4124981277 - [1702418868.284152][1353:1355] CHIP:TOO: RegisteredClients: 2 entries - [1702418868.284338][1353:1355] CHIP:TOO: [1]: { - [1702418868.284396][1353:1355] CHIP:TOO: CheckInNodeID: 112233 - [1702418868.284449][1353:1355] CHIP:TOO: MonitoredSubject: 112233 - [1702418868.284525][1353:1355] CHIP:TOO: FabricIndex: 1 - [1702418868.284577][1353:1355] CHIP:TOO: } - [1702418868.284647][1353:1355] CHIP:TOO: [2]: { - [1702418868.284700][1353:1355] CHIP:TOO: CheckInNodeID: 1 - [1702418868.284751][1353:1355] CHIP:TOO: MonitoredSubject: 1 - [1702418868.284801][1353:1355] CHIP:TOO: FabricIndex: 1 - [1702418868.284849][1353:1355] CHIP:TOO: } - disabled: true - - - label: "Step 1c: Power cycle DUT" - verification: | - Power cycle DUT - disabled: true - - - label: "Step 1d: TH reads from the DUT the RegisteredClients attribute." - PICS: ICDM.S.A0003(RegisteredClients) - verification: | - ./chip-tool icdmanagement read registered-clients 1 0 - - [1702418876.828984][1356:1358] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Attribute 0x0000_0003 DataVersion: 4124981277 - [1702418876.829201][1356:1358] CHIP:TOO: RegisteredClients: 2 entries - [1702418876.829372][1356:1358] CHIP:TOO: [1]: { - [1702418876.829426][1356:1358] CHIP:TOO: CheckInNodeID: 112233 - [1702418876.829535][1356:1358] CHIP:TOO: MonitoredSubject: 112233 - [1702418876.829609][1356:1358] CHIP:TOO: FabricIndex: 1 - [1702418876.829655][1356:1358] CHIP:TOO: } - [1702418876.829719][1356:1358] CHIP:TOO: [2]: { - [1702418876.829766][1356:1358] CHIP:TOO: CheckInNodeID: 1 - [1702418876.829867][1356:1358] CHIP:TOO: MonitoredSubject: 1 - [1702418876.829912][1356:1358] CHIP:TOO: FabricIndex: 1 - [1702418876.829955][1356:1358] CHIP:TOO: } - disabled: true - - - label: - "Step 2a: Setup the TH such that is has administrator privileges for - the ICDM cluster." - verification: | - chip-tool default with admin privilege. - disabled: true - - - label: - "Step 2b: TH sends RegisterClient command with same CheckInNodeID as - in Step 1a and different MonitoredSubject and Key. - CheckInNodeID: - registering clients node ID (CheckInNodeID1) - MonitoredSubject: - monitored subject ID (MonitorSubID2) - Key: shared secret between the - client and the ICD (Key2)" - PICS: ICDM.S.C00.Rsp - verification: | - ./chip-tool icdmanagement register-client 1 2 hex:abcdef1234567890abcdef1234567890 1 0 - - [1702418883.807797][1359:1361] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0046 Command=0x0000_0001 - [1702418883.807919][1359:1361] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Command 0x0000_0001 - [1702418883.808188][1359:1361] CHIP:TOO: RegisterClientResponse: { - [1702418883.808260][1359:1361] CHIP:TOO: ICDCounter: 1321491095 - [1702418883.808316][1359:1361] CHIP:TOO: } - disabled: true - - - label: "Step 2c: TH reads from the DUT the ICDCounter attribute." - PICS: ICDM.S.A0004 - verification: | - ./chip-tool icdmanagement read icdcounter 1 0 - - [1702418902.706877][1365:1367] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Attribute 0x0000_0004 DataVersion: 4124981277 - [1702418902.706989][1365:1367] CHIP:TOO: ICDCounter: 1321491095 - disabled: true - - - label: "Step 2d: TH reads from the DUT the RegisteredClients attribute." - PICS: ICDM.S.A0003 - verification: | - ./chip-tool icdmanagement read registered-clients 1 0 - - [1702418891.793516][1362:1364] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Attribute 0x0000_0003 DataVersion: 4124981277 - [1702418891.793737][1362:1364] CHIP:TOO: RegisteredClients: 2 entries - [1702418891.793959][1362:1364] CHIP:TOO: [1]: { - [1702418891.794016][1362:1364] CHIP:TOO: CheckInNodeID: 112233 - [1702418891.794065][1362:1364] CHIP:TOO: MonitoredSubject: 112233 - [1702418891.794133][1362:1364] CHIP:TOO: FabricIndex: 1 - [1702418891.794179][1362:1364] CHIP:TOO: } - [1702418891.794290][1362:1364] CHIP:TOO: [2]: { - [1702418891.794344][1362:1364] CHIP:TOO: CheckInNodeID: 1 - [1702418891.794390][1362:1364] CHIP:TOO: MonitoredSubject: 2 - [1702418891.794483][1362:1364] CHIP:TOO: FabricIndex: 1 - [1702418891.794531][1362:1364] CHIP:TOO: } - disabled: true - - - label: - "Step 2e: TH sends UnregisterClient command with the CheckInNodeID - (CheckInNodeID1)." - PICS: ICDM.S.C02.Rsp - verification: | - ./chip-tool icdmanagement unregister-client 1 1 0 - - [1702419153.281757][1380:1382] CHIP:DMG: InvokeResponseMessage = - [1702419153.281885][1380:1382] CHIP:DMG: { - [1702419153.282005][1380:1382] CHIP:DMG: suppressResponse = false, - [1702419153.282061][1380:1382] CHIP:DMG: InvokeResponseIBs = - [1702419153.282126][1380:1382] CHIP:DMG: [ - [1702419153.282177][1380:1382] CHIP:DMG: InvokeResponseIB = - [1702419153.282243][1380:1382] CHIP:DMG: { - [1702419153.282296][1380:1382] CHIP:DMG: CommandStatusIB = - [1702419153.282357][1380:1382] CHIP:DMG: { - [1702419153.282576][1380:1382] CHIP:DMG: CommandPathIB = - [1702419153.282650][1380:1382] CHIP:DMG: { - [1702419153.282725][1380:1382] CHIP:DMG: EndpointId = 0x0, - [1702419153.282812][1380:1382] CHIP:DMG: ClusterId = 0x46, - [1702419153.282895][1380:1382] CHIP:DMG: CommandId = 0x2, - [1702419153.282973][1380:1382] CHIP:DMG: }, - [1702419153.283183][1380:1382] CHIP:DMG: - [1702419153.283246][1380:1382] CHIP:DMG: StatusIB = - [1702419153.283327][1380:1382] CHIP:DMG: { - [1702419153.283409][1380:1382] CHIP:DMG: status = 0x00 (SUCCESS), - [1702419153.283490][1380:1382] CHIP:DMG: }, - [1702419153.283562][1380:1382] CHIP:DMG: - [1702419153.283626][1380:1382] CHIP:DMG: }, - [1702419153.283699][1380:1382] CHIP:DMG: - [1702419153.283751][1380:1382] CHIP:DMG: }, - [1702419153.283811][1380:1382] CHIP:DMG: - [1702419153.283859][1380:1382] CHIP:DMG: ], - [1702419153.283919][1380:1382] CHIP:DMG: - [1702419153.283966][1380:1382] CHIP:DMG: InteractionModelRevision = 11 - [1702419153.284013][1380:1382] CHIP:DMG: }, - [1702419153.284182][1380:1382] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_0046 Command=0x0000_0002 Status=0x0 - disabled: true - - - label: "Step 2f: TH reads from the DUT the RegisteredClients attribute." - PICS: ICDM.S.A0003 - verification: | - ./chip-tool icdmanagement read registered-clients 1 0 - - [1702419210.157158][1385:1387] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Attribute 0x0000_0003 DataVersion: 4124981277 - [1702419210.157311][1385:1387] CHIP:TOO: RegisteredClients: 1 entries - [1702419210.157489][1385:1387] CHIP:TOO: [1]: { - [1702419210.157543][1385:1387] CHIP:TOO: CheckInNodeID: 112233 - [1702419210.157591][1385:1387] CHIP:TOO: MonitoredSubject: 112233 - [1702419210.157662][1385:1387] CHIP:TOO: FabricIndex: 1 - [1702419210.157730][1385:1387] CHIP:TOO: } - disabled: true - - - label: - "Step 2g: Clear the THs administrator privileges for the ICDM cluster." - verification: | - ./chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 4, "authMode": 2, "subjects": [112233], "targets": null } ]' 1 0 - disabled: true - - - label: - "Step 3a: TH sends RegisterClient command. - CheckInNodeID: - registering clients node ID (CheckInNodeID3) - MonitoredSubject: - monitored subject ID (MonitorSubID3) - Key: shared secret between the - client and the ICD (Key3) - VerificationKey: verification key - (VerificationKey3)" - PICS: ICDM.S.C00.Rsp - verification: | - ./chip-tool icdmanagement register-client 3 3 hex:3334567890abcdef3334567890abcdef 1 0 --VerificationKey hex:abcdef1234567890abcdef1234567890 - - [1702433488.601132][2043:2045] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0046 Command=0x0000_0001 - [1702433488.601231][2043:2045] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Command 0x0000_0001 - [1702433488.601414][2043:2045] CHIP:TOO: RegisterClientResponse: { - [1702433488.601478][2043:2045] CHIP:TOO: ICDCounter: 228745926 - [1702433488.601531][2043:2045] CHIP:TOO: } - disabled: true - - - label: "Step 3b: TH reads from the DUT the RegisteredClients attribute." - PICS: ICDM.S.A0003 - verification: | - ./chip-tool icdmanagement read registered-clients 1 0 - - [1702433698.808800][2095:2097] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Attribute 0x0000_0003 DataVersion: 2083795792 - [1702433698.808939][2095:2097] CHIP:TOO: RegisteredClients: 2 entries - [1702433698.809081][2095:2097] CHIP:TOO: [1]: { - [1702433698.809126][2095:2097] CHIP:TOO: CheckInNodeID: 112233 - [1702433698.809167][2095:2097] CHIP:TOO: MonitoredSubject: 112233 - [1702433698.809226][2095:2097] CHIP:TOO: FabricIndex: 1 - [1702433698.809266][2095:2097] CHIP:TOO: } - [1702433698.809319][2095:2097] CHIP:TOO: [2]: { - [1702433698.809359][2095:2097] CHIP:TOO: CheckInNodeID: 3 - [1702433698.809399][2095:2097] CHIP:TOO: MonitoredSubject: 3 - [1702433698.809514][2095:2097] CHIP:TOO: FabricIndex: 1 - [1702433698.809559][2095:2097] CHIP:TOO: } - disabled: true - - - label: - "Step 4: TH sends RegisterClient command with same CheckInNodeID as in - Step 3a and different MonitoredSubject and Key, and an invalid - VerificationKey - CheckInNodeID: registering clients node ID - (CheckInNodeID3) - MonitoredSubject: monitored subject ID - (MonitorSubID4) - Key: shared secret between the client and the ICD - (Key4) - VerificationKey: invalid verification key (VerificationKey4)" - PICS: ICDM.S.C00.Rsp - verification: | - ./chip-tool icdmanagement register-client 3 4 hex:3334567890abcdef3334567890abcdef 1 0 --VerificationKey hex:abcdef1234567890 - - [1703266655.434604][2378:2381] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_0046 Command=0x0000_0000 Status=0x1 - [1703266655.434688][2378:2381] CHIP:TOO: Error: IM Error 0x00000501: General error: 0x01 (FAILURE) - disabled: true - - - label: - "Step 5: TH sends RegisterClient command with same CheckInNodeID as in - Step 3a and different MonitoredSubject, Key, and VerificationKey - - CheckInNodeID: registering clients node ID (CheckInNodeID3) - - MonitoredSubject: monitored subject ID (MonitorSubID5) - Key: shared - secret between the client and the ICD (Key5) - VerificationKey: valid - verification key (VerificationKey5)" - PICS: ICDM.S.C00.Rsp - verification: | - ./chip-tool icdmanagement register-client 3 5 hex:3334567890abcdef3334567890abcdef 1 0 --VerificationKey hex:abcdef1234567890abcdef1234500000 - - [1703266705.829853][2551:2553] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_0046 Command=0x0000_0000 Status=0x1 - [1703266705.829994][2551:2553] CHIP:TOO: Error: IM Error 0x00000501: General error: 0x01 (FAILURE) - disabled: true - - - label: - "Step 6a: TH sends RegisterClient command with same CheckInNodeID and - VerificationKey as in Step 3a and different MonitoredSubject and Key - - CheckInNodeID: registering clients node ID (CheckInNodeID3) - - MonitoredSubject: monitored subject ID (MonitorSubID6) - Key: shared - secret between the client and the ICD (Key6) - VerificationKey: - verification key (VerificationKey3)" - PICS: ICDM.S.C00.Rsp - verification: | - ./chip-tool icdmanagement register-client 3 6 hex:3334567890abcdef3334567890abcdef 1 0 --VerificationKey hex:abcdef1234567890abcdef1234567890 - - [1703267703.849366][2694:2696] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Command 0x0000_0001 - [1703267703.849532][2694:2696] CHIP:TOO: RegisterClientResponse: { - [1703267703.849587][2694:2696] CHIP:TOO: ICDCounter: 228745930 - [1703267703.849633][2694:2696] CHIP:TOO: } - disabled: true - - - label: "Step 6b: TH reads from the DUT the RegisteredClients attribute." - PICS: ICDM.S.A0003 - verification: | - ./chip-tool icdmanagement read registered-clients 1 0 - - [1702433698.808800][2095:2097] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Attribute 0x0000_0003 DataVersion: 2083795792 - [1702433698.808939][2095:2097] CHIP:TOO: RegisteredClients: 2 entries - [1702433698.809081][2095:2097] CHIP:TOO: [1]: { - [1702433698.809126][2095:2097] CHIP:TOO: CheckInNodeID: 112233 - [1702433698.809167][2095:2097] CHIP:TOO: MonitoredSubject: 112233 - [1702433698.809226][2095:2097] CHIP:TOO: FabricIndex: 1 - [1702433698.809266][2095:2097] CHIP:TOO: } - [1702433698.809319][2095:2097] CHIP:TOO: [2]: { - [1702433698.809359][2095:2097] CHIP:TOO: CheckInNodeID: 3 - [1702433698.809399][2095:2097] CHIP:TOO: MonitoredSubject: 6 - [1702433698.809514][2095:2097] CHIP:TOO: FabricIndex: 1 - [1702433698.809559][2095:2097] CHIP:TOO: } - disabled: true - - - label: - "Step 6c: TH sends UnregisterClient command with the CheckInNodeID - (CheckInNodeID3) and VerificationKey (VerificationKey3)." - PICS: ICDM.S.C02.Rsp - verification: | - ./chip-tool icdmanagement unregister-client 3 3 0 - - [1702419153.281757][1380:1382] CHIP:DMG: InvokeResponseMessage = - [1702419153.281885][1380:1382] CHIP:DMG: { - [1702419153.282005][1380:1382] CHIP:DMG: suppressResponse = false, - [1702419153.282061][1380:1382] CHIP:DMG: InvokeResponseIBs = - [1702419153.282126][1380:1382] CHIP:DMG: [ - [1702419153.282177][1380:1382] CHIP:DMG: InvokeResponseIB = - [1702419153.282243][1380:1382] CHIP:DMG: { - [1702419153.282296][1380:1382] CHIP:DMG: CommandStatusIB = - [1702419153.282357][1380:1382] CHIP:DMG: { - [1702419153.282576][1380:1382] CHIP:DMG: CommandPathIB = - [1702419153.282650][1380:1382] CHIP:DMG: { - [1702419153.282725][1380:1382] CHIP:DMG: EndpointId = 0x0, - [1702419153.282812][1380:1382] CHIP:DMG: ClusterId = 0x46, - [1702419153.282895][1380:1382] CHIP:DMG: CommandId = 0x2, - [1702419153.282973][1380:1382] CHIP:DMG: }, - [1702419153.283183][1380:1382] CHIP:DMG: - [1702419153.283246][1380:1382] CHIP:DMG: StatusIB = - [1702419153.283327][1380:1382] CHIP:DMG: { - [1702419153.283409][1380:1382] CHIP:DMG: status = 0x00 (SUCCESS), - [1702419153.283490][1380:1382] CHIP:DMG: }, - [1702419153.283562][1380:1382] CHIP:DMG: - [1702419153.283626][1380:1382] CHIP:DMG: }, - [1702419153.283699][1380:1382] CHIP:DMG: - [1702419153.283751][1380:1382] CHIP:DMG: }, - [1702419153.283811][1380:1382] CHIP:DMG: - [1702419153.283859][1380:1382] CHIP:DMG: ], - [1702419153.283919][1380:1382] CHIP:DMG: - [1702419153.283966][1380:1382] CHIP:DMG: InteractionModelRevision = 11 - [1702419153.284013][1380:1382] CHIP:DMG: }, - [1702419153.284182][1380:1382] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_0046 Command=0x0000_0002 Status=0x0 - disabled: true diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index 5edf1cbe71a264..8048c7b3be6e22 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -117,7 +117,7 @@ "GeneralCommissioning": ["Test_TC_CGEN_2_2"], "GeneralDiagnostics": ["Test_TC_DGGEN_2_2"], "Identify": ["Test_TC_I_3_2"], - "IcdManagement": ["Test_TC_ICDM_3_2", "Test_TC_ICDM_5_1"], + "IcdManagement": ["Test_TC_ICDM_4_1", "Test_TC_ICDM_5_1"], "IlluminanceMeasurement": [], "InteractionDataModel": [ "Test_TC_IDM_1_1", diff --git a/src/python_testing/TC_ICDM_3_2.py b/src/python_testing/TC_ICDM_3_2.py new file mode 100644 index 00000000000000..5a194420c3619e --- /dev/null +++ b/src/python_testing/TC_ICDM_3_2.py @@ -0,0 +1,419 @@ + +# +# Copyright (c) 2023 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${LIT_ICD_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === END CI TEST ARGUMENTS === + +import logging +import time +from dataclasses import dataclass + +import chip.clusters as Clusters +from chip.interaction_model import InteractionModelError, Status +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts + +logger = logging.getLogger(__name__) + +# ========================== +# Constants +# ========================== + +kRootEndpointId = 0 + +cluster = Clusters.Objects.IcdManagement +commands = cluster.Commands +ClientTypeEnum = cluster.Enums.ClientTypeEnum +attributes = cluster.Attributes + + +@dataclass +class Client: + checkInNodeID: int + subjectId: int + key: bytes + clientType: ClientTypeEnum + + +# +# Test Input Data +# +kIncorrectKey = b"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1a" +kInvalidKey = b"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e1g" + +client1 = Client( + checkInNodeID=1, + subjectId=1, + key=b"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + clientType=ClientTypeEnum.kEphemeral +) + +client2 = Client( + checkInNodeID=1, + subjectId=2, + key=b"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1e", + clientType=ClientTypeEnum.kEphemeral +) + +client3 = Client( + checkInNodeID=1, + subjectId=3, + key=b"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1d", + clientType=ClientTypeEnum.kEphemeral +) + +client4 = Client( + checkInNodeID=1, + subjectId=4, + key=b"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1c", + clientType=ClientTypeEnum.kEphemeral +) + +client5 = Client( + checkInNodeID=5, + subjectId=5, + key=b"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1b", + clientType=ClientTypeEnum.kEphemeral +) + +client6 = Client( + checkInNodeID=5, + subjectId=6, + key=b"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1a", + clientType=ClientTypeEnum.kEphemeral +) + +client7 = Client( + checkInNodeID=5, + subjectId=7, + key=b"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x0f", + clientType=ClientTypeEnum.kEphemeral +) + +client8 = Client( + checkInNodeID=5, + subjectId=8, + key=b"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x0e", + clientType=ClientTypeEnum.kEphemeral +) + + +class TC_ICDM_3_2(MatterBaseTest): + + # + # Class Helper functions + # + async def _read_icdm_attribute_expect_success(self, attribute): + return await self.read_single_attribute_check_success(endpoint=kRootEndpointId, cluster=cluster, attribute=attribute) + + async def _send_single_icdm_command(self, command): + return await self.send_single_cmd(command, endpoint=kRootEndpointId) + # + # Test Harness Helpers + # + + def desc_TC_ICDM_3_2(self) -> str: + """Returns a description of this test""" + return "[TC-ICDM-3.2] Verify RegisterClient Command with DUT as Server" + + def steps_TC_ICDM_3_2(self) -> list[TestStep]: + steps = [ + TestStep(0, "Commissioning, already done", is_commissioning=True), + TestStep(1, "TH reads from the DUT the RegisteredClients attribute. RegisteredClients is empty."), + TestStep("2a", "TH sends RegisterClient command."), + TestStep("2b", "TH reads from the DUT the RegisteredClients attribute."), + TestStep("2c", "Power cycle DUT."), + TestStep("2d", "TH waits for {PIXIT.WAITTIME.REBOOT}"), + TestStep("2e", "TH reads from the DUT the RegisteredClients attribute."), + TestStep("3a", "TH sends RegisterClient command with same CheckInNodeID1 as in Step 1a and different MonitorSubID2 and Key2."), + TestStep("3b", "TH reads from the DUT the RegisteredClients attribute."), + TestStep("4a", "TH sends RegisterClient command with same CheckInNodeID1 as in Step 1a and different MonitorSubID3 and Key3, and an invalid VerificationKey3."), + TestStep("4b", "TH reads from the DUT the RegisteredClients attribute."), + TestStep("5a", "TH sends RegisterClient command with same CheckInNodeID1 as in Step 1a and different MonitorSubID4 and Key4, and a valid wrong VerificationKey4."), + TestStep("5b", "TH reads from the DUT the RegisteredClients attribute."), + TestStep("6a", "TH sends UnregisterClient command with CheckInNodeID1."), + TestStep("6b", "TH reads from the DUT the RegisteredClients attribute."), + TestStep(7, "Set the TH to Manage privilege for ICDM cluster."), + TestStep("8a", "TH sends RegisterClient command."), + TestStep("8b", "TH sends RegisterClient command with same CheckInNodeID5 as in Step 6a and different MonitorSubID6 and Key6, and an invalid VerificationKey6."), + TestStep("8c", "TH sends RegisterClient command with same CheckInNodeID5 as in Step 6a and different MonitorSubID7 and Key7, and an valid wrong VerificationKey7."), + TestStep("8d", "TH sends RegisterClient command with same CheckInNodeID5 and VerificationKey5 as in Step 6a and different MonitorSubID9 and Key9."), + TestStep(9, "TH sends UnregisterClient command with the CheckInNodeID5 and VerificationKey5."), + ] + return steps + + def pics_TC_ICDM_3_2(self) -> list[str]: + """ This function returns a list of PICS for this test case that must be True for the test to be run""" + pics = [ + "ICDM.S", + "ICDM.S.F00" + ] + return pics + + # + # ICDM 3.2 Test Body + # + + @ async_test_body + async def test_TC_ICDM_3_2(self): + is_ci = self.check_pics("PICS_SDK_CI_ONLY") + + if not is_ci: + asserts.assert_true('PIXIT.WAITTIME.REBOOT' in self.matter_test_config.global_test_params, + "PIXIT.WAITTIME.REBOOT must be included on the command line in " + "the --int-arg flag as PIXIT.WAITTIME.REBOOT:") + + wait_time_reboot = self.matter_test_config.global_test_params['PIXIT.WAITTIME.REBOOT'] + if wait_time_reboot == 0: + asserts.fail("PIXIT.WAITTIME.REBOOT shall be higher than 0.") + + # Pre-Condition: Commissioning + self.step(0) + + # Empty RegisteredClients attribute for all registrations + self.step(1) + registeredClients = await self._read_icdm_attribute_expect_success( + attributes.RegisteredClients) + + for client in registeredClients: + try: + await self._send_single_icdm_command(commands.UnregisterClient(checkInNodeID=client.checkInNodeID)) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Success, "Unexpected error returned") + + try: + self.step("2a") + try: + await self._send_single_icdm_command(commands.RegisterClient(checkInNodeID=client1.checkInNodeID, monitoredSubject=client1.subjectId, key=client1.key, clientType=client1.clientType)) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Success, "Unexpected error returned") + + self.step("2b") + registeredClients = await self._read_icdm_attribute_expect_success( + attributes.RegisteredClients) + # Validate list size + asserts.assert_equal(len(registeredClients), 1, + "The expected length of RegisteredClients is 1. List has the wrong size.") + + # Validate entry values + asserts.assert_equal( + registeredClients[0].checkInNodeID, client1.checkInNodeID, "The read attribute does not match the registered value.") + asserts.assert_equal( + registeredClients[0].monitoredSubject, client1.subjectId, "The read attribute does not match the registered value.") + asserts.assert_equal( + registeredClients[0].clientType, client1.clientType, "The read attribute does not match the registered value.") + + # Reboot + self.step("2c") + if not is_ci: + self.wait_for_user_input(prompt_msg="Restart DUT. Press Enter when restart has been initiated.") + + self.step("2d") + if not is_ci: + time.sleep(wait_time_reboot) + + self.step("2e") + registeredClients = await self._read_icdm_attribute_expect_success( + attributes.RegisteredClients) + # Validate list size + asserts.assert_equal(len(registeredClients), 1, + "The expected length of RegisteredClients is 1. List has the wrong size.") + + # Validate entry values + asserts.assert_equal( + registeredClients[0].checkInNodeID, client1.checkInNodeID, "The read attribute does not match the registered value.") + asserts.assert_equal( + registeredClients[0].monitoredSubject, client1.subjectId, "The read attribute does not match the registered value.") + asserts.assert_equal( + registeredClients[0].clientType, client1.clientType, "The read attribute does not match the registered value.") + + self.step("3a") + try: + await self._send_single_icdm_command(commands.RegisterClient(checkInNodeID=client2.checkInNodeID, monitoredSubject=client2.subjectId, key=client2.key, clientType=client2.clientType)) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Success, "Unexpected error returned") + + self.step("3b") + registeredClients = await self._read_icdm_attribute_expect_success( + attributes.RegisteredClients) + # Validate list size + asserts.assert_equal(len(registeredClients), 1, + "The expected length of RegisteredClients is 1. List has the wrong size.") + + # Validate entry values + asserts.assert_equal( + registeredClients[0].checkInNodeID, client2.checkInNodeID, "The read attribute does not match the registered value.") + asserts.assert_equal( + registeredClients[0].monitoredSubject, client2.subjectId, "The read attribute does not match the registered value.") + asserts.assert_equal( + registeredClients[0].clientType, client2.clientType, "The read attribute does not match the registered value.") + + self.step("4a") + try: + await self._send_single_icdm_command(commands.RegisterClient(checkInNodeID=client3.checkInNodeID, monitoredSubject=client3.subjectId, key=client3.key, clientType=client3.clientType, verificationKey=kInvalidKey)) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Success, "Unexpected error returned") + + self.step("4b") + registeredClients = await self._read_icdm_attribute_expect_success( + attributes.RegisteredClients) + # Validate list size + asserts.assert_equal(len(registeredClients), 1, + "The expected length of RegisteredClients is 1. List has the wrong size.") + + # Validate entry values + asserts.assert_equal( + registeredClients[0].checkInNodeID, client3.checkInNodeID, "The read attribute does not match the registered value.") + asserts.assert_equal( + registeredClients[0].monitoredSubject, client3.subjectId, "The read attribute does not match the registered value.") + asserts.assert_equal( + registeredClients[0].clientType, client3.clientType, "The read attribute does not match the registered value.") + + self.step("5a") + try: + await self._send_single_icdm_command(commands.RegisterClient(checkInNodeID=client4.checkInNodeID, monitoredSubject=client4.subjectId, key=client4.key, clientType=client4.clientType, verificationKey=kIncorrectKey)) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Success, "Unexpected error returned") + + self.step("5b") + registeredClients = await self._read_icdm_attribute_expect_success( + attributes.RegisteredClients) + # Validate list size + asserts.assert_equal(len(registeredClients), 1, + "The expected length of RegisteredClients is 1. List has the wrong size.") + + # Validate entry values + asserts.assert_equal( + registeredClients[0].checkInNodeID, client4.checkInNodeID, "The read attribute does not match the registered value.") + asserts.assert_equal( + registeredClients[0].monitoredSubject, client4.subjectId, "The read attribute does not match the registered value.") + asserts.assert_equal( + registeredClients[0].clientType, client4.clientType, "The read attribute does not match the registered value.") + + self.step("6a") + try: + await self._send_single_icdm_command(commands.UnregisterClient(checkInNodeID=client4.checkInNodeID)) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Success, "Unexpected error returned") + + self.step("6b") + registeredClients = await self._read_icdm_attribute_expect_success( + attributes.RegisteredClients) + asserts.assert_equal(len(registeredClients), 0, + "The RegisteredClients list must be empty. List has the wrong size.") + + self.step(7) + ac = Clusters.AccessControl + previousAcl = await self.read_single_attribute_check_success(cluster=ac, attribute=ac.Attributes.Acl) + newAcls = [] + + # Set Admin permissions on Access Control cluster + newAclEntry = ac.Structs.AccessControlEntryStruct(privilege=ac.Enums.AccessControlEntryPrivilegeEnum.kAdminister, + authMode=ac.Enums.AccessControlEntryAuthModeEnum.kCase, + subjects=previousAcl[0].subjects, targets=[ac.Structs.AccessControlTargetStruct( + cluster=Clusters.AccessControl.id)], fabricIndex=previousAcl[0].fabricIndex + ) + newAcls.append(newAclEntry) + + # Set Manage permissions on ICD Management cluster + newAclEntry = ac.Structs.AccessControlEntryStruct(privilege=ac.Enums.AccessControlEntryPrivilegeEnum.kManage, + authMode=ac.Enums.AccessControlEntryAuthModeEnum.kCase, + subjects=previousAcl[0].subjects, targets=[ac.Structs.AccessControlTargetStruct( + cluster=Clusters.IcdManagement.id)], fabricIndex=previousAcl[0].fabricIndex + ) + newAcls.append(newAclEntry) + + try: + await self.default_controller.WriteAttribute(nodeid=self.dut_node_id, attributes=[(0, ac.Attributes.Acl(newAcls))]) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Success, "Unexpected error returned") + + self.step("8a") + try: + await self._send_single_icdm_command(commands.RegisterClient(checkInNodeID=client5.checkInNodeID, monitoredSubject=client5.subjectId, key=client5.key, clientType=client5.clientType)) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Success, "Unexpected error returned") + + self.step("8b") + try: + await self._send_single_icdm_command(commands.RegisterClient(checkInNodeID=client6.checkInNodeID, monitoredSubject=client6.subjectId, key=client6.key, clientType=client6.clientType, verificationKey=kInvalidKey)) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Failure, "Unexpected error returned") + + self.step("8c") + try: + await self._send_single_icdm_command(commands.RegisterClient(checkInNodeID=client7.checkInNodeID, monitoredSubject=client7.subjectId, key=client7.key, clientType=client7.clientType, verificationKey=kIncorrectKey)) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Failure, "Unexpected error returned") + + self.step("8d") + try: + await self._send_single_icdm_command(commands.RegisterClient(checkInNodeID=client8.checkInNodeID, monitoredSubject=client8.subjectId, key=client8.key, clientType=client8.clientType, verificationKey=client5.key)) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Success, "Unexpected error returned") + + self.step(9) + try: + await self._send_single_icdm_command(commands.UnregisterClient(checkInNodeID=client8.checkInNodeID, verificationKey=client8.key)) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Success, "Unexpected error returned") + + # Post-Condition steps + finally: + # Reset ACLs + try: + await self.default_controller.WriteAttribute(nodeid=self.dut_node_id, attributes=[(0, ac.Attributes.Acl(previousAcl))]) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Success, "Unexpected error returned") + + # Clear all RegisteredClients + registeredClients = await self._read_icdm_attribute_expect_success( + attributes.RegisteredClients) + + for client in registeredClients: + try: + await self._send_single_icdm_command(commands.UnregisterClient(checkInNodeID=client.checkInNodeID)) + except InteractionModelError as e: + asserts.assert_equal( + e.status, Status.Success, "Unexpected error returned") + + +if __name__ == "__main__": + default_matter_test_main() From a902838bfe0f6185434859c681a0a22f953aa015 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 19 Aug 2024 16:09:30 -0700 Subject: [PATCH 10/52] [FabricAdmin] Refactor FS specific attribute handlings out of general HandleAttributeData function (#35080) * [FabricAdmin] Refactor attribute Data handling * Use reference to pass chip::TLV::TLVReader * Update examples/fabric-admin/device_manager/DeviceManager.h Co-authored-by: Terence Hampson * Update function name --------- Co-authored-by: Terence Hampson --- .../commands/clusters/ClusterCommand.h | 2 +- .../commands/clusters/ReportCommand.cpp | 4 +- .../device_manager/DeviceManager.cpp | 159 +++++++++--------- .../device_manager/DeviceManager.h | 14 +- 4 files changed, 94 insertions(+), 85 deletions(-) diff --git a/examples/fabric-admin/commands/clusters/ClusterCommand.h b/examples/fabric-admin/commands/clusters/ClusterCommand.h index ab2a535da41cc5..edf2302219fa1c 100644 --- a/examples/fabric-admin/commands/clusters/ClusterCommand.h +++ b/examples/fabric-admin/commands/clusters/ClusterCommand.h @@ -84,7 +84,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub if (data != nullptr) { LogErrorOnFailure(RemoteDataModelLogger::LogCommandAsJSON(path, data)); - DeviceMgr().HandleCommandResponse(path, data); + DeviceMgr().HandleCommandResponse(path, *data); } } diff --git a/examples/fabric-admin/commands/clusters/ReportCommand.cpp b/examples/fabric-admin/commands/clusters/ReportCommand.cpp index ff52a30e661342..2fdb965ddc844c 100644 --- a/examples/fabric-admin/commands/clusters/ReportCommand.cpp +++ b/examples/fabric-admin/commands/clusters/ReportCommand.cpp @@ -46,7 +46,7 @@ void ReportCommand::OnAttributeData(const app::ConcreteDataAttributePath & path, LogErrorOnFailure(RemoteDataModelLogger::LogAttributeAsJSON(path, data)); - DeviceMgr().HandleAttributeData(path, data); + DeviceMgr().HandleAttributeData(path, *data); } void ReportCommand::OnEventData(const app::EventHeader & eventHeader, TLV::TLVReader * data, const app::StatusIB * status) @@ -73,5 +73,5 @@ void ReportCommand::OnEventData(const app::EventHeader & eventHeader, TLV::TLVRe LogErrorOnFailure(RemoteDataModelLogger::LogEventAsJSON(eventHeader, data)); - DeviceMgr().HandleEventData(eventHeader, data); + DeviceMgr().HandleEventData(eventHeader, *data); } diff --git a/examples/fabric-admin/device_manager/DeviceManager.cpp b/examples/fabric-admin/device_manager/DeviceManager.cpp index 849d557f0be81d..ad8def646a0594 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.cpp +++ b/examples/fabric-admin/device_manager/DeviceManager.cpp @@ -237,6 +237,25 @@ void DeviceManager::ReadSupportedDeviceCategories() PushCommand(commandBuilder.c_str()); } +void DeviceManager::HandleReadSupportedDeviceCategories(chip::TLV::TLVReader & data) +{ + ChipLogProgress(NotSpecified, "Attribute SupportedDeviceCategories detected."); + + BitMask value; + CHIP_ERROR error = app::DataModel::Decode(data, value); + if (error != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to decode attribute value. Error: %" CHIP_ERROR_FORMAT, error.Format()); + return; + } + + if (value.Has(CommissionerControl::SupportedDeviceCategoryBitmap::kFabricSynchronization)) + { + ChipLogProgress(NotSpecified, "Remote Fabric-Bridge supports Fabric Synchronization, start reverse commissioning."); + RequestCommissioningApproval(); + } +} + void DeviceManager::RequestCommissioningApproval() { ChipLogProgress(NotSpecified, "Starting reverse commissioning for bridge device: NodeId: " ChipLogFormatX64, @@ -254,12 +273,12 @@ void DeviceManager::RequestCommissioningApproval() PushCommand(commandBuilder.c_str()); } -void DeviceManager::HandleCommissioningRequestResult(TLV::TLVReader * data) +void DeviceManager::HandleCommissioningRequestResult(TLV::TLVReader & data) { ChipLogProgress(NotSpecified, "CommissioningRequestResult event received."); CommissionerControl::Events::CommissioningRequestResult::DecodableType value; - CHIP_ERROR error = app::DataModel::Decode(*data, value); + CHIP_ERROR error = app::DataModel::Decode(data, value); if (error != CHIP_NO_ERROR) { ChipLogError(NotSpecified, "Failed to decode event value. Error: %" CHIP_ERROR_FORMAT, error.Format()); @@ -283,82 +302,12 @@ void DeviceManager::HandleCommissioningRequestResult(TLV::TLVReader * data) SendCommissionNodeRequest(value.requestId, kResponseTimeoutSeconds); } -void DeviceManager::SendCommissionNodeRequest(uint64_t requestId, uint16_t responseTimeoutSeconds) -{ - ChipLogProgress(NotSpecified, "Request the Commissioner Control Server to begin commissioning a previously approved request."); - - StringBuilder commandBuilder; - commandBuilder.Add("commissionercontrol commission-node "); - commandBuilder.AddFormat("%lu %u %lu %d", requestId, responseTimeoutSeconds, mRemoteBridgeNodeId, kRootEndpointId); - - PushCommand(commandBuilder.c_str()); -} - -void DeviceManager::HandleReverseOpenCommissioningWindow(TLV::TLVReader * data) +void DeviceManager::HandleAttributePartsListUpdate(chip::TLV::TLVReader & data) { - CommissionerControl::Commands::ReverseOpenCommissioningWindow::DecodableType value; - CHIP_ERROR error = app::DataModel::Decode(*data, value); - if (error != CHIP_NO_ERROR) - { - ChipLogError(NotSpecified, "Failed to decode command response value. Error: %" CHIP_ERROR_FORMAT, error.Format()); - return; - } - - // Log all fields - ChipLogProgress(NotSpecified, "DecodableType fields:"); - ChipLogProgress(NotSpecified, " commissioningTimeout: %u", value.commissioningTimeout); - ChipLogProgress(NotSpecified, " discriminator: %u", value.discriminator); - ChipLogProgress(NotSpecified, " iterations: %u", value.iterations); - - char verifierHex[Crypto::kSpake2p_VerifierSerialized_Length * 2 + 1]; - Encoding::BytesToHex(value.PAKEPasscodeVerifier.data(), value.PAKEPasscodeVerifier.size(), verifierHex, sizeof(verifierHex), - Encoding::HexFlags::kNullTerminate); - ChipLogProgress(NotSpecified, " PAKEPasscodeVerifier: %s", verifierHex); - - char saltHex[Crypto::kSpake2p_Max_PBKDF_Salt_Length * 2 + 1]; - Encoding::BytesToHex(value.salt.data(), value.salt.size(), saltHex, sizeof(saltHex), Encoding::HexFlags::kNullTerminate); - ChipLogProgress(NotSpecified, " salt: %s", saltHex); - - OpenDeviceCommissioningWindow(mLocalBridgeNodeId, value.commissioningTimeout, value.iterations, value.discriminator, saltHex, - verifierHex); -} - -void DeviceManager::HandleAttributeData(const app::ConcreteDataAttributePath & path, TLV::TLVReader * data) -{ - if (path.mClusterId == CommissionerControl::Id && - path.mAttributeId == CommissionerControl::Attributes::SupportedDeviceCategories::Id) - { - ChipLogProgress(NotSpecified, "Attribute SupportedDeviceCategories detected."); - - BitMask value; - CHIP_ERROR error = app::DataModel::Decode(*data, value); - if (error != CHIP_NO_ERROR) - { - ChipLogError(NotSpecified, "Failed to decode attribute value. Error: %" CHIP_ERROR_FORMAT, error.Format()); - return; - } - - if (value.Has(CommissionerControl::SupportedDeviceCategoryBitmap::kFabricSynchronization)) - { - ChipLogProgress(NotSpecified, "Remote Fabric-Bridge supports Fabric Synchronization, start reverse commissioning."); - RequestCommissioningApproval(); - } - - return; - } - - if (path.mClusterId != Descriptor::Id || path.mAttributeId != Descriptor::Attributes::PartsList::Id) - { - return; - } - - ChipLogProgress(NotSpecified, "Attribute change detected:"); - ChipLogProgress( - NotSpecified, "Endpoint: %u, Cluster: " ChipLogFormatMEI ", Attribute: " ChipLogFormatMEI ", DataVersion: %" PRIu32, - path.mEndpointId, ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId), path.mDataVersion.ValueOr(0)); + ChipLogProgress(NotSpecified, "Attribute PartsList change detected:"); app::DataModel::DecodableList value; - CHIP_ERROR error = app::DataModel::Decode(*data, value); + CHIP_ERROR error = app::DataModel::Decode(data, value); if (error != CHIP_NO_ERROR) { ChipLogError(NotSpecified, "Failed to decode attribute value. Error: %" CHIP_ERROR_FORMAT, error.Format()); @@ -456,7 +405,63 @@ void DeviceManager::HandleAttributeData(const app::ConcreteDataAttributePath & p } } -void DeviceManager::HandleEventData(const app::EventHeader & header, TLV::TLVReader * data) +void DeviceManager::SendCommissionNodeRequest(uint64_t requestId, uint16_t responseTimeoutSeconds) +{ + ChipLogProgress(NotSpecified, "Request the Commissioner Control Server to begin commissioning a previously approved request."); + + StringBuilder commandBuilder; + commandBuilder.Add("commissionercontrol commission-node "); + commandBuilder.AddFormat("%lu %u %lu %d", requestId, responseTimeoutSeconds, mRemoteBridgeNodeId, kRootEndpointId); + + PushCommand(commandBuilder.c_str()); +} + +void DeviceManager::HandleReverseOpenCommissioningWindow(TLV::TLVReader & data) +{ + CommissionerControl::Commands::ReverseOpenCommissioningWindow::DecodableType value; + CHIP_ERROR error = app::DataModel::Decode(data, value); + if (error != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to decode command response value. Error: %" CHIP_ERROR_FORMAT, error.Format()); + return; + } + + // Log all fields + ChipLogProgress(NotSpecified, "DecodableType fields:"); + ChipLogProgress(NotSpecified, " commissioningTimeout: %u", value.commissioningTimeout); + ChipLogProgress(NotSpecified, " discriminator: %u", value.discriminator); + ChipLogProgress(NotSpecified, " iterations: %u", value.iterations); + + char verifierHex[Crypto::kSpake2p_VerifierSerialized_Length * 2 + 1]; + Encoding::BytesToHex(value.PAKEPasscodeVerifier.data(), value.PAKEPasscodeVerifier.size(), verifierHex, sizeof(verifierHex), + Encoding::HexFlags::kNullTerminate); + ChipLogProgress(NotSpecified, " PAKEPasscodeVerifier: %s", verifierHex); + + char saltHex[Crypto::kSpake2p_Max_PBKDF_Salt_Length * 2 + 1]; + Encoding::BytesToHex(value.salt.data(), value.salt.size(), saltHex, sizeof(saltHex), Encoding::HexFlags::kNullTerminate); + ChipLogProgress(NotSpecified, " salt: %s", saltHex); + + OpenDeviceCommissioningWindow(mLocalBridgeNodeId, value.commissioningTimeout, value.iterations, value.discriminator, saltHex, + verifierHex); +} + +void DeviceManager::HandleAttributeData(const app::ConcreteDataAttributePath & path, TLV::TLVReader & data) +{ + if (path.mClusterId == CommissionerControl::Id && + path.mAttributeId == CommissionerControl::Attributes::SupportedDeviceCategories::Id) + { + HandleReadSupportedDeviceCategories(data); + return; + } + + if (path.mClusterId == Descriptor::Id && path.mAttributeId == Descriptor::Attributes::PartsList::Id) + { + HandleAttributePartsListUpdate(data); + return; + } +} + +void DeviceManager::HandleEventData(const app::EventHeader & header, TLV::TLVReader & data) { if (header.mPath.mClusterId == CommissionerControl::Id && header.mPath.mEventId == CommissionerControl::Events::CommissioningRequestResult::Id) @@ -465,7 +470,7 @@ void DeviceManager::HandleEventData(const app::EventHeader & header, TLV::TLVRea } } -void DeviceManager::HandleCommandResponse(const app::ConcreteCommandPath & path, TLV::TLVReader * data) +void DeviceManager::HandleCommandResponse(const app::ConcreteCommandPath & path, TLV::TLVReader & data) { ChipLogProgress(NotSpecified, "Command Response received."); diff --git a/examples/fabric-admin/device_manager/DeviceManager.h b/examples/fabric-admin/device_manager/DeviceManager.h index b6c7dc0e657b51..d3b47c4b332276 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.h +++ b/examples/fabric-admin/device_manager/DeviceManager.h @@ -150,11 +150,11 @@ class DeviceManager : public PairingDelegate void ReadSupportedDeviceCategories(); - void HandleAttributeData(const chip::app::ConcreteDataAttributePath & path, chip::TLV::TLVReader * data); + void HandleAttributeData(const chip::app::ConcreteDataAttributePath & path, chip::TLV::TLVReader & data); - void HandleEventData(const chip::app::EventHeader & header, chip::TLV::TLVReader * data); + void HandleEventData(const chip::app::EventHeader & header, chip::TLV::TLVReader & data); - void HandleCommandResponse(const chip::app::ConcreteCommandPath & path, chip::TLV::TLVReader * data); + void HandleCommandResponse(const chip::app::ConcreteCommandPath & path, chip::TLV::TLVReader & data); void OnDeviceRemoved(chip::NodeId deviceId, CHIP_ERROR err) override; @@ -163,11 +163,15 @@ class DeviceManager : public PairingDelegate void RequestCommissioningApproval(); - void HandleCommissioningRequestResult(chip::TLV::TLVReader * data); + void HandleReadSupportedDeviceCategories(chip::TLV::TLVReader & data); + + void HandleCommissioningRequestResult(chip::TLV::TLVReader & data); + + void HandleAttributePartsListUpdate(chip::TLV::TLVReader & data); void SendCommissionNodeRequest(uint64_t requestId, uint16_t responseTimeoutSeconds); - void HandleReverseOpenCommissioningWindow(chip::TLV::TLVReader * data); + void HandleReverseOpenCommissioningWindow(chip::TLV::TLVReader & data); static DeviceManager sInstance; From 9c79da28a732aad0ced375fed69d4ea1b0e3c3ec Mon Sep 17 00:00:00 2001 From: Rob Bultman Date: Tue, 20 Aug 2024 07:37:27 -0400 Subject: [PATCH 11/52] Move step (#35070) --- src/python_testing/TC_OpstateCommon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python_testing/TC_OpstateCommon.py b/src/python_testing/TC_OpstateCommon.py index edc72f253eead5..45d5b0918a76f2 100644 --- a/src/python_testing/TC_OpstateCommon.py +++ b/src/python_testing/TC_OpstateCommon.py @@ -1264,8 +1264,8 @@ async def TEST_TC_OPSTATE_BASE_2_6(self, endpoint=1): sub_handler = ClusterAttributeChangeAccumulator(cluster) await sub_handler.start(self.default_controller, self.dut_node_id, endpoint) - self.step(3) if self.pics_guard(self.check_pics(f"{self.test_info.pics_code}.S.M.ST_RUNNING")): + self.step(3) self.send_manual_or_pipe_command(name="OperationalStateChange", device=self.device, operation="Start") From 15ad51003f789c263eba84a1aa881c682bada3ee Mon Sep 17 00:00:00 2001 From: Rohit Jadhav <69809379+jadhavrohit924@users.noreply.github.com> Date: Tue, 20 Aug 2024 18:21:19 +0530 Subject: [PATCH 12/52] Use PRIu32 instead of %u to print unsigned integer (#35069) --- .../service-area-server.cpp | 67 ++++++++++--------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/src/app/clusters/service-area-server/service-area-server.cpp b/src/app/clusters/service-area-server/service-area-server.cpp index a7e81278838ae6..a4c132df8a6e4d 100644 --- a/src/app/clusters/service-area-server/service-area-server.cpp +++ b/src/app/clusters/service-area-server/service-area-server.cpp @@ -373,7 +373,7 @@ void Instance::HandleSkipAreaCmd(HandlerContext & ctx, const Commands::SkipArea: // If the Status field is set to InvalidAreaList, the StatusText field SHALL be an empty string. if (!IsSupportedArea(req.skippedArea)) { - ChipLogError(Zcl, "SkippedArea (%u) is not in the SupportedAreas attribute.", req.skippedArea); + ChipLogError(Zcl, "SkippedArea (%" PRIu32 ") is not in the SupportedAreas attribute.", req.skippedArea); exitResponse(SkipAreaStatus::kInvalidAreaList, ""_span); return; } @@ -453,7 +453,7 @@ bool Instance::IsValidSupportedArea(const AreaStructureWrapper & aArea) // If the LandmarkInfo field is null, the LocationInfo field SHALL NOT be null. if (aArea.areaDesc.locationInfo.IsNull() && aArea.areaDesc.landmarkInfo.IsNull()) { - ChipLogDetail(Zcl, "IsValidAsSupportedArea %u - must have locationInfo and/or LandmarkInfo", aArea.areaID); + ChipLogDetail(Zcl, "IsValidAsSupportedArea %" PRIu32 " - must have locationInfo and/or LandmarkInfo", aArea.areaID); return false; } @@ -464,8 +464,9 @@ bool Instance::IsValidSupportedArea(const AreaStructureWrapper & aArea) if (aArea.areaDesc.locationInfo.Value().locationName.empty() && aArea.areaDesc.locationInfo.Value().floorNumber.IsNull() && aArea.areaDesc.locationInfo.Value().areaType.IsNull() && aArea.areaDesc.landmarkInfo.IsNull()) { - ChipLogDetail(Zcl, "IsValidAsSupportedArea %u - AreaName is empty string, FloorNumber, AreaType, LandmarkInfo are null", - aArea.areaID); + ChipLogDetail( + Zcl, "IsValidAsSupportedArea %" PRIu32 " - AreaName is empty string, FloorNumber, AreaType, LandmarkInfo are null", + aArea.areaID); return false; } } @@ -475,14 +476,15 @@ bool Instance::IsValidSupportedArea(const AreaStructureWrapper & aArea) { if (aArea.mapID.IsNull()) { - ChipLogDetail(Zcl, "IsValidSupportedArea %u - map Id should not be null when there are supported maps", aArea.areaID); + ChipLogDetail(Zcl, "IsValidSupportedArea %" PRIu32 " - map Id should not be null when there are supported maps", + aArea.areaID); return false; } // If the SupportedMaps attribute is not null, mapID SHALL be the ID of an entry from the SupportedMaps attribute. if (!IsSupportedMap(aArea.mapID.Value())) { - ChipLogError(Zcl, "IsValidSupportedArea %u - map Id %u is not in supported map list", aArea.areaID, + ChipLogError(Zcl, "IsValidSupportedArea %" PRIu32 " - map Id %" PRIu32 " is not in supported map list", aArea.areaID, aArea.mapID.Value()); return false; } @@ -491,8 +493,8 @@ bool Instance::IsValidSupportedArea(const AreaStructureWrapper & aArea) { if (!aArea.mapID.IsNull()) { - ChipLogDetail(Zcl, "IsValidSupportedArea %u - map Id %u is not in empty supported map list", aArea.areaID, - aArea.mapID.Value()); + ChipLogDetail(Zcl, "IsValidSupportedArea %" PRIu32 " - map Id %" PRIu32 " is not in empty supported map list", + aArea.areaID, aArea.mapID.Value()); return false; } } @@ -578,14 +580,14 @@ bool Instance::AddSupportedArea(AreaStructureWrapper & aNewArea) // Check there is space for the entry. if (mDelegate->GetNumberOfSupportedAreas() >= kMaxNumSupportedAreas) { - ChipLogError(Zcl, "AddSupportedArea %u - too many entries", aNewArea.areaID); + ChipLogError(Zcl, "AddSupportedArea %" PRIu32 " - too many entries", aNewArea.areaID); return false; } // Verify cluster requirements concerning valid fields and field relationships. if (!IsValidSupportedArea(aNewArea)) { - ChipLogError(Zcl, "AddSupportedArea %u - not a valid location object", aNewArea.areaID); + ChipLogError(Zcl, "AddSupportedArea %" PRIu32 " - not a valid location object", aNewArea.areaID); return false; } @@ -595,7 +597,7 @@ bool Instance::AddSupportedArea(AreaStructureWrapper & aNewArea) // the AreaInfo field. if (!IsUniqueSupportedArea(aNewArea, false)) { - ChipLogError(Zcl, "AddSupportedArea %u - not a unique location object", aNewArea.areaID); + ChipLogError(Zcl, "AddSupportedArea %" PRIu32 " - not a unique location object", aNewArea.areaID); return false; } @@ -619,7 +621,7 @@ bool Instance::ModifySupportedArea(AreaStructureWrapper & aNewArea) AreaStructureWrapper supportedArea; if (!mDelegate->GetSupportedAreaById(aNewArea.areaID, listIndex, supportedArea)) { - ChipLogError(Zcl, "ModifySupportedArea %u - not a supported areaID", aNewArea.areaID); + ChipLogError(Zcl, "ModifySupportedArea %" PRIu32 " - not a supported areaID", aNewArea.areaID); return false; } @@ -639,7 +641,7 @@ bool Instance::ModifySupportedArea(AreaStructureWrapper & aNewArea) // verify cluster requirements concerning valid fields and field relationships if (!IsValidSupportedArea(aNewArea)) { - ChipLogError(Zcl, "ModifySupportedArea %u - not a valid location object", aNewArea.areaID); + ChipLogError(Zcl, "ModifySupportedArea %" PRIu32 " - not a valid location object", aNewArea.areaID); return false; } @@ -647,7 +649,7 @@ bool Instance::ModifySupportedArea(AreaStructureWrapper & aNewArea) // We ignore comparing the area ID as one of the locations will match this one. if (!IsUniqueSupportedArea(aNewArea, true)) { - ChipLogError(Zcl, "ModifySupportedArea %u - not a unique location object", aNewArea.areaID); + ChipLogError(Zcl, "ModifySupportedArea %" PRIu32 " - not a unique location object", aNewArea.areaID); return false; } @@ -701,14 +703,14 @@ bool Instance::AddSupportedMap(uint32_t aMapId, const CharSpan & aMapName) // check max# of list entries if (mDelegate->GetNumberOfSupportedMaps() >= kMaxNumSupportedMaps) { - ChipLogError(Zcl, "AddSupportedMap %u - maximum number of entries", aMapId); + ChipLogError(Zcl, "AddSupportedMap %" PRIu32 " - maximum number of entries", aMapId); return false; } // Map name SHALL include readable text that describes the map name (cannot be empty string). if (aMapName.empty()) { - ChipLogError(Zcl, "AddSupportedMap %u - Name must not be empty string", aMapId); + ChipLogError(Zcl, "AddSupportedMap %" PRIu32 " - Name must not be empty string", aMapId); return false; } @@ -721,7 +723,7 @@ bool Instance::AddSupportedMap(uint32_t aMapId, const CharSpan & aMapName) // the name cannot be the same as an existing map if (entry.IsNameEqual(aMapName)) { - ChipLogError(Zcl, "AddSupportedMap %u - A map already exists with same name '%.*s'", aMapId, + ChipLogError(Zcl, "AddSupportedMap %" PRIu32 " - A map already exists with same name '%.*s'", aMapId, static_cast(entry.GetName().size()), entry.GetName().data()); return false; } @@ -729,7 +731,7 @@ bool Instance::AddSupportedMap(uint32_t aMapId, const CharSpan & aMapName) // Each entry in this list SHALL have a unique value for the MapID field. if (aMapId == entry.mapID) { - ChipLogError(Zcl, "AddSupportedMap - non-unique Id %u", aMapId); + ChipLogError(Zcl, "AddSupportedMap - non-unique Id %" PRIu32 "", aMapId); return false; } } @@ -757,14 +759,14 @@ bool Instance::RenameSupportedMap(uint32_t aMapId, const CharSpan & newMapName) // get existing entry if (!mDelegate->GetSupportedMapById(aMapId, modifiedIndex, modifiedMap)) { - ChipLogError(Zcl, "RenameSupportedMap Id %u - map does not exist", aMapId); + ChipLogError(Zcl, "RenameSupportedMap Id %" PRIu32 " - map does not exist", aMapId); return false; } // Map name SHALL include readable text that describes the map's name. It cannot be empty string. if (newMapName.empty()) { - ChipLogError(Zcl, "RenameSupportedMap %u - Name must not be empty string", aMapId); + ChipLogError(Zcl, "RenameSupportedMap %" PRIu32 " - Name must not be empty string", aMapId); return false; } @@ -784,7 +786,7 @@ bool Instance::RenameSupportedMap(uint32_t aMapId, const CharSpan & newMapName) if (entry.IsNameEqual(newMapName)) { - ChipLogError(Zcl, "RenameSupportedMap %u - map already exists with same name '%.*s'", aMapId, + ChipLogError(Zcl, "RenameSupportedMap %" PRIu32 " - map already exists with same name '%.*s'", aMapId, static_cast(entry.GetName().size()), entry.GetName().data()); return false; } @@ -828,21 +830,21 @@ bool Instance::AddSelectedArea(uint32_t & aSelectedArea) // check max# of list entries if (mDelegate->GetNumberOfSelectedAreas() >= kMaxNumSelectedAreas) { - ChipLogError(Zcl, "AddSelectedArea %u - maximum number of entries", aSelectedArea); + ChipLogError(Zcl, "AddSelectedArea %" PRIu32 " - maximum number of entries", aSelectedArea); return false; } // each item in this list SHALL match the AreaID field of an entry on the SupportedAreas attribute's list if (!IsSupportedArea(aSelectedArea)) { - ChipLogError(Zcl, "AddSelectedArea %u - not a supported location", aSelectedArea); + ChipLogError(Zcl, "AddSelectedArea %" PRIu32 " - not a supported location", aSelectedArea); return false; } // each entry in this list SHALL have a unique value if (mDelegate->IsSelectedArea(aSelectedArea)) { - ChipLogError(Zcl, "AddSelectedArea %u - duplicated location", aSelectedArea); + ChipLogError(Zcl, "AddSelectedArea %" PRIu32 " - duplicated location", aSelectedArea); return false; } @@ -852,7 +854,7 @@ bool Instance::AddSelectedArea(uint32_t & aSelectedArea) if (!mDelegate->IsSetSelectedAreasAllowed(locationStatusText)) { - ChipLogError(Zcl, "AddSelectedArea %u - %.*s", aSelectedArea, static_cast(locationStatusText.size()), + ChipLogError(Zcl, "AddSelectedArea %" PRIu32 " - %.*s", aSelectedArea, static_cast(locationStatusText.size()), locationStatusText.data()); return false; } @@ -886,7 +888,7 @@ bool Instance::SetCurrentArea(const DataModel::Nullable & aCurrentArea // list. if ((!aCurrentArea.IsNull()) && (!IsSupportedArea(aCurrentArea.Value()))) { - ChipLogError(Zcl, "SetCurrentArea %u - location is not supported", aCurrentArea.Value()); + ChipLogError(Zcl, "SetCurrentArea %" PRIu32 " - location is not supported", aCurrentArea.Value()); return false; } @@ -955,14 +957,14 @@ bool Instance::AddPendingProgressElement(uint32_t aAreaId) // For each entry in this list, the AreaID field SHALL match an entry on the SupportedAreas attribute's list. if (!IsSupportedArea(aAreaId)) { - ChipLogError(Zcl, "AddPendingProgressElement - not a supported location %u", aAreaId); + ChipLogError(Zcl, "AddPendingProgressElement - not a supported location %" PRIu32 "", aAreaId); return false; } // Each entry in this list SHALL have a unique value for the AreaID field. if (mDelegate->IsProgressElement(aAreaId)) { - ChipLogError(Zcl, "AddPendingProgressElement - progress element already exists for location %u", aAreaId); + ChipLogError(Zcl, "AddPendingProgressElement - progress element already exists for location %" PRIu32 "", aAreaId); return false; } @@ -984,7 +986,7 @@ bool Instance::SetProgressStatus(uint32_t aAreaId, OperationalStatusEnum opStatu if (!mDelegate->GetProgressElementById(aAreaId, listIndex, progressElement)) { - ChipLogError(Zcl, "SetProgressStatus - progress element does not exist for location %u", aAreaId); + ChipLogError(Zcl, "SetProgressStatus - progress element does not exist for location %" PRIu32 "", aAreaId); return false; } @@ -1020,7 +1022,7 @@ bool Instance::SetProgressTotalOperationalTime(uint32_t aAreaId, const DataModel if (!mDelegate->GetProgressElementById(aAreaId, listIndex, progressElement)) { - ChipLogError(Zcl, "SetProgressTotalOperationalTime - progress element does not exist for location %u", aAreaId); + ChipLogError(Zcl, "SetProgressTotalOperationalTime - progress element does not exist for location %" PRIu32 "", aAreaId); return false; } @@ -1036,7 +1038,8 @@ bool Instance::SetProgressTotalOperationalTime(uint32_t aAreaId, const DataModel !aTotalOperationalTime.IsNull()) { ChipLogError(Zcl, - "SetProgressTotalOperationalTime - location %u opStatus value %u - can be non-null only if opStatus is " + "SetProgressTotalOperationalTime - location %" PRIu32 + " opStatus value %u - can be non-null only if opStatus is " "Completed or Skipped", aAreaId, to_underlying(progressElement.status)); return false; @@ -1062,7 +1065,7 @@ bool Instance::SetProgressEstimatedTime(uint32_t aAreaId, const DataModel::Nulla if (!mDelegate->GetProgressElementById(aAreaId, listIndex, progressElement)) { - ChipLogError(Zcl, "SetProgressEstimatedTime - progress element does not exist for location %u", aAreaId); + ChipLogError(Zcl, "SetProgressEstimatedTime - progress element does not exist for location %" PRIu32 "", aAreaId); return false; } From c3ac7658f4063ab2cd8ab3c7a367b0783c5eab3f Mon Sep 17 00:00:00 2001 From: Borys Nykytiuk <165832970+BorysNykytiuk@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:53:26 +0300 Subject: [PATCH 13/52] soc: riscv: telink_b9x, telink_w91: Auto calculation of SETTINGS_NVS_SECTOR_COUNT (#34958) - Remove sector count of NVS from metter kconfig - Sector count of NVS now calculates on Zephyr side as the storage partition size divided by the sector size (4 KB) Signed-off-by: Borys Nykytiuk --- config/telink/chip-module/Kconfig.defaults | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config/telink/chip-module/Kconfig.defaults b/config/telink/chip-module/Kconfig.defaults index 45c8894722eeea..80d07150f291d9 100644 --- a/config/telink/chip-module/Kconfig.defaults +++ b/config/telink/chip-module/Kconfig.defaults @@ -219,12 +219,7 @@ config NVS_LOOKUP_CACHE_SIZE config SETTINGS_NVS_SECTOR_SIZE_MULT default 1 -# Set sector counter of NVS -config SETTINGS_NVS_SECTOR_COUNT - default 12 - # Enable OpenThread - config NET_L2_OPENTHREAD default y if !WIFI From 9a90d8ba03837e19d9cd07af5bf6169579bfd9f3 Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Tue, 20 Aug 2024 15:53:49 +0300 Subject: [PATCH 14/52] riscv: telink: tlsr9528a_4m_flash.overlay (#34945) - follow telink flash rules . Signed-off-by: Haiwen Xia Co-authored-by: Haiwen Xia --- .../telink/tlsr9528a_4m_flash.overlay | 38 ++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/platform/telink/tlsr9528a_4m_flash.overlay b/src/platform/telink/tlsr9528a_4m_flash.overlay index 0005da2a590ab4..ec88c5742a6568 100644 --- a/src/platform/telink/tlsr9528a_4m_flash.overlay +++ b/src/platform/telink/tlsr9528a_4m_flash.overlay @@ -14,31 +14,35 @@ }; slot0_partition: partition@13000 { label = "image-0"; - reg = <0x13000 0x1ec000>; + reg = <0x13000 0x1ea000>; }; - factory_partition: partition@1ff000 { - label = "factory-data"; - reg = <0x1ff000 0x1000>; + slot1_partition: partition@1fd000 { + label = "image-1"; + reg = <0x1fd000 0x1ea000>; }; - dac_keypair_partition: partition@200000 { - label = "dac-keypair"; - reg = <0x200000 0x1000>; //store dac and key pair. + storage_partition: partition@3e7000 { + label = "storage"; + reg = <0x3e7000 0xf000>; // matter nvs part }; - descriptor_partition: partition@201000 { - label = "sboot-descriptor"; - reg = <0x201000 0x2000>; + dac_keypair_partition: partition@3f6000 { + label = "dac-keypair"; + reg = <0x3f6000 0x1000>; //store dac and key pair. }; - storage_partition: partition@203000 { - label = "storage"; - reg = <0x203000 0xf000>; + factory_partition: partition@3f7000 { + label = "factory-data"; + reg = <0x3f7000 0x1000>; // factory data info }; - slot1_partition: partition@212000 { - label = "image-1"; - reg = <0x212000 0x1ec000>; + secure_partition: partition@3f8000 { + label = "secure"; + reg = <0x3f8000 0x4000>; //secure info ,reserved for secure boot .if not use , can be used by other way . + }; + vendor_rfu_partition: partition@3fc000 { + label = "vendor-rfu"; + reg = <0x3fc000 0x2000>;// reserved for chip extend. }; vendor_partition: partition@3fe000 { label = "vendor-data"; - reg = <0x3fe000 0x2000>; + reg = <0x3fe000 0x2000>;// mac and adc info. }; }; }; From 7b7fe914f0dedf999f1c1e27f4c877baa345e411 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:25:50 -0400 Subject: [PATCH 15/52] [Silabs] Update Silabs sdks version and related enablement (#35083) * Update all sdks to new verions * 9116 changes to support sdk update * 917 changes to support sdk update * Update to provision storage for configurable address * bump matter_support submodule * Bump docker image version used for silabs ci * Restyled by clang-format * Fix wifi ncp builds --------- Co-authored-by: Mathieu Kardous Co-authored-by: Restyled.io --- .github/workflows/examples-efr32.yaml | 2 +- .gitmodules | 6 +- examples/platform/silabs/FreeRTOSConfig.h | 2 +- .../silabs/SiWx917/SiWx917/sl_wifi_if.cpp | 95 ++++++------------- examples/platform/silabs/display/demo-ui.c | 14 ++- .../platform/silabs/efr32/rs911x/rsi_if.c | 6 +- .../provision/ProvisionStorageDefault.cpp | 21 ++-- .../provision/ProvisionStorageFlash.cpp | 18 ++-- examples/platform/silabs/wfx_rsi.h | 1 - .../silabs/provision/ProvisionStorage.h | 5 +- src/platform/silabs/rs911x/ble_config.h | 19 +++- src/platform/silabs/rs911x/rsi_ble_config.h | 6 +- third_party/silabs/SiWx917_sdk.gni | 20 ---- third_party/silabs/efr32_sdk.gni | 2 + third_party/silabs/matter_support | 2 +- third_party/silabs/simplicity_sdk | 2 +- third_party/silabs/wifi_sdk | 2 +- third_party/silabs/wiseconnect-wifi-bt-sdk | 2 +- 18 files changed, 104 insertions(+), 121 deletions(-) mode change 120000 => 100644 src/platform/silabs/rs911x/ble_config.h diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index ed6f5b45fa0d1b..c236b4ca3db4c3 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-efr32:73 + image: ghcr.io/project-chip/chip-build-efr32:74 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.gitmodules b/.gitmodules index 0b015f8d14cd16..78a6cabb940d05 100644 --- a/.gitmodules +++ b/.gitmodules @@ -213,17 +213,17 @@ [submodule "third_party/silabs/simplicity_sdk"] path = third_party/silabs/simplicity_sdk url = https://github.com/SiliconLabs/simplicity_sdk.git - branch = v2024.6.0 + branch = v2024.6.1-0 platforms = silabs [submodule "third_party/silabs/wiseconnect-wifi-bt-sdk"] path = third_party/silabs/wiseconnect-wifi-bt-sdk url = https://github.com/SiliconLabs/wiseconnect-wifi-bt-sdk.git - branch = 2.8.2 + branch = 2.10.0 platforms = silabs [submodule "third_party/silabs/wifi_sdk"] path = third_party/silabs/wifi_sdk url = https://github.com/SiliconLabs/wiseconnect.git - branch = v3.3.0 + branch = v3.3.1 platforms = silabs [submodule "editline"] path = third_party/editline/repo diff --git a/examples/platform/silabs/FreeRTOSConfig.h b/examples/platform/silabs/FreeRTOSConfig.h index d2805c40654632..b27c775d9b7a54 100644 --- a/examples/platform/silabs/FreeRTOSConfig.h +++ b/examples/platform/silabs/FreeRTOSConfig.h @@ -150,7 +150,7 @@ extern uint32_t SystemCoreClock; #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 70 #define configPRE_SLEEP_PROCESSING(x) #define configPOST_SLEEP_PROCESSING(x) -#define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING(x) sl_si91x_pre_supress_ticks_and_sleep(&x) +#define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING(x) #else #define configUSE_TICKLESS_IDLE 0 #endif // SL_CATALOG_POWER_MANAGER_PRESENT diff --git a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp index bfdedbfe82bb13..03b51540cf4b6d 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp +++ b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp @@ -15,6 +15,10 @@ * limitations under the License. */ +/* + * This file implements the interface to the wifi sdk + */ + #include #include #include @@ -23,38 +27,44 @@ #include "sl_matter_wifi_config.h" #endif // SL_MATTER_GN_BUILD +#include "FreeRTOS.h" +#include "ble_config.h" +#include "dhcp_client.h" +#include "event_groups.h" +#include "sl_board_configuration.h" #include "sl_status.h" +#include "task.h" +#include "wfx_host_events.h" +#include "wfx_rsi.h" #include #include #include -#include "FreeRTOS.h" -#include "event_groups.h" -#include "sl_board_configuration.h" extern "C" { +#include "sl_net.h" +#include "sl_si91x_driver.h" +#include "sl_si91x_host_interface.h" #include "sl_si91x_types.h" +#include "sl_wifi.h" +#include "sl_wifi_callback_framework.h" #include "sl_wifi_constants.h" #include "sl_wifi_types.h" #include "sl_wlan_config.h" +#include "wfx_host_events.h" +#if SL_MBEDTLS_USE_TINYCRYPT +#include "sl_si91x_constants.h" +#include "sl_si91x_trng.h" +#endif // SL_MBEDTLS_USE_TINYCRYPT } -#include "task.h" #if (EXP_BOARD) #include "rsi_bt_common_apis.h" #endif -#include "ble_config.h" - #if CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE #include "rsi_rom_power_save.h" #include "sl_si91x_button_pin_config.h" -#if DISPLAY_ENABLED -#include "sl_memlcd.h" -#endif // DISPLAY_ENABLED -extern "C" { -#include "sl_si91x_driver.h" -#include "sl_si91x_m4_ps.h" -} +#include "sl_si91x_power_manager.h" namespace { // TODO: should be removed once we are getting the press interrupt for button 0 with sleep @@ -67,9 +77,6 @@ bool ps_requirement_added = false; } // namespace #endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE -#include "dhcp_client.h" -#include "wfx_host_events.h" -#include "wfx_rsi.h" #define ADV_SCAN_THRESHOLD -40 #define ADV_RSSI_TOLERANCE_THRESHOLD 5 #define ADV_ACTIVE_SCAN_DURATION 15 @@ -79,17 +86,9 @@ bool ps_requirement_added = false; // TODO: Confirm that this value works for size and timing #define WFX_QUEUE_SIZE 10 -extern "C" { -#include "sl_net.h" -#include "sl_si91x_host_interface.h" -#include "sl_wifi.h" -#include "sl_wifi_callback_framework.h" -#include "wfx_host_events.h" -#if SL_MBEDTLS_USE_TINYCRYPT -#include "sl_si91x_constants.h" -#include "sl_si91x_trng.h" -#endif // SL_MBEDTLS_USE_TINYCRYPT -} + +// TODO: Figure out why we actually need this, we are already handling failure and retries somewhere else. +#define WIFI_SCAN_TIMEOUT_TICK 10000 WfxRsi_t wfx_rsi; @@ -109,20 +108,9 @@ bool is_wifi_disconnection_event = false; uint32_t retryInterval = WLAN_MIN_RETRY_TIMER_MS; volatile bool scan_results_complete = false; volatile bool bg_scan_results_complete = false; - -// TODO: Figure out why we actually need this, we are already handling failure and retries somewhere else. -#define WIFI_SCAN_TIMEOUT_TICK 10000 - extern osSemaphoreId_t sl_rs_ble_init_sem; - -/* - * This file implements the interface to the wifi sdk - */ - static wfx_wifi_scan_ext_t temp_reset; - volatile sl_status_t callback_status = SL_STATUS_OK; - // Scan semaphore static osSemaphoreId_t sScanSemaphore; // DHCP Poll timer @@ -319,28 +307,6 @@ void sl_si91x_invoke_btn_press_event() } #endif // ENABLE_CHIP_SHELL } - -/****************************************************************** - * @fn sl_app_sleep_ready() - * @brief - * Called from the supress ticks from tickless to check if it - * is ok to go to sleep - * @param[in] None - * @return - * None - *********************************************************************/ -uint32_t sl_app_sleep_ready() -{ - if (wfx_rsi.dev_state & WFX_RSI_ST_SLEEP_READY) - { -#if DISPLAY_ENABLED - // Powering down the LCD - sl_memlcd_power_on(NULL, false); -#endif /* DISPLAY_ENABLED */ - return true; - } - return false; -} #endif // SLI_SI91X_MCU_INTERFACE /****************************************************************** @@ -370,14 +336,7 @@ int32_t wfx_rsi_power_save(rsi_power_save_profile_mode_t sl_si91x_ble_state, sl_ ChipLogError(DeviceLayer, "sl_wifi_set_performance_profile failed: 0x%lx", static_cast(status)); return status; } - if (sl_si91x_wifi_state == HIGH_PERFORMANCE) - { - wfx_rsi.dev_state &= ~(WFX_RSI_ST_SLEEP_READY); - } - else - { - wfx_rsi.dev_state |= WFX_RSI_ST_SLEEP_READY; - } + return status; } #endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */ diff --git a/examples/platform/silabs/display/demo-ui.c b/examples/platform/silabs/display/demo-ui.c index 479af92fd5bb90..e0fe37ec9cb09b 100644 --- a/examples/platform/silabs/display/demo-ui.c +++ b/examples/platform/silabs/display/demo-ui.c @@ -25,6 +25,7 @@ #include "glib.h" #include "sl_component_catalog.h" #include "sl_memlcd.h" +#include #if SL_WIFI && !SLI_SI91X_MCU_INTERFACE #include "spi_multiplex.h" #endif // SL_WIFI && !SLI_SI91X_MCU_INTERFACE @@ -106,9 +107,12 @@ void demoUIInit(GLIB_Context_t * context) sl_status_t updateDisplay(void) { sl_status_t status = SL_STATUS_OK; -#if SLI_SI91X_MCU_INTERFACE && SL_ICD_ENABLED && DISPLAY_ENABLED + +#if SLI_SI91X_MCU_INTERFACE && CHIP_CONFIG_ENABLE_ICD_SERVER + // In sleep, memlcd will not be retained so re-initialize MEMLCD interface after sleep wakeup sl_memlcd_post_wakeup_init(); -#endif // SLI_SI91X_MCU_INTERFACE && SL_ICD_ENABLED && DISPLAY_ENABLED +#endif // SLI_SI91X_MCU_INTERFACE && SL_ICD_ENABLED && CHIP_CONFIG_ENABLE_ICD_SERVER + #if SL_LCDCTRL_MUX status = sl_wfx_host_pre_lcd_spi_transfer(); if (status != SL_STATUS_OK) @@ -123,6 +127,12 @@ sl_status_t updateDisplay(void) return status; #endif // SL_LCDCTRL_MUX +#if SLI_SI91X_MCU_INTERFACE && CHIP_CONFIG_ENABLE_ICD_SERVER + // MEMLCD is not a UULP component and not available in sleep so powering down before sleep and need to be re-initialized after + // sleep-wakeup + sl_memlcd_power_on(NULL, false); +#endif // SLI_SI91X_MCU_INTERFACE && CHIP_CONFIG_ENABLE_ICD_SERVER + return SL_STATUS_OK; } diff --git a/examples/platform/silabs/efr32/rs911x/rsi_if.c b/examples/platform/silabs/efr32/rs911x/rsi_if.c index a08e2a2f292de1..e4d6f51bf0ded9 100644 --- a/examples/platform/silabs/efr32/rs911x/rsi_if.c +++ b/examples/platform/silabs/efr32/rs911x/rsi_if.c @@ -511,9 +511,9 @@ static void wfx_rsi_save_ap_info() // translation case SME_WEP: wfx_rsi.sec.security = WFX_SEC_WEP; break; - case SME_WPA3_TRANSITION: + case SME_WPA3_PERSONAL_TRANSITION: #if WIFI_ENABLE_SECURITY_WPA3_TRANSITION - case SME_WPA3: + case SME_WPA3_PERSONAL: wfx_rsi.sec.security = WFX_SEC_WPA3; #else wfx_rsi.sec.security = WFX_SEC_WPA2; @@ -557,7 +557,7 @@ static void wfx_rsi_do_join(void) break; #if WIFI_ENABLE_SECURITY_WPA3_TRANSITION case WFX_SEC_WPA3: - connect_security_mode = RSI_WPA3_TRANSITION; + connect_security_mode = RSI_WPA3_PERSONAL_TRANSITION; break; #endif // WIFI_ENABLE_SECURITY_WPA3_TRANSITION case WFX_SEC_NONE: diff --git a/examples/platform/silabs/provision/ProvisionStorageDefault.cpp b/examples/platform/silabs/provision/ProvisionStorageDefault.cpp index 1162323cda3d51..801eb9e0b70c2e 100644 --- a/examples/platform/silabs/provision/ProvisionStorageDefault.cpp +++ b/examples/platform/silabs/provision/ProvisionStorageDefault.cpp @@ -90,7 +90,7 @@ size_t RoundNearest(size_t n, size_t multiple) CHIP_ERROR WriteFile(Storage & store, SilabsConfig::Key offset_key, SilabsConfig::Key size_key, const ByteSpan & value) { uint32_t base_addr = 0; - ReturnErrorOnFailure(store.GetBaseAddress(base_addr)); + ReturnErrorOnFailure(store.GetCredentialsBaseAddress(base_addr)); if (0 == sCredentialsOffset) { ReturnErrorOnFailure(ErasePage(base_addr)); @@ -120,7 +120,7 @@ CHIP_ERROR WriteFile(Storage & store, SilabsConfig::Key offset_key, SilabsConfig CHIP_ERROR ReadFileByOffset(Storage & store, const char * description, uint32_t offset, uint32_t size, MutableByteSpan & value) { uint32_t base_addr = 0; - ReturnErrorOnFailure(store.GetBaseAddress(base_addr)); + ReturnErrorOnFailure(store.GetCredentialsBaseAddress(base_addr)); uint8_t * address = (uint8_t *) (base_addr + offset); ByteSpan span(address, size); @@ -167,12 +167,7 @@ CHIP_ERROR Storage::Initialize(uint32_t flash_addr, uint32_t flash_size) setNvm3End(base_addr); #endif } - return SilabsConfig::WriteConfigValue(SilabsConfig::kConfigKey_Creds_Base_Addr, base_addr); -} - -CHIP_ERROR Storage::GetBaseAddress(uint32_t & value) -{ - return SilabsConfig::ReadConfigValue(SilabsConfig::kConfigKey_Creds_Base_Addr, value); + return SetCredentialsBaseAddress(base_addr); } CHIP_ERROR Storage::Commit() @@ -625,6 +620,16 @@ CHIP_ERROR Storage::SignWithDeviceAttestationKey(const ByteSpan & message, Mutab // Other // +CHIP_ERROR Storage::SetCredentialsBaseAddress(uint32_t addr) +{ + return SilabsConfig::WriteConfigValue(SilabsConfig::kConfigKey_Creds_Base_Addr, addr); +} + +CHIP_ERROR Storage::GetCredentialsBaseAddress(uint32_t & addr) +{ + return SilabsConfig::ReadConfigValue(SilabsConfig::kConfigKey_Creds_Base_Addr, addr); +} + CHIP_ERROR Storage::SetProvisionVersion(const char * value, size_t size) { return SilabsConfig::WriteConfigValueStr(SilabsConfig::kConfigKey_Provision_Version, value, size); diff --git a/examples/platform/silabs/provision/ProvisionStorageFlash.cpp b/examples/platform/silabs/provision/ProvisionStorageFlash.cpp index 35a32d6af8f5ec..af59d6560cd0fc 100644 --- a/examples/platform/silabs/provision/ProvisionStorageFlash.cpp +++ b/examples/platform/silabs/provision/ProvisionStorageFlash.cpp @@ -296,12 +296,6 @@ CHIP_ERROR Storage::Commit() return CHIP_NO_ERROR; } -CHIP_ERROR Storage::GetBaseAddress(uint32_t & value) -{ - value = (uint32_t) Flash::sReadOnlyPage; - return CHIP_NO_ERROR; -} - // // DeviceInstanceInfoProvider // @@ -675,6 +669,18 @@ CHIP_ERROR Storage::SignWithDeviceAttestationKey(const ByteSpan & message, Mutab // Other // +CHIP_ERROR Storage::SetCredentialsBaseAddress(uint32_t addr) +{ + Flash::sReadOnlyPage = (uint8_t *) addr; + return CHIP_NO_ERROR; +} + +CHIP_ERROR Storage::GetCredentialsBaseAddress(uint32_t & addr) +{ + addr = (uint32_t) Flash::sReadOnlyPage; + return CHIP_NO_ERROR; +} + CHIP_ERROR Storage::SetProvisionVersion(const char * value, size_t size) { return Flash::Set(Parameters::ID::kVersion, value, size); diff --git a/examples/platform/silabs/wfx_rsi.h b/examples/platform/silabs/wfx_rsi.h index c47a4ee0af251e..c559e1e7610880 100644 --- a/examples/platform/silabs/wfx_rsi.h +++ b/examples/platform/silabs/wfx_rsi.h @@ -62,7 +62,6 @@ typedef enum WFX_RSI_ST_STA_READY = (WFX_RSI_ST_STA_CONNECTED | WFX_RSI_ST_STA_DHCP_DONE), WFX_RSI_ST_STARTED = (1 << 9), /* RSI task started */ WFX_RSI_ST_SCANSTARTED = (1 << 10), /* Scan Started */ - WFX_RSI_ST_SLEEP_READY = (1 << 11) /* Notify the M4 to go to sleep*/ } WfxStateType_e; typedef struct WfxEvent_s diff --git a/src/platform/silabs/provision/ProvisionStorage.h b/src/platform/silabs/provision/ProvisionStorage.h index 3dbc78076442a7..ff012491ae3d7c 100644 --- a/src/platform/silabs/provision/ProvisionStorage.h +++ b/src/platform/silabs/provision/ProvisionStorage.h @@ -42,7 +42,7 @@ enum ID : uint16_t kFlashAddress = 0x0101, kFlashSize = 0x0102, kFlashPageSize = 0x0103, - kBaseAddress = 0x0104, + kCredsAddress = 0x0104, kCsrFile = 0x0105, // Options, kVersion = 0x0111, @@ -175,7 +175,6 @@ struct Storage : public GenericStorage, CHIP_ERROR Initialize(uint32_t flash_addr = 0, uint32_t flash_size = 0); CHIP_ERROR Commit(); - CHIP_ERROR GetBaseAddress(uint32_t & value); // // Generic Interface @@ -233,6 +232,8 @@ struct Storage : public GenericStorage, // Other // + CHIP_ERROR SetCredentialsBaseAddress(uint32_t addr); + CHIP_ERROR GetCredentialsBaseAddress(uint32_t & addr); CHIP_ERROR GetSetupPayload(chip::MutableCharSpan & value); CHIP_ERROR SetProvisionRequest(bool value); CHIP_ERROR GetProvisionRequest(bool & value); diff --git a/src/platform/silabs/rs911x/ble_config.h b/src/platform/silabs/rs911x/ble_config.h deleted file mode 120000 index 48a308dc911649..00000000000000 --- a/src/platform/silabs/rs911x/ble_config.h +++ /dev/null @@ -1 +0,0 @@ -rsi_ble_config.h \ No newline at end of file diff --git a/src/platform/silabs/rs911x/ble_config.h b/src/platform/silabs/rs911x/ble_config.h new file mode 100644 index 00000000000000..0b8c951b4f63b1 --- /dev/null +++ b/src/platform/silabs/rs911x/ble_config.h @@ -0,0 +1,18 @@ +/******************************************************************************* + * @file ble_config.h + * @brief + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ + +#include diff --git a/src/platform/silabs/rs911x/rsi_ble_config.h b/src/platform/silabs/rs911x/rsi_ble_config.h index f5442578e5d013..781ad80a29e7d7 100644 --- a/src/platform/silabs/rs911x/rsi_ble_config.h +++ b/src/platform/silabs/rs911x/rsi_ble_config.h @@ -24,6 +24,10 @@ #include #endif +#if SL_MATTER_GN_BUILD == 0 +#include "sl_matter_wifi_config.h" +#endif // SL_MATTER_GN_BUILD + /****************************************************** * * Macros * ******************************************************/ @@ -107,7 +111,7 @@ #else #define RSI_BLE_MAX_NBR_ATT_REC (80) -#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD) +#if (EXP_BOARD) #define RSI_BLE_MAX_NBR_PERIPHERALS (3) #else #define RSI_BLE_MAX_NBR_SLAVES (3) diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index 8c7635ad9235d3..1163cd28c99de3 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -27,17 +27,8 @@ import("silabs_board.gni") examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" declare_args() { - # Enable the Alarm Based Wakeup for 917 SoC when sleep is enabled - si91x_alarm_based_periodic_wakeup = false - - # Periodic time at which the 917 SoC should wakeup - si91x_alarm_periodic_time = 30 - # option to select the crypto library sl_si91x_crypto_flavor = "tinycrypt" - - # enable 917 SoC M4 sleep wakeup - si917_m4_sleep_enabled = false } # Defines an siwx917 SDK build target. @@ -325,17 +316,6 @@ template("siwx917_sdk") { "SL_SI91X_POWER_MANAGER_UC_AVAILABLE=1", "SL_SI91X_TICKLESS_MODE=1", ] - - if (si91x_alarm_based_periodic_wakeup) { - defines += [ "ALARM_PERIODIC_TIME=${si91x_alarm_periodic_time}" ] - } - - if (si917_m4_sleep_enabled) { - defines += [ - "SI917_M4_SLEEP_ENABLED=1", - "XTAL_OFF", - ] - } } if (sl_uart_log_output) { diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index c9126d02e43a9f..617dfd10facb95 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -485,6 +485,8 @@ template("efr32_sdk") { "RSI_LITTLE_ENDIAN=1", "SLI_SI91X_ENABLE_BLE=1", "SL_SI91X_ENABLE_LITTLE_ENDIAN=1", + "RSI_BLE_MAX_NBR_PERIPHERALS=1", + "RSI_BLE_MAX_NBR_CENTRALS=1", ] } diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index 8f476b30f9c604..e313f2dc9663da 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 8f476b30f9c6041de334abadcdb6852ade77790e +Subproject commit e313f2dc9663da1ee4488eceba17dbff038f6a63 diff --git a/third_party/silabs/simplicity_sdk b/third_party/silabs/simplicity_sdk index a1a37fa7dda1f7..aa5ce2e835dfdc 160000 --- a/third_party/silabs/simplicity_sdk +++ b/third_party/silabs/simplicity_sdk @@ -1 +1 @@ -Subproject commit a1a37fa7dda1f76ea70229aa4ffe2e47cb066edc +Subproject commit aa5ce2e835dfdce8c20fb828f27d3a261946f946 diff --git a/third_party/silabs/wifi_sdk b/third_party/silabs/wifi_sdk index e97a0ed00ddda3..841ea3f7e0e8ce 160000 --- a/third_party/silabs/wifi_sdk +++ b/third_party/silabs/wifi_sdk @@ -1 +1 @@ -Subproject commit e97a0ed00ddda347a8a39e8276f470e1c5fea469 +Subproject commit 841ea3f7e0e8ce64a160ae2354e747260a61b1e9 diff --git a/third_party/silabs/wiseconnect-wifi-bt-sdk b/third_party/silabs/wiseconnect-wifi-bt-sdk index c3843e95e63f84..f94b83d050fe62 160000 --- a/third_party/silabs/wiseconnect-wifi-bt-sdk +++ b/third_party/silabs/wiseconnect-wifi-bt-sdk @@ -1 +1 @@ -Subproject commit c3843e95e63f84e301a2727f7b3c26125818b53a +Subproject commit f94b83d050fe6200c5ec2dacfafa2edc92ad5ef3 From 88b66443a240cd2b181ab8c02b630fe3806b414e Mon Sep 17 00:00:00 2001 From: fesseha-eve <88329315+fessehaeve@users.noreply.github.com> Date: Tue, 20 Aug 2024 17:05:27 +0200 Subject: [PATCH 16/52] In TC-ICDM-3.4 make sure that a new session will be used after DUT reboots (#35092) * after DUT reboots make sure that a new session will be used fixes #34985 * updated comment to reflect closing the session than expiring it * re-establish session only when not in CI --- src/python_testing/TC_ICDM_3_4.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/python_testing/TC_ICDM_3_4.py b/src/python_testing/TC_ICDM_3_4.py index 61230532178a08..b062da0845e4ea 100644 --- a/src/python_testing/TC_ICDM_3_4.py +++ b/src/python_testing/TC_ICDM_3_4.py @@ -32,7 +32,8 @@ import time import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from matter_testing_support import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, + default_matter_test_main) from mobly import asserts logger = logging.getLogger(__name__) @@ -110,6 +111,16 @@ async def test_TC_ICDM_3_4(self): time.sleep(wait_time_reboot) self.step(3) + if not is_ci: + # since device has rebooted, force establishing a new CASE session by closing it + self.config = MatterTestConfig() + self.stack = MatterStackState(self.config) + devCtrl = self.stack.certificate_authorities[0].adminList[0].NewController( + nodeId=self.config.controller_node_id, + paaTrustStorePath=str(self.config.paa_trust_store_path), + catTags=self.config.controller_cat_tags + ) + devCtrl.CloseSession(self.dut_node_id) icdCounter2 = await self._read_icdm_attribute_expect_success(attribute=attributes.ICDCounter) asserts.assert_greater_equal(icdCounter2, icdCounter1, "ICDCounter have reboot is not greater or equal to the ICDCounter read before the reboot.") From 7f84a48ed903e51875d7418cb2da3537173c2ebc Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Tue, 20 Aug 2024 09:33:35 -0700 Subject: [PATCH 17/52] [Darwin] MTRDeviceController_XPC client protocol xpc interface fix (#35087) --- .../Framework/CHIP/MTRDeviceController_XPC.mm | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index 157a38199f025e..49fd7c32f9f61f 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -43,6 +43,26 @@ @implementation MTRDeviceController_XPC @synthesize uniqueIdentifier = _uniqueIdentifier; +- (NSXPCInterface *)_interfaceForClientProtocol +{ + NSXPCInterface * interface = [NSXPCInterface interfaceWithProtocol:@protocol(MTRXPCClientProtocol)]; + NSSet * allowedClasses = [NSSet setWithArray:@[ + [NSString class], [NSNumber class], [NSData class], [NSArray class], [NSDictionary class], [NSError class], [MTRAttributePath class] + ]]; + [interface setClasses:allowedClasses + forSelector:@selector(device:receivedAttributeReport:) + argumentIndex:1 + ofReply:NO]; + allowedClasses = [NSSet setWithArray:@[ + [NSString class], [NSNumber class], [NSData class], [NSArray class], [NSDictionary class], [NSError class], [MTREventPath class] + ]]; + [interface setClasses:allowedClasses + forSelector:@selector(device:receivedEventReport:) + argumentIndex:1 + ofReply:NO]; + return interface; +} + - (id)initWithUniqueIdentifier:(NSUUID *)UUID xpConnectionBlock:(NSXPCConnection * (^)(void) )connectionBlock { if (self = [super initForSubclasses]) { @@ -64,7 +84,7 @@ - (id)initWithUniqueIdentifier:(NSUUID *)UUID xpConnectionBlock:(NSXPCConnection if (self.xpcConnection) { self.xpcConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MTRXPCServerProtocol)]; - self.xpcConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MTRXPCClientProtocol)]; + self.xpcConnection.exportedInterface = [self _interfaceForClientProtocol]; self.xpcConnection.exportedObject = self; self.xpcConnection.interruptionHandler = ^{ From b367512f519e5e109346e81a0d84fd85cd9192f7 Mon Sep 17 00:00:00 2001 From: William Date: Tue, 20 Aug 2024 18:26:53 +0100 Subject: [PATCH 18/52] Fix SkipArea logic and removed the use of memcpy (#35075) * Updated the SkipArea serever handle to not error if the CurrentArea is null, according to the spec updates. * Replaced the use of memcpy with CopyCharSpanToMutableCharSpan. * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../service-area-cluster-objects.h | 28 +++++-------------- .../service-area-server.cpp | 9 ------ 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/src/app/clusters/service-area-server/service-area-cluster-objects.h b/src/app/clusters/service-area-server/service-area-cluster-objects.h index 1b040c53cdc1bf..66f20720701587 100644 --- a/src/app/clusters/service-area-server/service-area-cluster-objects.h +++ b/src/app/clusters/service-area-server/service-area-cluster-objects.h @@ -110,9 +110,9 @@ struct AreaStructureWrapper : public chip::app::Clusters::ServiceArea::Structs:: { areaDesc.locationInfo.SetNonNull(); // Copy the name - auto sizeToCopy = std::min(sizeof(mAreaNameBuffer), locationName.size()); - memcpy(mAreaNameBuffer, locationName.data(), sizeToCopy); - areaDesc.locationInfo.Value().locationName = CharSpan(mAreaNameBuffer, sizeToCopy); + auto areaNameSpan = MutableCharSpan(mAreaNameBuffer, kAreaNameMaxSize); + CopyCharSpanToMutableCharSpan(locationName, areaNameSpan); + areaDesc.locationInfo.Value().locationName = CharSpan(areaNameSpan.data(), areaNameSpan.size()); areaDesc.locationInfo.Value().floorNumber = floorNumber; areaDesc.locationInfo.Value().areaType = areaType; @@ -320,24 +320,10 @@ struct MapStructureWrapper : public chip::app::Clusters::ServiceArea::Structs::M */ void Set(uint32_t aMapId, const CharSpan & aMapName) { - mapID = aMapId; - - if (aMapName.empty()) - { - name = CharSpan(mMapNameBuffer, 0); - } - else if (aMapName.size() > sizeof(mMapNameBuffer)) - { - // Save the truncated name that fits into available size. - memcpy(mMapNameBuffer, aMapName.data(), sizeof(mMapNameBuffer)); - name = CharSpan(mMapNameBuffer, sizeof(mMapNameBuffer)); - } - else - { - // Save full name. - memcpy(mMapNameBuffer, aMapName.data(), aMapName.size()); - name = CharSpan(mMapNameBuffer, aMapName.size()); - } + mapID = aMapId; + auto mapNameSpan = MutableCharSpan(mMapNameBuffer, kMapNameMaxSize); + CopyCharSpanToMutableCharSpan(aMapName, mapNameSpan); + name = CharSpan(mapNameSpan.data(), mapNameSpan.size()); } /** diff --git a/src/app/clusters/service-area-server/service-area-server.cpp b/src/app/clusters/service-area-server/service-area-server.cpp index a4c132df8a6e4d..baf56cd4fc84be 100644 --- a/src/app/clusters/service-area-server/service-area-server.cpp +++ b/src/app/clusters/service-area-server/service-area-server.cpp @@ -378,15 +378,6 @@ void Instance::HandleSkipAreaCmd(HandlerContext & ctx, const Commands::SkipArea: return; } - // If the CurrentArea attribute is null, the status should be set to InvalidInMode. - // If the Status field is not set to Success, or InvalidAreaList, the StatusText field SHALL include a vendor defined error - // description. - if (mCurrentArea.IsNull()) - { - exitResponse(SkipAreaStatus::kInvalidInMode, "Current Area attribute is null"_span); - return; - } - // have the device attempt to skip // If the Status field is not set to Success, or InvalidAreaList, the StatusText field SHALL include a vendor defined error // description. InvalidInMode | The received request cannot be handled due to the current mode of the device. (skipStatusText to From 1866812d8ad73c90652ddd70d98de9d8670c9953 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 20 Aug 2024 15:17:05 -0400 Subject: [PATCH 19/52] Move delegate management into shared MTRDevice super-class. (#35084) * Move delegate management into shared MTRDevice super-class. MTRDevice_XPC and MTRDevice_Concrete can then share that code. * Address review comments, fix TAPI build. --- src/darwin/Framework/CHIP/MTRDevice.mm | 130 ++------- .../Framework/CHIP/MTRDevice_Concrete.mm | 246 +----------------- .../Framework/CHIP/MTRDevice_Internal.h | 78 +++++- src/darwin/Framework/CHIP/MTRDevice_XPC.mm | 11 + 4 files changed, 114 insertions(+), 351 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index d8fc52b1a2fc6e..b2fc853fb9b955 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -64,43 +64,6 @@ // Disabling pending crashes #define ENABLE_CONNECTIVITY_MONITORING 0 -// Consider moving utility classes to their own file -#pragma mark - Utility Classes - -// container of MTRDevice delegate weak reference, its queue, and its interested paths for attribute reports -MTR_DIRECT_MEMBERS -@interface MTRDeviceDelegateInfo : NSObject { -@private - void * _delegatePointerValue; - __weak id _delegate; - dispatch_queue_t _queue; - NSArray * _Nullable _interestedPathsForAttributes; - NSArray * _Nullable _interestedPathsForEvents; -} - -// Array of interested cluster paths, attribute paths, or endpointID, for attribute report filtering. -@property (readonly, nullable) NSArray * interestedPathsForAttributes; - -// Array of interested cluster paths, attribute paths, or endpointID, for event report filtering. -@property (readonly, nullable) NSArray * interestedPathsForEvents; - -// Expose delegate -@property (readonly) id delegate; - -// Pointer value for logging purpose only -@property (readonly) void * delegatePointerValue; - -- (instancetype)initWithDelegate:(id)delegate queue:(dispatch_queue_t)queue interestedPathsForAttributes:(NSArray * _Nullable)interestedPathsForAttributes interestedPathsForEvents:(NSArray * _Nullable)interestedPathsForEvents; - -// Returns YES if delegate and queue are both non-null, and the block is scheduled to run. -- (BOOL)callDelegateWithBlock:(void (^)(id))block; - -#ifdef DEBUG -// Only used for unit test purposes - normal delegate should not expect or handle being called back synchronously. -- (BOOL)callDelegateSynchronouslyWithBlock:(void (^)(id))block; -#endif -@end - @implementation MTRDeviceDelegateInfo - (instancetype)initWithDelegate:(id)delegate queue:(dispatch_queue_t)queue interestedPathsForAttributes:(NSArray * _Nullable)interestedPathsForAttributes interestedPathsForEvents:(NSArray * _Nullable)interestedPathsForEvents { @@ -371,7 +334,6 @@ - (BOOL)isEqual:(id)object #define MTRDEVICE_SUBSCRIPTION_LATENCY_NEW_VALUE_WEIGHT (1.0 / 3.0) @interface MTRDevice () -@property (nonatomic, readonly) os_unfair_lock lock; // protects the caches and device state // protects against concurrent time updates by guarding timeUpdateScheduled flag which manages time updates scheduling, // and protects device calls to setUTCTime and setDSTOffset. This can't just be replaced with "lock", because the time // update code calls public APIs like readAttributeWithEndpointID:.. (which attempt to take "lock") while holding @@ -502,8 +464,6 @@ @implementation MTRDevice { // System time change observer reference id _systemTimeChangeObserverToken; - NSMutableSet * _delegates; - // Protects mutable state used by our description getter. This is a separate lock from "lock" // so that we don't need to worry about getting our description while holding "lock" (e.g due to // logging self). This lock _must_ be held narrowly, with no other lock acquisitions allowed @@ -526,10 +486,11 @@ @implementation MTRDevice { NSDate * _Nullable _lastSubscriptionFailureTimeForDescription; } -- (instancetype)initForSubclasses +- (instancetype)initForSubclassesWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller { if (self = [super init]) { - // nothing, as superclass of MTRDevice is NSObject + _lock = OS_UNFAIR_LOCK_INIT; + _delegates = [NSMutableSet set]; } return self; @@ -875,6 +836,8 @@ - (BOOL)_subscriptionsAllowed { os_unfair_lock_assert_owner(&self->_lock); + // TODO: XPC: This function and all its callsites should go away from this class. + // We should not allow a subscription for device controllers over XPC. return ![_deviceController isKindOfClass:MTRDeviceControllerOverXPC.class]; } @@ -923,34 +886,14 @@ - (void)_addDelegate:(id)delegate queue:(dispatch_queue_t)que [_delegates addObject:newDelegateInfo]; MTR_LOG("%@ added delegate info %@", self, newDelegateInfo); - __block BOOL shouldSetUpSubscription = [self _subscriptionsAllowed]; - - // For unit testing only. If this ever changes to not being for unit testing purposes, - // we would need to move the code outside of where we acquire the lock above. -#ifdef DEBUG - [self _callFirstDelegateSynchronouslyWithBlock:^(id testDelegate) { - if ([testDelegate respondsToSelector:@selector(unitTestShouldSetUpSubscriptionForDevice:)]) { - shouldSetUpSubscription = [testDelegate unitTestShouldSetUpSubscriptionForDevice:self]; - } - }]; -#endif + // Call hook to allow subclasses to act on delegate addition. + [self _delegateAdded]; +} - if (shouldSetUpSubscription) { - MTR_LOG("%@ - starting subscription setup", self); - // Record the time of first addDelegate call that triggers initial subscribe, and do not reset this value on subsequent addDelegate calls - if (!_initialSubscribeStart) { - _initialSubscribeStart = [NSDate now]; - } - if ([self _deviceUsesThread]) { - MTR_LOG(" => %@ - device is a thread device, scheduling in pool", self); - [self _scheduleSubscriptionPoolWork:^{ - std::lock_guard lock(self->_lock); - [self _setupSubscriptionWithReason:@"delegate is set and scheduled subscription is happening"]; - } inNanoseconds:0 description:@"MTRDevice setDelegate first subscription"]; - } else { - [self _setupSubscriptionWithReason:@"delegate is set and subscription is needed"]; - } - } +- (void)_delegateAdded +{ + // Nothing to do; this is a hook for subclasses. If that ever changes for + // some reason, subclasses need to start calling this hook on their super. } - (void)removeDelegate:(id)delegate @@ -962,7 +905,10 @@ - (void)removeDelegate:(id)delegate NSMutableSet * delegatesToRemove = [NSMutableSet set]; [self _iterateDelegatesWithBlock:^(MTRDeviceDelegateInfo * delegateInfo) { id strongDelegate = delegateInfo.delegate; - if (strongDelegate == delegate) { + if (!strongDelegate) { + [delegatesToRemove addObject:delegateInfo]; + MTR_LOG("%@ removing delegate info for nil delegate %p", self, delegateInfo.delegatePointerValue); + } else if (strongDelegate == delegate) { [delegatesToRemove addObject:delegateInfo]; MTR_LOG("%@ removing delegate info %@ for %p", self, delegateInfo, delegate); } @@ -976,45 +922,9 @@ - (void)removeDelegate:(id)delegate - (void)invalidate { - MTR_LOG("%@ invalidate", self); - - [_asyncWorkQueue invalidate]; - - os_unfair_lock_lock(&self->_timeSyncLock); - _timeUpdateScheduled = NO; - os_unfair_lock_unlock(&self->_timeSyncLock); - - os_unfair_lock_lock(&self->_lock); - - _state = MTRDeviceStateUnknown; + std::lock_guard lock(_lock); [_delegates removeAllObjects]; - - // Make sure we don't try to resubscribe if we have a pending resubscribe - // attempt, since we now have no delegate. - _reattemptingSubscription = NO; - - [_deviceController asyncDispatchToMatterQueue:^{ - MTR_LOG("%@ invalidate disconnecting ReadClient and SubscriptionCallback", self); - - // Destroy the read client and callback (has to happen on the Matter - // queue, to avoid deleting objects that are being referenced), to - // tear down the subscription. We will get no more callbacks from - // the subscription after this point. - std::lock_guard lock(self->_lock); - self->_currentReadClient = nullptr; - if (self->_currentSubscriptionCallback) { - delete self->_currentSubscriptionCallback; - } - self->_currentSubscriptionCallback = nullptr; - - [self _changeInternalState:MTRInternalDeviceStateUnsubscribed]; - } - errorHandler:nil]; - - [self _stopConnectivityMonitoring]; - - os_unfair_lock_unlock(&self->_lock); } - (void)nodeMayBeAdvertisingOperational @@ -1145,8 +1055,7 @@ - (BOOL)_delegateExists return [self _iterateDelegatesWithBlock:nil]; } -// Returns YES if any non-null delegates were found -- (BOOL)_iterateDelegatesWithBlock:(void(NS_NOESCAPE ^)(MTRDeviceDelegateInfo * delegateInfo)_Nullable)block +- (BOOL)_iterateDelegatesWithBlock:(void(NS_NOESCAPE ^ _Nullable)(MTRDeviceDelegateInfo * delegateInfo))block { os_unfair_lock_assert_owner(&self->_lock); @@ -1198,7 +1107,6 @@ - (BOOL)_callDelegatesWithBlock:(void (^)(id delegate))block #ifdef DEBUG // Only used for unit test purposes - normal delegate should not expect or handle being called back synchronously -// Returns YES if a delegate is called - (void)_callFirstDelegateSynchronouslyWithBlock:(void (^)(id delegate))block { os_unfair_lock_assert_owner(&self->_lock); @@ -2496,6 +2404,8 @@ - (void)unitTestResetSubscription // assume lock is held - (void)_setupSubscriptionWithReason:(NSString *)reason { + // TODO: XPC: This is not really called anymore in this class. Should + // remove this function and anything only reachable from it. os_unfair_lock_assert_owner(&self->_lock); if (![self _subscriptionsAllowed]) { diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index e22b0b8edff243..c9f4b7f07d295e 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -74,84 +74,6 @@ @interface MTRDevice_Concrete () // Disabling pending crashes #define ENABLE_CONNECTIVITY_MONITORING 0 -// Consider moving utility classes to their own file -#pragma mark - Utility Classes - -// container of MTRDevice delegate weak reference, its queue, and its interested paths for attribute reports -MTR_DIRECT_MEMBERS -@interface MTRDeviceDelegateInfo_ConcreteCopy : NSObject { -@private - void * _delegatePointerValue; - __weak id _delegate; - dispatch_queue_t _queue; - NSArray * _Nullable _interestedPathsForAttributes; - NSArray * _Nullable _interestedPathsForEvents; -} - -// Array of interested cluster paths, attribute paths, or endpointID, for attribute report filtering. -@property (readonly, nullable) NSArray * interestedPathsForAttributes; - -// Array of interested cluster paths, attribute paths, or endpointID, for event report filtering. -@property (readonly, nullable) NSArray * interestedPathsForEvents; - -// Expose delegate -@property (readonly) id delegate; - -// Pointer value for logging purpose only -@property (readonly) void * delegatePointerValue; - -- (instancetype)initWithDelegate:(id)delegate queue:(dispatch_queue_t)queue interestedPathsForAttributes:(NSArray * _Nullable)interestedPathsForAttributes interestedPathsForEvents:(NSArray * _Nullable)interestedPathsForEvents; - -// Returns YES if delegate and queue are both non-null, and the block is scheduled to run. -- (BOOL)callDelegateWithBlock:(void (^)(id))block; - -#ifdef DEBUG -// Only used for unit test purposes - normal delegate should not expect or handle being called back synchronously. -- (BOOL)callDelegateSynchronouslyWithBlock:(void (^)(id))block; -#endif -@end - -@implementation MTRDeviceDelegateInfo_ConcreteCopy -- (instancetype)initWithDelegate:(id)delegate queue:(dispatch_queue_t)queue interestedPathsForAttributes:(NSArray * _Nullable)interestedPathsForAttributes interestedPathsForEvents:(NSArray * _Nullable)interestedPathsForEvents -{ - if (self = [super init]) { - _delegate = delegate; - _delegatePointerValue = (__bridge void *) delegate; - _queue = queue; - _interestedPathsForAttributes = [interestedPathsForAttributes copy]; - _interestedPathsForEvents = [interestedPathsForEvents copy]; - } - return self; -} - -- (NSString *)description -{ - return [NSString stringWithFormat:@"", self, _delegatePointerValue, static_cast(_interestedPathsForAttributes.count), static_cast(_interestedPathsForEvents.count)]; -} - -- (BOOL)callDelegateWithBlock:(void (^)(id))block -{ - id strongDelegate = _delegate; - VerifyOrReturnValue(strongDelegate, NO); - dispatch_async(_queue, ^{ - block(strongDelegate); - }); - return YES; -} - -#ifdef DEBUG -- (BOOL)callDelegateSynchronouslyWithBlock:(void (^)(id))block -{ - id strongDelegate = _delegate; - VerifyOrReturnValue(strongDelegate, NO); - - block(strongDelegate); - - return YES; -} -#endif -@end - /* BEGIN DRAGONS: Note methods here cannot be renamed, and are used by private callers, do not rename, remove or modify behavior here */ @interface NSObject (MatterPrivateForInternalDragonsDoNotFeed) @@ -281,7 +203,6 @@ typedef NS_ENUM(NSUInteger, MTRDeviceWorkItemDuplicateTypeID) { #define MTRDEVICE_SUBSCRIPTION_LATENCY_NEW_VALUE_WEIGHT (1.0 / 3.0) @interface MTRDevice_Concrete () -@property (nonatomic, readonly) os_unfair_lock lock; // protects the caches and device state // protects against concurrent time updates by guarding timeUpdateScheduled flag which manages time updates scheduling, // and protects device calls to setUTCTime and setDSTOffset. This can't just be replaced with "lock", because the time // update code calls public APIs like readAttributeWithEndpointID:.. (which attempt to take "lock") while holding @@ -412,8 +333,6 @@ @implementation MTRDevice_Concrete { // System time change observer reference id _systemTimeChangeObserverToken; - NSMutableSet * _delegates; - // Protects mutable state used by our description getter. This is a separate lock from "lock" // so that we don't need to worry about getting our description while holding "lock" (e.g due to // logging self). This lock _must_ be held narrowly, with no other lock acquisitions allowed @@ -450,8 +369,7 @@ @implementation MTRDevice_Concrete { - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller { // `super` was NSObject, is now MTRDevice. MTRDevice hides its `init` - if (self = [super initForSubclasses]) { - _lock = OS_UNFAIR_LOCK_INIT; + if (self = [super initForSubclassesWithNodeID:nodeID controller:controller]) { _timeSyncLock = OS_UNFAIR_LOCK_INIT; _descriptionLock = OS_UNFAIR_LOCK_INIT; _nodeID = [nodeID copy]; @@ -483,8 +401,6 @@ - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceControlle }]; } - _delegates = [NSMutableSet set]; - MTR_LOG_DEBUG("%@ init with hex nodeID 0x%016llX", self, _nodeID.unsignedLongLongValue); } return self; @@ -792,49 +708,9 @@ - (BOOL)_subscriptionsAllowed return ![_deviceController isKindOfClass:MTRDeviceControllerOverXPC.class]; } -- (void)setDelegate:(id)delegate queue:(dispatch_queue_t)queue -{ - MTR_LOG("%@ setDelegate %@", self, delegate); - [self _addDelegate:delegate queue:queue interestedPathsForAttributes:nil interestedPathsForEvents:nil]; -} - -- (void)addDelegate:(id)delegate queue:(dispatch_queue_t)queue -{ - MTR_LOG("%@ addDelegate %@", self, delegate); - [self _addDelegate:delegate queue:queue interestedPathsForAttributes:nil interestedPathsForEvents:nil]; -} - -- (void)addDelegate:(id)delegate queue:(dispatch_queue_t)queue interestedPathsForAttributes:(NSArray * _Nullable)interestedPathsForAttributes interestedPathsForEvents:(NSArray * _Nullable)interestedPathsForEvents +- (void)_delegateAdded { - MTR_LOG("%@ addDelegate %@ with interested attribute paths %@ event paths %@", self, delegate, interestedPathsForAttributes, interestedPathsForEvents); - [self _addDelegate:delegate queue:queue interestedPathsForAttributes:interestedPathsForAttributes interestedPathsForEvents:interestedPathsForEvents]; -} - -- (void)_addDelegate:(id)delegate queue:(dispatch_queue_t)queue interestedPathsForAttributes:(NSArray * _Nullable)interestedPathsForAttributes interestedPathsForEvents:(NSArray * _Nullable)interestedPathsForEvents -{ - std::lock_guard lock(_lock); - - // Replace delegate info with the same delegate object, and opportunistically remove defunct delegate references - NSMutableSet * delegatesToRemove = [NSMutableSet set]; - for (MTRDeviceDelegateInfo_ConcreteCopy * delegateInfo in _delegates) { - id strongDelegate = delegateInfo.delegate; - if (!strongDelegate) { - [delegatesToRemove addObject:delegateInfo]; - MTR_LOG("%@ removing delegate info for nil delegate %p", self, delegateInfo.delegatePointerValue); - } else if (strongDelegate == delegate) { - [delegatesToRemove addObject:delegateInfo]; - MTR_LOG("%@ replacing delegate info for %p", self, delegate); - } - } - if (delegatesToRemove.count) { - NSUInteger oldDelegatesCount = _delegates.count; - [_delegates minusSet:delegatesToRemove]; - MTR_LOG("%@ addDelegate: removed %lu", self, static_cast(_delegates.count - oldDelegatesCount)); - } - - MTRDeviceDelegateInfo_ConcreteCopy * newDelegateInfo = [[MTRDeviceDelegateInfo_ConcreteCopy alloc] initWithDelegate:delegate queue:queue interestedPathsForAttributes:interestedPathsForAttributes interestedPathsForEvents:interestedPathsForEvents]; - [_delegates addObject:newDelegateInfo]; - MTR_LOG("%@ added delegate info %@", self, newDelegateInfo); + os_unfair_lock_assert_owner(&self->_lock); __block BOOL shouldSetUpSubscription = [self _subscriptionsAllowed]; @@ -866,27 +742,6 @@ - (void)_addDelegate:(id)delegate queue:(dispatch_queue_t)que } } -- (void)removeDelegate:(id)delegate -{ - MTR_LOG("%@ removeDelegate %@", self, delegate); - - std::lock_guard lock(_lock); - - NSMutableSet * delegatesToRemove = [NSMutableSet set]; - [self _iterateDelegatesWithBlock:^(MTRDeviceDelegateInfo_ConcreteCopy * delegateInfo) { - id strongDelegate = delegateInfo.delegate; - if (strongDelegate == delegate) { - [delegatesToRemove addObject:delegateInfo]; - MTR_LOG("%@ removing delegate info %@ for %p", self, delegateInfo, delegate); - } - }]; - if (delegatesToRemove.count) { - NSUInteger oldDelegatesCount = _delegates.count; - [_delegates minusSet:delegatesToRemove]; - MTR_LOG("%@ removeDelegate: removed %lu", self, static_cast(_delegates.count - oldDelegatesCount)); - } -} - - (void)invalidate { MTR_LOG("%@ invalidate", self); @@ -901,8 +756,6 @@ - (void)invalidate _state = MTRDeviceStateUnknown; - [_delegates removeAllObjects]; - // Make sure we don't try to resubscribe if we have a pending resubscribe // attempt, since we now have no delegate. _reattemptingSubscription = NO; @@ -928,6 +781,8 @@ - (void)invalidate [self _stopConnectivityMonitoring]; os_unfair_lock_unlock(&self->_lock); + + [super invalidate]; } - (void)nodeMayBeAdvertisingOperational @@ -1052,79 +907,6 @@ - (void)_readThroughSkipped errorHandler:nil]; } -- (BOOL)_delegateExists -{ - os_unfair_lock_assert_owner(&self->_lock); - return [self _iterateDelegatesWithBlock:nil]; -} - -// Returns YES if any non-null delegates were found -- (BOOL)_iterateDelegatesWithBlock:(void(NS_NOESCAPE ^)(MTRDeviceDelegateInfo_ConcreteCopy * delegateInfo)_Nullable)block -{ - os_unfair_lock_assert_owner(&self->_lock); - - if (!_delegates.count) { - MTR_LOG_DEBUG("%@ no delegates to iterate", self); - return NO; - } - - // Opportunistically remove defunct delegate references on every iteration - NSMutableSet * delegatesToRemove = nil; - for (MTRDeviceDelegateInfo_ConcreteCopy * delegateInfo in _delegates) { - id strongDelegate = delegateInfo.delegate; - if (strongDelegate) { - if (block) { - @autoreleasepool { - block(delegateInfo); - } - } - (void) strongDelegate; // ensure it stays alive - } else { - if (!delegatesToRemove) { - delegatesToRemove = [NSMutableSet set]; - } - [delegatesToRemove addObject:delegateInfo]; - } - } - - if (delegatesToRemove.count) { - [_delegates minusSet:delegatesToRemove]; - MTR_LOG("%@ _iterateDelegatesWithBlock: removed %lu remaining %lu", self, static_cast(delegatesToRemove.count), (unsigned long) static_cast(_delegates.count)); - } - - return (_delegates.count > 0); -} - -- (BOOL)_callDelegatesWithBlock:(void (^)(id delegate))block -{ - os_unfair_lock_assert_owner(&self->_lock); - - __block NSUInteger delegatesCalled = 0; - [self _iterateDelegatesWithBlock:^(MTRDeviceDelegateInfo_ConcreteCopy * delegateInfo) { - if ([delegateInfo callDelegateWithBlock:block]) { - delegatesCalled++; - } - }]; - - return (delegatesCalled > 0); -} - -#ifdef DEBUG -// Only used for unit test purposes - normal delegate should not expect or handle being called back synchronously -// Returns YES if a delegate is called -- (void)_callFirstDelegateSynchronouslyWithBlock:(void (^)(id delegate))block -{ - os_unfair_lock_assert_owner(&self->_lock); - - for (MTRDeviceDelegateInfo_ConcreteCopy * delegateInfo in _delegates) { - if ([delegateInfo callDelegateSynchronouslyWithBlock:block]) { - MTR_LOG("%@ _callFirstDelegateSynchronouslyWithBlock: successfully called %@", self, delegateInfo); - return; - } - } -} -#endif - - (void)_callDelegateDeviceCachePrimed { os_unfair_lock_assert_owner(&self->_lock); @@ -1944,7 +1726,7 @@ - (void)_reportAttributes:(NSArray *> *)attributes { os_unfair_lock_assert_owner(&self->_lock); if (attributes.count) { - [self _iterateDelegatesWithBlock:^(MTRDeviceDelegateInfo_ConcreteCopy * delegateInfo) { + [self _iterateDelegatesWithBlock:^(MTRDeviceDelegateInfo * delegateInfo) { // _iterateDelegatesWithBlock calls this with an autorelease pool, and so temporary filtered attributes reports don't bloat memory NSArray *> * filteredAttributes = [self _filteredAttributes:attributes forInterestedPaths:delegateInfo.interestedPathsForAttributes]; if (filteredAttributes.count) { @@ -2123,7 +1905,7 @@ - (void)_handleEventReport:(NSArray *> *)eventRepor } __block BOOL delegatesCalled = NO; - [self _iterateDelegatesWithBlock:^(MTRDeviceDelegateInfo_ConcreteCopy * delegateInfo) { + [self _iterateDelegatesWithBlock:^(MTRDeviceDelegateInfo * delegateInfo) { // _iterateDelegatesWithBlock calls this with an autorelease pool, and so temporary filtered event reports don't bloat memory NSArray *> * filteredEvents = [self _filteredEvents:reportToReturn forInterestedPaths:delegateInfo.interestedPathsForEvents]; if (filteredEvents.count) { @@ -2658,20 +2440,6 @@ - (NSUInteger)unitTestAttributesReportedSinceLastCheck _unitTestAttributesReportedSinceLastCheck = 0; return attributesReportedSinceLastCheck; } - -- (NSUInteger)unitTestNonnullDelegateCount -{ - std::lock_guard lock(self->_lock); - - NSUInteger nonnullDelegateCount = 0; - for (MTRDeviceDelegateInfo_ConcreteCopy * delegateInfo in _delegates) { - if (delegateInfo.delegate) { - nonnullDelegateCount++; - } - } - - return nonnullDelegateCount; -} #endif #pragma mark Device Interactions diff --git a/src/darwin/Framework/CHIP/MTRDevice_Internal.h b/src/darwin/Framework/CHIP/MTRDevice_Internal.h index 4c1b51f51c0a48..b0cc25d11f76d6 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDevice_Internal.h @@ -18,6 +18,7 @@ #import #import #import +#import #import "MTRAsyncWorkQueue.h" #import "MTRDefines_Internal.h" @@ -65,8 +66,68 @@ MTR_TESTABLE - (nullable instancetype)initWithDataVersion:(NSNumber * _Nullable)dataVersion attributes:(NSDictionary * _Nullable)attributes; @end -@interface MTRDevice () -- (instancetype)initForSubclasses; +// Consider moving utility classes to their own file +#pragma mark - Utility Classes + +/** + * container of MTRDevice delegate weak reference, its queue, and its interested + * paths for attribute reports. + */ +MTR_DIRECT_MEMBERS +@interface MTRDeviceDelegateInfo : NSObject { +@private + void * _delegatePointerValue; + __weak id _delegate; + dispatch_queue_t _queue; +} + +// Array of interested cluster paths, attribute paths, or endpointID, for attribute report filtering. +@property (readonly, nullable) NSArray * interestedPathsForAttributes; + +// Array of interested cluster paths, attribute paths, or endpointID, for event report filtering. +@property (readonly, nullable) NSArray * interestedPathsForEvents; + +// Expose delegate +@property (readonly) id delegate; + +// Pointer value for logging purpose only +@property (readonly) void * delegatePointerValue; + +- (instancetype)initWithDelegate:(id)delegate queue:(dispatch_queue_t)queue interestedPathsForAttributes:(NSArray * _Nullable)interestedPathsForAttributes interestedPathsForEvents:(NSArray * _Nullable)interestedPathsForEvents; + +// Returns YES if delegate and queue are both non-null, and the block is scheduled to run. +- (BOOL)callDelegateWithBlock:(void (^)(id))block; + +#ifdef DEBUG +// Only used for unit test purposes - normal delegate should not expect or handle being called back synchronously. +- (BOOL)callDelegateSynchronouslyWithBlock:(void (^)(id))block; +#endif +@end + +#pragma mark - MTRDevice internal extensions + +@interface MTRDevice () { + // Ivars needed to implement shared MTRDevice functionality. + // + // Unfortunately, we can't use @protected here, because that exports the + // symbols (so that subclasses that are not part of the framework can see + // them), but TAPI does not see these declarations, because they are in a + // project header. + // + // Using @package means that the symbols do not need to be exported, but + // unfortunately gets treated as @public from inside our framework, which + // means random other framework code can access these ivars. Hopefully the + // naming with leading '_' will make it clearer that random other code + // should not touch these. + // + // TODO: Figure out some way of doing @protected but still not exporting the symbol. +@package + // Lock that protects overall device state, including delegate storage. + os_unfair_lock _lock; + NSMutableSet * _delegates; +} + +- (instancetype)initForSubclassesWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller; - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller; // Called from MTRClusters for writes and commands @@ -123,6 +184,19 @@ MTR_TESTABLE // Returns whether this MTRDevice uses Thread for communication - (BOOL)deviceUsesThread; +#pragma mark - MTRDevice functionality to deal with delegates. + +// Returns YES if any non-null delegates were found +- (BOOL)_iterateDelegatesWithBlock:(void(NS_NOESCAPE ^ _Nullable)(MTRDeviceDelegateInfo * delegateInfo))block; + +- (BOOL)_delegateExists; + +#ifdef DEBUG +// Only used for unit test purposes - normal delegate should not expect or handle being called back synchronously +// Returns YES if a delegate is called +- (void)_callFirstDelegateSynchronouslyWithBlock:(void (^)(id delegate))block; +#endif + @end #pragma mark - Constants diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index 69eba5bc6f5ea4..b3c9e75f6a0b63 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -82,6 +82,17 @@ @implementation MTRDevice_XPC +- (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller +{ + // TODO: Verify that this is a valid MTRDeviceController_XPC? + + if (self = [super initForSubclassesWithNodeID:nodeID controller:controller]) { + // Nothing else to do, all set. + } + + return self; +} + #pragma mark - Client Callbacks (MTRDeviceDelegate) // required methods for MTRDeviceDelegates From 56ed10aca41af05c20632017a4d2dda9f318cdc7 Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:53:27 -0700 Subject: [PATCH 20/52] [Darwin] MTRDevice_XPC delegate callbacks need to hold lock before _callDelegatesWithBlock (#35095) * [Darwin] MTRDevice_XPC delegate callbacks need to hold lock before _callDelegatesWithBlock * Add back _callDelegatesWithBlock to avoid conflict --- src/darwin/Framework/CHIP/MTRDevice.mm | 6 ++++++ src/darwin/Framework/CHIP/MTRDevice_Internal.h | 3 +++ src/darwin/Framework/CHIP/MTRDevice_XPC.mm | 12 ++++++------ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index b2fc853fb9b955..ff4a76147d855f 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -1105,6 +1105,12 @@ - (BOOL)_callDelegatesWithBlock:(void (^)(id delegate))block return (delegatesCalled > 0); } +- (BOOL)_lockAndCallDelegatesWithBlock:(void (^)(id delegate))block +{ + std::lock_guard lock(self->_lock); + return [self _callDelegatesWithBlock:block]; +} + #ifdef DEBUG // Only used for unit test purposes - normal delegate should not expect or handle being called back synchronously - (void)_callFirstDelegateSynchronouslyWithBlock:(void (^)(id delegate))block diff --git a/src/darwin/Framework/CHIP/MTRDevice_Internal.h b/src/darwin/Framework/CHIP/MTRDevice_Internal.h index b0cc25d11f76d6..5a826dc9875bbe 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDevice_Internal.h @@ -144,6 +144,9 @@ MTR_DIRECT_MEMBERS - (BOOL)_callDelegatesWithBlock:(void (^)(id delegate))block; +// Called by MTRDevice_XPC to forward delegate callbacks +- (BOOL)_lockAndCallDelegatesWithBlock:(void (^)(id delegate))block; + /** * Like the public invokeCommandWithEndpointID but: * diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index b3c9e75f6a0b63..7dfb8da370823e 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -99,7 +99,7 @@ - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceControlle - (oneway void)device:(NSNumber *)nodeID stateChanged:(MTRDeviceState)state { MTR_LOG("%s", __PRETTY_FUNCTION__); - [self _callDelegatesWithBlock:^(id delegate) { + [self _lockAndCallDelegatesWithBlock:^(id delegate) { [delegate device:self stateChanged:state]; }]; } @@ -107,7 +107,7 @@ - (oneway void)device:(NSNumber *)nodeID stateChanged:(MTRDeviceState)state - (oneway void)device:(NSNumber *)nodeID receivedAttributeReport:(NSArray *> *)attributeReport { MTR_LOG("%s", __PRETTY_FUNCTION__); - [self _callDelegatesWithBlock:^(id delegate) { + [self _lockAndCallDelegatesWithBlock:^(id delegate) { [delegate device:self receivedAttributeReport:attributeReport]; }]; } @@ -115,7 +115,7 @@ - (oneway void)device:(NSNumber *)nodeID receivedAttributeReport:(NSArray *> *)eventReport { MTR_LOG("%s", __PRETTY_FUNCTION__); - [self _callDelegatesWithBlock:^(id delegate) { + [self _lockAndCallDelegatesWithBlock:^(id delegate) { [delegate device:self receivedEventReport:eventReport]; }]; } @@ -124,7 +124,7 @@ - (oneway void)device:(NSNumber *)nodeID receivedEventReport:(NSArray delegate) { + [self _lockAndCallDelegatesWithBlock:^(id delegate) { if ([delegate respondsToSelector:@selector(deviceBecameActive:)]) { [delegate deviceBecameActive:self]; } @@ -133,7 +133,7 @@ - (oneway void)deviceBecameActive:(NSNumber *)nodeID - (oneway void)deviceCachePrimed:(NSNumber *)nodeID { - [self _callDelegatesWithBlock:^(id delegate) { + [self _lockAndCallDelegatesWithBlock:^(id delegate) { if ([delegate respondsToSelector:@selector(deviceCachePrimed:)]) { [delegate deviceCachePrimed:self]; } @@ -142,7 +142,7 @@ - (oneway void)deviceCachePrimed:(NSNumber *)nodeID - (oneway void)deviceConfigurationChanged:(NSNumber *)nodeID { - [self _callDelegatesWithBlock:^(id delegate) { + [self _lockAndCallDelegatesWithBlock:^(id delegate) { if ([delegate respondsToSelector:@selector(deviceConfigurationChanged:)]) { [delegate deviceConfigurationChanged:self]; } From 068da6143c28c2235c35f03e68c6c8a6a47db532 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Tue, 20 Aug 2024 16:20:45 -0400 Subject: [PATCH 21/52] Add plumbing that allows fabric-bridge endpoints to report CADMIN attr (#35076) --- .../fabric-bridge-common/BUILD.gn | 2 + .../BridgedAdministratorCommissioning.h | 58 +++++++++++++ .../include/BridgedDevice.h | 12 +++ .../src/BridgedAdministratorCommissioning.cpp | 81 +++++++++++++++++++ examples/fabric-bridge-app/linux/main.cpp | 3 + 5 files changed, 156 insertions(+) create mode 100644 examples/fabric-bridge-app/fabric-bridge-common/include/BridgedAdministratorCommissioning.h create mode 100644 examples/fabric-bridge-app/fabric-bridge-common/src/BridgedAdministratorCommissioning.cpp diff --git a/examples/fabric-bridge-app/fabric-bridge-common/BUILD.gn b/examples/fabric-bridge-app/fabric-bridge-common/BUILD.gn index 7f2fbcbbfe0556..157032f8f93c19 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/BUILD.gn +++ b/examples/fabric-bridge-app/fabric-bridge-common/BUILD.gn @@ -41,10 +41,12 @@ source_set("fabric-bridge-lib") { public_configs = [ ":config" ] sources = [ + "include/BridgedAdministratorCommissioning.h", "include/BridgedDevice.h", "include/BridgedDeviceBasicInformationImpl.h", "include/BridgedDeviceManager.h", "include/CHIPProjectAppConfig.h", + "src/BridgedAdministratorCommissioning.cpp", "src/BridgedDevice.cpp", "src/BridgedDeviceBasicInformationImpl.cpp", "src/BridgedDeviceManager.cpp", diff --git a/examples/fabric-bridge-app/fabric-bridge-common/include/BridgedAdministratorCommissioning.h b/examples/fabric-bridge-app/fabric-bridge-common/include/BridgedAdministratorCommissioning.h new file mode 100644 index 00000000000000..06fd9026d44225 --- /dev/null +++ b/examples/fabric-bridge-app/fabric-bridge-common/include/BridgedAdministratorCommissioning.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +/** + * @brief CADMIN cluster implementation for handling attribute interactions of bridged device endpoints. + * + * The current Administrator Commissioning Cluster server's zap generated code will automatically + * register an Attribute Access Interface for the root node endpoint implementation. In order to + * properly respond to a read attribute for bridged devices we are representing, we override the + * currently registered Attribute Interface such that we are first to receive any read attribute + * request on Administrator Commissioning Cluster, and if it is not an endpoint for a device we + * are a bridge for we redirect to the default cluster server implementation of Administrator + * Commissioning Cluster. + */ +class BridgedAdministratorCommissioning : public chip::app::AttributeAccessInterface +{ +public: + // Register for the AdministratorCommissioning cluster on all endpoints. + BridgedAdministratorCommissioning() : + AttributeAccessInterface(chip::NullOptional, chip::app::Clusters::AdministratorCommissioning::Id) + {} + + CHIP_ERROR Init(); + + CHIP_ERROR Read(const chip::app::ConcreteReadAttributePath & aPath, chip::app::AttributeValueEncoder & aEncoder) override; + + // We do not allow writing to CADMIN attributes of a bridged device endpoint. We simply redirect + // write requests to the original attribute interface. + CHIP_ERROR Write(const chip::app::ConcreteDataAttributePath & aPath, chip::app::AttributeValueDecoder & aDecoder) override + { + VerifyOrDie(mOriginalAttributeInterface); + return mOriginalAttributeInterface->Write(aPath, aDecoder); + } + +private: + // If mOriginalAttributeInterface is removed from here, the class description needs to be updated + // to reflect this change. + chip::app::AttributeAccessInterface * mOriginalAttributeInterface = nullptr; +}; diff --git a/examples/fabric-bridge-app/fabric-bridge-common/include/BridgedDevice.h b/examples/fabric-bridge-app/fabric-bridge-common/include/BridgedDevice.h index 3dab8d3b16b2d6..7081278f4dc0f3 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/include/BridgedDevice.h +++ b/examples/fabric-bridge-app/fabric-bridge-common/include/BridgedDevice.h @@ -18,6 +18,7 @@ #pragma once +#include #include #include @@ -40,6 +41,14 @@ class BridgedDevice std::string softwareVersionString; }; + struct AdminCommissioningAttributes + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum commissioningWindowStatus = + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum::kWindowNotOpen; + std::optional openerFabricIndex = std::nullopt; + std::optional openerVendorId = std::nullopt; + }; + BridgedDevice(chip::NodeId nodeId); virtual ~BridgedDevice() = default; @@ -59,6 +68,8 @@ class BridgedDevice [[nodiscard]] const BridgedAttributes & GetBridgedAttributes() const { return mAttributes; } void SetBridgedAttributes(const BridgedAttributes & value) { mAttributes = value; } + // TODO(#35077): Need to allow mAdminCommissioningAttributes to be set from fabric-admin. + const AdminCommissioningAttributes & GetAdminCommissioningAttributes() const { return mAdminCommissioningAttributes; } /// Convenience method to set just the unique id of a bridged device as it /// is one of the few attributes that is not always bulk-set @@ -73,4 +84,5 @@ class BridgedDevice chip::EndpointId mParentEndpointId = 0; BridgedAttributes mAttributes; + AdminCommissioningAttributes mAdminCommissioningAttributes; }; diff --git a/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedAdministratorCommissioning.cpp b/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedAdministratorCommissioning.cpp new file mode 100644 index 00000000000000..c7bca223d92382 --- /dev/null +++ b/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedAdministratorCommissioning.cpp @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "BridgedAdministratorCommissioning.h" + +#include "BridgedDevice.h" +#include "BridgedDeviceManager.h" +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::AdministratorCommissioning; + +CHIP_ERROR BridgedAdministratorCommissioning::Init() +{ + // We expect initialization after all embr plugin clusters initialization. This allows us to unregister + // the existing AccessAttributeInterface for AdministratorCommissioning and register ourselves, ensuring + // we get the callback for reading attribute. If the read is not intended for a bridged device we will + // forward it to the original attribute interface that we are unregistering. + mOriginalAttributeInterface = AttributeAccessInterfaceRegistry::Instance().Get(kRootEndpointId, AdministratorCommissioning::Id); + VerifyOrReturnError(mOriginalAttributeInterface, CHIP_ERROR_INTERNAL); + AttributeAccessInterfaceRegistry::Instance().Unregister(mOriginalAttributeInterface); + VerifyOrDie(AttributeAccessInterfaceRegistry::Instance().Register(this)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR BridgedAdministratorCommissioning::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +{ + VerifyOrDie(aPath.mClusterId == Clusters::AdministratorCommissioning::Id); + EndpointId endpointId = aPath.mEndpointId; + BridgedDevice * device = BridgeDeviceMgr().GetDevice(endpointId); + + if (!device) + { + VerifyOrDie(mOriginalAttributeInterface); + return mOriginalAttributeInterface->Read(aPath, aEncoder); + } + auto attr = device->GetAdminCommissioningAttributes(); + + switch (aPath.mAttributeId) + { + case Attributes::WindowStatus::Id: { + return aEncoder.Encode(attr.commissioningWindowStatus); + } + case Attributes::AdminFabricIndex::Id: { + DataModel::Nullable encodeableFabricIndex = DataModel::NullNullable; + if (attr.openerFabricIndex.has_value()) + { + encodeableFabricIndex.SetNonNull(attr.openerFabricIndex.value()); + } + return aEncoder.Encode(encodeableFabricIndex); + } + case Attributes::AdminVendorId::Id: { + DataModel::Nullable encodeableVendorId = DataModel::NullNullable; + if (attr.openerVendorId.has_value()) + { + encodeableVendorId.SetNonNull(attr.openerVendorId.value()); + } + return aEncoder.Encode(encodeableVendorId); + } + default: + break; + } + + return CHIP_NO_ERROR; +} diff --git a/examples/fabric-bridge-app/linux/main.cpp b/examples/fabric-bridge-app/linux/main.cpp index 3b6502421045f8..eeb290210caa6b 100644 --- a/examples/fabric-bridge-app/linux/main.cpp +++ b/examples/fabric-bridge-app/linux/main.cpp @@ -18,6 +18,7 @@ #include +#include "BridgedAdministratorCommissioning.h" #include "BridgedDevice.h" #include "BridgedDeviceBasicInformationImpl.h" #include "BridgedDeviceManager.h" @@ -234,6 +235,7 @@ void BridgedDeviceInformationCommandHandler::InvokeCommand(HandlerContext & hand handlerContext.mCommandHandler.AddStatus(handlerContext.mRequestPath, status); } +BridgedAdministratorCommissioning gBridgedAdministratorCommissioning; AdministratorCommissioningCommandHandler gAdministratorCommissioningCommandHandler; BridgedDeviceInformationCommandHandler gBridgedDeviceInformationCommandHandler; @@ -258,6 +260,7 @@ void ApplicationInit() pollingThread.detach(); BridgeDeviceMgr().Init(); + VerifyOrDie(gBridgedAdministratorCommissioning.Init() == CHIP_NO_ERROR); VerifyOrDieWithMsg(CommissionerControlInit() == CHIP_NO_ERROR, NotSpecified, "Failed to initialize Commissioner Control Server"); From 23903bdffc806788c1f5484ac9acecd8a298183c Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 20 Aug 2024 18:51:02 -0400 Subject: [PATCH 22/52] Make the MTRDevice ivars protected. (#35101) It seems like by default we have the following visibility options here: @private - subclasses can't touch, not workable. @public - anyone can touch, not desirable. @package - @public inside Matter.framework, @private ouside it. Does not export the symbols, but anyone inside Matter.framework can touch. @protected - only subclasses can touch, but exports the symbols in case we have out-of-framework subclasses who want to touch it. Since the declarations are in a project header that TAPI does not know about in release builds, we get complaints about mismatches between what's declared public and what's exported. What we would really want here is "@protected inside Matter.framework, @private ouside it", but that does not exist. So this switches to @protected, and uses linker arguments to not export the symbols in release builds. Since the header itself is not public, this accomplishes the same goal. In debug builds, we do expose project headers to TAPI, hence there we want to keep exporting the symbols. The linker arguments just prevent exporting all ivar symbols, since we shouldn't be exporting any of those anyway. --- src/darwin/Framework/CHIP/MTRDevice_Internal.h | 15 +-------------- .../Framework/Matter.xcodeproj/project.pbxproj | 2 ++ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice_Internal.h b/src/darwin/Framework/CHIP/MTRDevice_Internal.h index 5a826dc9875bbe..bce5abfdfed75d 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDevice_Internal.h @@ -108,20 +108,7 @@ MTR_DIRECT_MEMBERS @interface MTRDevice () { // Ivars needed to implement shared MTRDevice functionality. - // - // Unfortunately, we can't use @protected here, because that exports the - // symbols (so that subclasses that are not part of the framework can see - // them), but TAPI does not see these declarations, because they are in a - // project header. - // - // Using @package means that the symbols do not need to be exported, but - // unfortunately gets treated as @public from inside our framework, which - // means random other framework code can access these ivars. Hopefully the - // naming with leading '_' will make it clearer that random other code - // should not touch these. - // - // TODO: Figure out some way of doing @protected but still not exporting the symbol. -@package +@protected // Lock that protects overall device state, including delegate storage. os_unfair_lock _lock; NSMutableSet * _delegates; diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index 3a5968072d5a8d..efafd27d28dc1e 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -2565,6 +2565,7 @@ "-Wl,-unexported_symbol,\"___*\"", "-Wl,-unexported_symbol,\"__Unwind_*\"", "-Wl,-unexported_symbol,\"_unw_*\"", + "-Wl,-unexported_symbol,\"_OBJC_IVAR_*\"", "-Wl,-hidden-lCHIP", ); "OTHER_LDFLAGS[sdk=macosx*]" = ( @@ -2583,6 +2584,7 @@ "-Wl,-unexported_symbol,\"___*\"", "-Wl,-unexported_symbol,\"__Unwind_*\"", "-Wl,-unexported_symbol,\"_unw_*\"", + "-Wl,-unexported_symbol,\"_OBJC_IVAR_*\"", "-Wl,-hidden-lCHIP", ); PRODUCT_BUNDLE_IDENTIFIER = com.csa.matter; From bb26a589c7184eeb137ba93a73e212424e1f0b4d Mon Sep 17 00:00:00 2001 From: C Freeman Date: Tue, 20 Aug 2024 19:28:44 -0400 Subject: [PATCH 23/52] IDM-12.1: Also dump to log (#35098) * IDM-12.1: Also dump to log * simplify print command --- src/python_testing/TC_DeviceBasicComposition.py | 13 ++++++++++++- src/python_testing/basic_composition_support.py | 11 ++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py index 7af7b865542e42..72e6e3e2418c8c 100644 --- a/src/python_testing/TC_DeviceBasicComposition.py +++ b/src/python_testing/TC_DeviceBasicComposition.py @@ -775,7 +775,18 @@ def test_TC_IDM_12_1(self): software_version = self.endpoints[0][Clusters.BasicInformation][Clusters.BasicInformation.Attributes.SoftwareVersion] filename = f'device_dump_0x{vid:04X}_0x{pid:04X}_{software_version}.json' dump_device_composition_path = self.user_params.get("dump_device_composition_path", filename) - self.dump_wildcard(dump_device_composition_path) + json_str, txt_str = self.dump_wildcard(dump_device_composition_path) + + # Structured dump so we can pull these back out of the logs + def log_structured_data(start_tag: str, dump_string): + lines = dump_string.splitlines() + logging.info(f'{start_tag}BEGIN ({len(lines)} lines)====') + for line in lines: + logging.info(f'{start_tag}{line}') + logging.info(f'{start_tag}END ====') + + log_structured_data('==== json: ', json_str) + log_structured_data('==== txt: ', txt_str) if __name__ == "__main__": diff --git a/src/python_testing/basic_composition_support.py b/src/python_testing/basic_composition_support.py index 678c249d0abf5d..e25de55c0441a9 100644 --- a/src/python_testing/basic_composition_support.py +++ b/src/python_testing/basic_composition_support.py @@ -23,7 +23,7 @@ import pathlib import sys import typing -from pprint import pprint +from pprint import pformat, pprint from typing import Any, Optional import chip.clusters.ClusterObjects @@ -105,15 +105,20 @@ async def connect_over_pase(self, dev_ctrl): asserts.assert_equal(len(setupCode), 1, "Require one of either --qr-code or --manual-code.") await dev_ctrl.FindOrEstablishPASESession(setupCode[0], self.dut_node_id) - def dump_wildcard(self, dump_device_composition_path: typing.Optional[str]): + def dump_wildcard(self, dump_device_composition_path: typing.Optional[str]) -> tuple[str, str]: + """ Dumps a json and a txt file of the attribute wildcard for this device if the dump_device_composition_path is supplied. + Returns the json and txt as strings. + """ node_dump_dict = {endpoint_id: MatterTlvToJson(self.endpoints_tlv[endpoint_id]) for endpoint_id in self.endpoints_tlv} - logging.debug(f"Raw TLV contents of Node: {json.dumps(node_dump_dict, indent=2)}") + json_dump_string = json.dumps(node_dump_dict, indent=2) + logging.debug(f"Raw TLV contents of Node: {json_dump_string}") if dump_device_composition_path is not None: with open(pathlib.Path(dump_device_composition_path).with_suffix(".json"), "wt+") as outfile: json.dump(node_dump_dict, outfile, indent=2) with open(pathlib.Path(dump_device_composition_path).with_suffix(".txt"), "wt+") as outfile: pprint(self.endpoints, outfile, indent=1, width=200, compact=True) + return (json_dump_string, pformat(self.endpoints, indent=1, width=200, compact=True)) async def setup_class_helper(self, default_to_pase: bool = True): dev_ctrl = self.default_controller From c84593f2de5e4c90ac6e256b2424dc3e14dd7a1e Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Tue, 20 Aug 2024 19:57:05 -0400 Subject: [PATCH 24/52] Address post merge comment (#35103) * Address post merge comment * Quick fix --- .../src/BridgedAdministratorCommissioning.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedAdministratorCommissioning.cpp b/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedAdministratorCommissioning.cpp index c7bca223d92382..a0d87cbb3b81ef 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedAdministratorCommissioning.cpp +++ b/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedAdministratorCommissioning.cpp @@ -28,9 +28,9 @@ using namespace chip::app::Clusters::AdministratorCommissioning; CHIP_ERROR BridgedAdministratorCommissioning::Init() { - // We expect initialization after all embr plugin clusters initialization. This allows us to unregister - // the existing AccessAttributeInterface for AdministratorCommissioning and register ourselves, ensuring - // we get the callback for reading attribute. If the read is not intended for a bridged device we will + // We expect initialization after emberAfInit(). This allows us to unregister the existing + // AccessAttributeInterface for AdministratorCommissioning and register ourselves, ensuring we + // get the callback for reading attribute. If the read is not intended for a bridged device we will // forward it to the original attribute interface that we are unregistering. mOriginalAttributeInterface = AttributeAccessInterfaceRegistry::Instance().Get(kRootEndpointId, AdministratorCommissioning::Id); VerifyOrReturnError(mOriginalAttributeInterface, CHIP_ERROR_INTERNAL); From 17cb1d9a557dba1d7434630bfc1a9a5c87c825da Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 20 Aug 2024 21:03:34 -0400 Subject: [PATCH 25/52] Update default file header for Matter.framework files. (#35106) Removes blank line at the top, makes copyright year be saner. --- .../Darwin.xcworkspace/xcshareddata/IDETemplateMacros.plist | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/darwin/Darwin.xcworkspace/xcshareddata/IDETemplateMacros.plist b/src/darwin/Darwin.xcworkspace/xcshareddata/IDETemplateMacros.plist index 861a74eaf635b0..03de09ad225a13 100644 --- a/src/darwin/Darwin.xcworkspace/xcshareddata/IDETemplateMacros.plist +++ b/src/darwin/Darwin.xcworkspace/xcshareddata/IDETemplateMacros.plist @@ -3,9 +3,8 @@ FILEHEADER - -/** - * Copyright (c) 2023 Project CHIP Authors + /** + * Copyright (c) 2024 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From ec029c1e37d3d8d0133a4f08d3cbbfd60dfb7a8a Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 20 Aug 2024 21:05:40 -0400 Subject: [PATCH 26/52] Add availability annotations to new XPC protocols. (#35107) --- .../Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h | 7 +++++-- .../Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h | 8 ++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h index a571ebc07a9257..3e276eb25f760d 100644 --- a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h +++ b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCClientProtocol.h @@ -1,6 +1,5 @@ -// /** - * Copyright (c) 2023 Project CHIP Authors + * Copyright (c) 2024 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +14,12 @@ * limitations under the License. */ +#import #import // for MTRDeviceState NS_ASSUME_NONNULL_BEGIN +MTR_NEWLY_AVAILABLE @protocol MTRXPCClientProtocol_MTRDevice - (oneway void)device:(NSNumber *)nodeID stateChanged:(MTRDeviceState)state; - (oneway void)device:(NSNumber *)nodeID receivedAttributeReport:(NSArray *> *)attributeReport; @@ -28,6 +29,7 @@ NS_ASSUME_NONNULL_BEGIN - (oneway void)deviceConfigurationChanged:(NSNumber *)nodeID; @end +MTR_NEWLY_AVAILABLE @protocol MTRXPCClientProtocol_MTRDeviceController // Not Supported via XPC //- (oneway void)controller:(NSUUID *)controller statusUpdate:(MTRCommissioningStatus)status; @@ -36,6 +38,7 @@ NS_ASSUME_NONNULL_BEGIN //- (oneway void)controller:(NSUUID *)controller readCommissioningInfo:(MTRProductIdentity *)info; @end +MTR_NEWLY_AVAILABLE @protocol MTRXPCClientProtocol @end diff --git a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h index 5d619453b5fd93..1eebb0396570ac 100644 --- a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h +++ b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h @@ -1,6 +1,5 @@ -// /** - * Copyright (c) 2023 Project CHIP Authors + * Copyright (c) 2024 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +14,11 @@ * limitations under the License. */ +#import + NS_ASSUME_NONNULL_BEGIN +MTR_NEWLY_AVAILABLE @protocol MTRXPCServerProtocol_MTRDevice - (oneway void)deviceController:(NSUUID *)controller nodeID:(NSNumber *)nodeID getStateWithReply:(void (^)(MTRDeviceState state))reply; @@ -45,6 +47,7 @@ NS_ASSUME_NONNULL_BEGIN // - (oneway void)downloadLogOfType:(MTRDiagnosticLogType)type nodeID:(NSNumber *)nodeID timeout:(NSTimeInterval)timeout completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion; @end +MTR_NEWLY_AVAILABLE @protocol MTRXPCServerProtocol_MTRDeviceController - (oneway void)deviceController:(NSUUID *)controller getIsRunningWithReply:(void (^)(BOOL response))reply; @@ -69,6 +72,7 @@ NS_ASSUME_NONNULL_BEGIN @end +MTR_NEWLY_AVAILABLE @protocol MTRXPCServerProtocol - (oneway void)deviceController:(NSUUID *)controller checkInWithContext:(NSDictionary *)context; @end From 927c81857ae9288ffab4ffbd529979412f8cc5f1 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Tue, 20 Aug 2024 21:31:40 -0400 Subject: [PATCH 27/52] TC-IDM-10.2: Add check for MACL (#35086) * TC-IDM-10.2: Add check for MACL Test: unit tests. Note this has not been tested against the example app as it is still under development. * Update src/python_testing/TC_DeviceConformance.py Co-authored-by: Tennessee Carmel-Veilleux * Update src/python_testing/TestConformanceTest.py --------- Co-authored-by: Tennessee Carmel-Veilleux --- .github/workflows/tests.yaml | 1 + src/python_testing/TC_DeviceConformance.py | 23 ++++ src/python_testing/TestConformanceTest.py | 131 +++++++++++++++++++++ src/python_testing/execute_python_tests.py | 1 + 4 files changed, 156 insertions(+) create mode 100644 src/python_testing/TestConformanceTest.py diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index dbbda0aa36580f..d60ffb185de022 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -514,6 +514,7 @@ jobs: scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestIdChecks.py' scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingDeviceType.py' scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceSupport.py' + scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceTest.py' scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestChoiceConformanceSupport.py' scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_IDM_10_4.py' scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_TC_SC_7_1.py' diff --git a/src/python_testing/TC_DeviceConformance.py b/src/python_testing/TC_DeviceConformance.py index 3cc57e2b018ab6..611d7f54a82b62 100644 --- a/src/python_testing/TC_DeviceConformance.py +++ b/src/python_testing/TC_DeviceConformance.py @@ -50,6 +50,22 @@ async def setup_class_helper(self): self.xml_device_types, problems = build_xml_device_types() self.problems.extend(problems) + def _get_device_type_id(self, device_type_name: str) -> int: + id = [id for id, dt in self.xml_device_types.items() if dt.name.lower() == device_type_name.lower()] + if len(id) != 1: + self.fail_current_test(f"Unable to find {device_type_name} device type") + return id[0] + + def _has_nim(self): + nim_id = self._get_device_type_id('network infrastructure manager') + for endpoint in self.endpoints_tlv.values(): + desc = Clusters.Descriptor + device_types = [dt.deviceType for dt in endpoint[desc.id][desc.Attributes.DeviceTypeList.attribute_id]] + if nim_id in device_types: + # TODO: it's unclear if this needs to be present on every endpoint. Right now, this assumes one is sufficient. + return True + return False + def check_conformance(self, ignore_in_progress: bool, is_ci: bool): problems = [] success = True @@ -125,6 +141,13 @@ def record_warning(location, problem): for f in feature_masks: location = AttributePathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, attribute_id=GlobalAttributeIds.FEATURE_MAP_ID) + if cluster_id == Clusters.AccessControl.id and f == Clusters.AccessControl.Bitmaps.Feature.kManagedDevice: + # Managed ACL is treated as a special case because it is only allowed if other endpoints support NIM and disallowed otherwise. + if not self._has_nim(): + record_error( + location=location, problem="MACL feature is disallowed if the Network Infrastructure Manager device type is not present") + continue + if f not in self.xml_clusters[cluster_id].features.keys(): record_error(location=location, problem=f'Unknown feature with mask 0x{f:02x}') continue diff --git a/src/python_testing/TestConformanceTest.py b/src/python_testing/TestConformanceTest.py new file mode 100644 index 00000000000000..a656e228bf716f --- /dev/null +++ b/src/python_testing/TestConformanceTest.py @@ -0,0 +1,131 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from typing import Any + +import chip.clusters as Clusters +from conformance_support import ConformanceDecision +from global_attribute_ids import GlobalAttributeIds +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from mobly import asserts +from spec_parsing_support import build_xml_clusters, build_xml_device_types +from TC_DeviceConformance import DeviceConformanceTests + + +def is_mandatory(conformance): + return conformance(0, [], []).decision == ConformanceDecision.MANDATORY + + +class TestConformanceSupport(MatterBaseTest, DeviceConformanceTests): + def setup_class(self): + self.xml_clusters, self.problems = build_xml_clusters() + self.xml_device_types, problems = build_xml_device_types() + self.problems.extend(problems) + + def _create_minimal_cluster(self, cluster_id: int) -> dict[int, Any]: + attrs = {} + attrs[GlobalAttributeIds.FEATURE_MAP_ID] = 0 + + mandatory_attributes = [id for id, a in self.xml_clusters[cluster_id].attributes.items() if is_mandatory(a.conformance)] + for m in mandatory_attributes: + # dummy versions - we're not using the values in this test + attrs[m] = 0 + attrs[GlobalAttributeIds.ATTRIBUTE_LIST_ID] = mandatory_attributes + mandatory_accepted_commands = [id for id, a in self.xml_clusters[cluster_id].accepted_commands.items() + if is_mandatory(a.conformance)] + attrs[GlobalAttributeIds.ACCEPTED_COMMAND_LIST_ID] = mandatory_accepted_commands + mandatory_generated_commands = [id for id, a in self.xml_clusters[cluster_id].generated_commands.items() + if is_mandatory(a.conformance)] + attrs[GlobalAttributeIds.GENERATED_COMMAND_LIST_ID] = mandatory_generated_commands + attrs[GlobalAttributeIds.CLUSTER_REVISION_ID] = self.xml_clusters[cluster_id].revision + return attrs + + def _create_minimal_dt(self, device_type_id: int) -> dict[int, dict[int, Any]]: + ''' Creates the internals of an endpoint_tlv with the minimal set of clusters, with the minimal set of attributes and commands. Global attributes only. + Does NOT take into account overrides yet. + ''' + endpoint_tlv = {} + required_servers = [id for id, c in self.xml_device_types[device_type_id].server_clusters.items() + if is_mandatory(c.conformance)] + required_clients = [id for id, c in self.xml_device_types[device_type_id].client_clusters.items() + if is_mandatory(c.conformance)] + device_type_revision = self.xml_device_types[device_type_id].revision + + for s in required_servers: + endpoint_tlv[s] = self._create_minimal_cluster(s) + + # Descriptor + attr = Clusters.Descriptor.Attributes + attrs = {} + attrs[attr.FeatureMap.attribute_id] = 0 + attrs[attr.AcceptedCommandList.attribute_id] = [] + attrs[attr.GeneratedCommandList.attribute_id] = [] + attrs[attr.ClusterRevision.attribute_id] = self.xml_clusters[Clusters.Descriptor.id].revision + attrs[attr.DeviceTypeList.attribute_id] = [ + Clusters.Descriptor.Structs.DeviceTypeStruct(deviceType=device_type_id, revision=device_type_revision)] + attrs[attr.ServerList.attribute_id] = required_servers + attrs[attr.ClientList.attribute_id] = required_clients + attrs[attr.PartsList.attribute_id] = [] + attrs[attr.AttributeList.attribute_id] = [] + attrs[attr.AttributeList.attribute_id] = list(attrs.keys()) + + endpoint_tlv[Clusters.Descriptor.id] = attrs + return endpoint_tlv + + def add_macl(self, root_endpoint: dict[int, dict[int, Any]]): + ac = Clusters.AccessControl + root_endpoint[ac.id][ac.Attributes.FeatureMap.attribute_id] = ac.Bitmaps.Feature.kManagedDevice + root_endpoint[ac.id][ac.Attributes.Arl.attribute_id] = [] + root_endpoint[ac.id][ac.Attributes.CommissioningARL.attribute_id] = [] + root_endpoint[ac.id][ac.Attributes.AttributeList.attribute_id].extend([ + ac.Attributes.Arl.attribute_id, ac.Attributes.CommissioningARL.attribute_id]) + root_endpoint[ac.id][ac.Attributes.AcceptedCommandList.attribute_id].append(ac.Commands.ReviewFabricRestrictions.command_id) + root_endpoint[ac.id][ac.Attributes.GeneratedCommandList.attribute_id].append( + ac.Commands.ReviewFabricRestrictionsResponse.command_id) + + @async_test_body + async def test_macl_handling(self): + nim_id = self._get_device_type_id('network infrastructure manager') + root_node_id = self._get_device_type_id('root node') + on_off_id = self._get_device_type_id('On/Off Light') + + root = self._create_minimal_dt(device_type_id=root_node_id) + nim = self._create_minimal_dt(device_type_id=nim_id) + self.endpoints_tlv = {0: root, 1: nim} + asserts.assert_true(self._has_nim(), "Did not find NIM in generated device") + + success, problems = self.check_conformance(ignore_in_progress=False, is_ci=False) + self.problems.extend(problems) + asserts.assert_true(success, "Unexpected failure parsing minimal dt") + + self.add_macl(root) + # A MACL is allowed when there is a NIM, so this should succeed as well + success, problems = self.check_conformance(ignore_in_progress=False, is_ci=False) + self.problems.extend(problems) + asserts.assert_true(success, "Unexpected failure with NIM and MACL") + + # A MACL is not allowed when there is no NIM + self.endpoints_tlv[1] = self._create_minimal_dt(device_type_id=on_off_id) + success, problems = self.check_conformance(ignore_in_progress=False, is_ci=False) + self.problems.extend(problems) + asserts.assert_false(success, "Unexpected success with On/Off and MACL") + + # TODO: what happens if there is a NIM and a non-NIM endpoint? + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/execute_python_tests.py b/src/python_testing/execute_python_tests.py index ad3fc83c910bf8..86d88e5aa1c7a5 100644 --- a/src/python_testing/execute_python_tests.py +++ b/src/python_testing/execute_python_tests.py @@ -87,6 +87,7 @@ def main(search_directory, env_file): "TestChoiceConformanceSupport.py", "TC_DEMTestBase.py", "choice_conformance_support.py", + "TestConformanceTest.py", # Unit test of the conformance test (TC_DeviceConformance) - does not run against an app. "TestIdChecks.py", "TestSpecParsingDeviceType.py", "TestMatterTestingSupport.py", From ff6863ed127fb1a8a6f134ed15b2ed98ed75e418 Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Tue, 20 Aug 2024 20:57:05 -0700 Subject: [PATCH 28/52] [Darwin] New XPC bits need to initialize properly (#35110) --- src/darwin/Framework/CHIP/MTRDevice.mm | 2 ++ src/darwin/Framework/CHIP/MTRDeviceController.mm | 3 --- src/darwin/Framework/CHIP/MTRDeviceController_Internal.h | 4 ++++ src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index ff4a76147d855f..4fc30b90b3e433 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -491,6 +491,8 @@ - (instancetype)initForSubclassesWithNodeID:(NSNumber *)nodeID controller:(MTRDe if (self = [super init]) { _lock = OS_UNFAIR_LOCK_INIT; _delegates = [NSMutableSet set]; + _deviceController = controller; + _nodeID = nodeID; } return self; diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 322593312ccea4..11fd481b48b2fc 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -109,9 +109,6 @@ using namespace chip::Tracing::DarwinFramework; @implementation MTRDeviceController { - // queue used to serialize all work performed by the MTRDeviceController - dispatch_queue_t _chipWorkQueue; - chip::Controller::DeviceCommissioner * _cppCommissioner; chip::Credentials::PartialDACVerifier * _partialDACVerifier; chip::Credentials::DefaultDACVerifier * _defaultDACVerifier; diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index 85d2c2e069ee2c..54d5cfd8d340fa 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -68,6 +68,10 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, readwrite, nullable) NSMapTable * nodeIDToDeviceMap; @property (readonly, assign) os_unfair_lock_t deviceMapLock; +// queue used to serialize all work performed by the MTRDeviceController +// (moved here so subclasses can initialize differently) +@property (readwrite, retain) dispatch_queue_t chipWorkQueue; + - (instancetype)initForSubclasses; #pragma mark - MTRDeviceControllerFactory methods diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index 49fd7c32f9f61f..31acadcce576d3 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -79,6 +79,8 @@ - (id)initWithUniqueIdentifier:(NSUUID *)UUID xpConnectionBlock:(NSXPCConnection self.xpcConnection = connectionBlock(); self.uniqueIdentifier = UUID; + self.chipWorkQueue = dispatch_queue_create("MTRDeviceController_XPC_queue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + self.nodeIDToDeviceMap = [NSMapTable strongToWeakObjectsMapTable]; MTR_LOG("Set up XPC Connection: %@", self.xpcConnection); if (self.xpcConnection) { From 8b97b28e184bcb17d3376aae3b03fabb3dd5371d Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Wed, 21 Aug 2024 20:05:27 +1200 Subject: [PATCH 29/52] Revert "Enabling this for macOS Catalyst apps (#34956)" (#35117) This reverts commit 1d2ddd4131f3b6a10092d93a74ea58f0fe09510b. --- src/darwin/Framework/Matter.xcodeproj/project.pbxproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index efafd27d28dc1e..7d0ab045b6a25a 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -2373,7 +2373,6 @@ INSTALLHDRS_SCRIPT_PHASE = YES; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 14.0; - IS_ZIPPERED = YES; LIBRARY_SEARCH_PATHS = "$(TEMP_DIR)/out/lib"; OTHER_CFLAGS = "-fmacro-prefix-map=$(SRCROOT)/CHIP/="; OTHER_CPLUSPLUSFLAGS = ( @@ -2544,7 +2543,6 @@ INSTALLHDRS_SCRIPT_PHASE = YES; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 14.0; - IS_ZIPPERED = YES; LIBRARY_SEARCH_PATHS = "$(TEMP_DIR)/out/lib"; OTHER_CFLAGS = "-fmacro-prefix-map=$(SRCROOT)/CHIP/="; OTHER_CPLUSPLUSFLAGS = ( From b88eafac8bb91f6f1e3df887585a9c179591e5bf Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Wed, 21 Aug 2024 06:32:50 -0700 Subject: [PATCH 30/52] [Fabric-Sync] Update the FS setup guide to wait for reverse commissioning complete (#35115) * [Fabric-Sync] Update the FS setup guide to wait for reverse commissing * Restyled by prettier-markdown --------- Co-authored-by: Restyled.io --- docs/guides/fabric_synchronization_guide.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/guides/fabric_synchronization_guide.md b/docs/guides/fabric_synchronization_guide.md index 50fa3202f8ba84..22d616211fbd01 100644 --- a/docs/guides/fabric_synchronization_guide.md +++ b/docs/guides/fabric_synchronization_guide.md @@ -110,6 +110,14 @@ Pair the Ecosystem 2 bridge to Ecosystem 1 with node ID 2: fabricsync add-bridge 2 ``` +This command will initiate the reverse commissioning process. After a few +seconds, you should see the following message, indicating that the local bridge +of Ecosystem 1 has successfully paired with Ecosystem 2 on Endpoint 2: + +``` +>>> A new device is added on Endpoint 2. +``` + ### Pair Light Example to Ecosystem 2 Since Fabric-Bridge also functions as a Matter server, running it alongside the From 9e057a3af5e331902c3e6317b723ae0a3447c49e Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Wed, 21 Aug 2024 08:02:39 -0700 Subject: [PATCH 31/52] [Fabric-Sync] Add VID/PID fields to IPC method CommissionNode (#35116) * Add VID/PID field to IPC methode CommissionNode * Use QRCodeSetupPayloadGenerator to generate pairing code --- .../pigweed/protos/fabric_admin_service.proto | 4 +++- .../fabric-admin/device_manager/DeviceManager.h | 4 ++-- examples/fabric-admin/rpc/RpcServer.cpp | 14 ++++++++------ .../linux/CommissionerControl.cpp | 3 ++- examples/fabric-bridge-app/linux/RpcClient.cpp | 4 +++- .../fabric-bridge-app/linux/include/RpcClient.h | 16 ++++++++++++---- 6 files changed, 30 insertions(+), 15 deletions(-) diff --git a/examples/common/pigweed/protos/fabric_admin_service.proto b/examples/common/pigweed/protos/fabric_admin_service.proto index 3c311493d1c6f3..3df3e2a7aa5f5f 100644 --- a/examples/common/pigweed/protos/fabric_admin_service.proto +++ b/examples/common/pigweed/protos/fabric_admin_service.proto @@ -19,7 +19,9 @@ message DeviceCommissioningInfo { uint32 discriminator = 1; uint32 iterations = 2; uint32 setup_pin = 3; - bytes salt = 4; + uint32 vendor_id = 4; + uint32 product_id = 5; + bytes salt = 6; } message KeepActiveParameters { diff --git a/examples/fabric-admin/device_manager/DeviceManager.h b/examples/fabric-admin/device_manager/DeviceManager.h index d3b47c4b332276..1fb2ad52249938 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.h +++ b/examples/fabric-admin/device_manager/DeviceManager.h @@ -156,11 +156,11 @@ class DeviceManager : public PairingDelegate void HandleCommandResponse(const chip::app::ConcreteCommandPath & path, chip::TLV::TLVReader & data); - void OnDeviceRemoved(chip::NodeId deviceId, CHIP_ERROR err) override; - private: friend DeviceManager & DeviceMgr(); + void OnDeviceRemoved(chip::NodeId deviceId, CHIP_ERROR err) override; + void RequestCommissioningApproval(); void HandleReadSupportedDeviceCategories(chip::TLV::TLVReader & data); diff --git a/examples/fabric-admin/rpc/RpcServer.cpp b/examples/fabric-admin/rpc/RpcServer.cpp index f240feda22a2d4..d56399514ad96f 100644 --- a/examples/fabric-admin/rpc/RpcServer.cpp +++ b/examples/fabric-admin/rpc/RpcServer.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #if defined(PW_RPC_FABRIC_ADMIN_SERVICE) && PW_RPC_FABRIC_ADMIN_SERVICE @@ -103,16 +103,18 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate setupPayload.setUpPINCode = request.setup_pin; setupPayload.version = 0; + setupPayload.vendorID = request.vendor_id; + setupPayload.productID = request.product_id; setupPayload.rendezvousInformation.SetValue(RendezvousInformationFlag::kOnNetwork); SetupDiscriminator discriminator{}; discriminator.SetLongValue(request.discriminator); setupPayload.discriminator = discriminator; - char payloadBuffer[kMaxManualCodeLength + 1]; - MutableCharSpan manualCode(payloadBuffer); + QRCodeSetupPayloadGenerator generator(setupPayload); + std::string code; + CHIP_ERROR error = generator.payloadBase38RepresentationWithAutoTLVBuffer(code); - CHIP_ERROR error = ManualSetupPayloadGenerator(setupPayload).payloadDecimalStringRepresentation(manualCode); if (error == CHIP_NO_ERROR) { NodeId nodeId = DeviceMgr().GetNextAvailableNodeId(); @@ -121,11 +123,11 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate // RequestCommissioningApproval, you need to wait for it to open a commissioning window on its bridge. usleep(kCommissionPrepareTimeMs * 1000); - DeviceMgr().PairRemoteDevice(nodeId, payloadBuffer); + DeviceMgr().PairRemoteDevice(nodeId, code.c_str()); } else { - ChipLogError(NotSpecified, "Unable to generate manual code for setup payload: %" CHIP_ERROR_FORMAT, error.Format()); + ChipLogError(NotSpecified, "Unable to generate pairing code for setup payload: %" CHIP_ERROR_FORMAT, error.Format()); } return pw::OkStatus(); diff --git a/examples/fabric-bridge-app/linux/CommissionerControl.cpp b/examples/fabric-bridge-app/linux/CommissionerControl.cpp index 9f3180668de42c..3613aeec9305e4 100644 --- a/examples/fabric-bridge-app/linux/CommissionerControl.cpp +++ b/examples/fabric-bridge-app/linux/CommissionerControl.cpp @@ -137,7 +137,8 @@ CHIP_ERROR CommissionerControlDelegate::HandleCommissionNode(const Commissioning .SetTimeout(params.commissioningTimeout) .SetDiscriminator(params.discriminator) .SetIteration(params.iterations) - .SetSalt(params.salt)); + .SetSalt(params.salt), + mVendorId, mProductId); #else ChipLogProgress(NotSpecified, "Failed to reverse commission bridge: PW_RPC_FABRIC_BRIDGE_SERVICE not defined"); return CHIP_ERROR_NOT_IMPLEMENTED; diff --git a/examples/fabric-bridge-app/linux/RpcClient.cpp b/examples/fabric-bridge-app/linux/RpcClient.cpp index b3c82303beb8f5..817479d8482af1 100644 --- a/examples/fabric-bridge-app/linux/RpcClient.cpp +++ b/examples/fabric-bridge-app/linux/RpcClient.cpp @@ -163,12 +163,14 @@ OpenCommissioningWindow(chip::Controller::CommissioningWindowVerifierParams para } CHIP_ERROR -CommissionNode(chip::Controller::CommissioningWindowPasscodeParams params) +CommissionNode(chip::Controller::CommissioningWindowPasscodeParams params, VendorId vendorId, uint16_t productId) { chip_rpc_DeviceCommissioningInfo device; device.setup_pin = params.GetSetupPIN(); device.discriminator = params.GetDiscriminator(); device.iterations = params.GetIteration(); + device.vendor_id = vendorId; + device.product_id = productId; VerifyOrReturnError(params.GetSalt().size() <= sizeof(device.salt.bytes), CHIP_ERROR_BUFFER_TOO_SMALL); memcpy(device.salt.bytes, params.GetSalt().data(), params.GetSalt().size()); diff --git a/examples/fabric-bridge-app/linux/include/RpcClient.h b/examples/fabric-bridge-app/linux/include/RpcClient.h index 87ccba24f645dc..c7628a8c3ba73c 100644 --- a/examples/fabric-bridge-app/linux/include/RpcClient.h +++ b/examples/fabric-bridge-app/linux/include/RpcClient.h @@ -60,12 +60,20 @@ OpenCommissioningWindow(chip::Controller::CommissioningWindowVerifierParams para /** * Commission a node using the specified parameters. * - * @param params Params for commissioning the device using passcode. + * This function initiates the commissioning process for a node, utilizing + * the provided passcode parameters, vendor ID, and product ID. + * + * @param params Parameters required for commissioning the device using passcode. + * @param vendorId The Vendor ID (VID) of the device being commissioned. This identifies + * the manufacturer of the device. + * @param productId The Product ID (PID) of the device being commissioned. This identifies + * the specific product within the vendor's lineup. + * * @return CHIP_ERROR An error code indicating the success or failure of the operation. - * - CHIP_NO_ERROR: The RPC command was successfully sent. - * - CHIP_ERROR_INTERNAL: An internal error occurred. + * - CHIP_NO_ERROR: The RPC command was successfully sent and the commissioning process was initiated. + * - CHIP_ERROR_INTERNAL: An internal error occurred during the preparation or sending of the command. */ CHIP_ERROR -CommissionNode(chip::Controller::CommissioningWindowPasscodeParams params); +CommissionNode(chip::Controller::CommissioningWindowPasscodeParams params, chip::VendorId vendorId, uint16_t productId); CHIP_ERROR KeepActive(chip::NodeId nodeId, uint32_t stayActiveDurationMs); From 796394ffadb6d0322a16eb5eabfb28950c8e6116 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Wed, 21 Aug 2024 13:01:59 -0400 Subject: [PATCH 32/52] Revert "TC-IDM-10.2: Add check for MACL (#35086)" (#35111) This reverts commit 927c81857ae9288ffab4ffbd529979412f8cc5f1. --- .github/workflows/tests.yaml | 1 - src/python_testing/TC_DeviceConformance.py | 23 ---- src/python_testing/TestConformanceTest.py | 131 --------------------- src/python_testing/execute_python_tests.py | 1 - 4 files changed, 156 deletions(-) delete mode 100644 src/python_testing/TestConformanceTest.py diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d60ffb185de022..dbbda0aa36580f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -514,7 +514,6 @@ jobs: scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestIdChecks.py' scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingDeviceType.py' scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceSupport.py' - scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceTest.py' scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestChoiceConformanceSupport.py' scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_IDM_10_4.py' scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_TC_SC_7_1.py' diff --git a/src/python_testing/TC_DeviceConformance.py b/src/python_testing/TC_DeviceConformance.py index 611d7f54a82b62..3cc57e2b018ab6 100644 --- a/src/python_testing/TC_DeviceConformance.py +++ b/src/python_testing/TC_DeviceConformance.py @@ -50,22 +50,6 @@ async def setup_class_helper(self): self.xml_device_types, problems = build_xml_device_types() self.problems.extend(problems) - def _get_device_type_id(self, device_type_name: str) -> int: - id = [id for id, dt in self.xml_device_types.items() if dt.name.lower() == device_type_name.lower()] - if len(id) != 1: - self.fail_current_test(f"Unable to find {device_type_name} device type") - return id[0] - - def _has_nim(self): - nim_id = self._get_device_type_id('network infrastructure manager') - for endpoint in self.endpoints_tlv.values(): - desc = Clusters.Descriptor - device_types = [dt.deviceType for dt in endpoint[desc.id][desc.Attributes.DeviceTypeList.attribute_id]] - if nim_id in device_types: - # TODO: it's unclear if this needs to be present on every endpoint. Right now, this assumes one is sufficient. - return True - return False - def check_conformance(self, ignore_in_progress: bool, is_ci: bool): problems = [] success = True @@ -141,13 +125,6 @@ def record_warning(location, problem): for f in feature_masks: location = AttributePathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, attribute_id=GlobalAttributeIds.FEATURE_MAP_ID) - if cluster_id == Clusters.AccessControl.id and f == Clusters.AccessControl.Bitmaps.Feature.kManagedDevice: - # Managed ACL is treated as a special case because it is only allowed if other endpoints support NIM and disallowed otherwise. - if not self._has_nim(): - record_error( - location=location, problem="MACL feature is disallowed if the Network Infrastructure Manager device type is not present") - continue - if f not in self.xml_clusters[cluster_id].features.keys(): record_error(location=location, problem=f'Unknown feature with mask 0x{f:02x}') continue diff --git a/src/python_testing/TestConformanceTest.py b/src/python_testing/TestConformanceTest.py deleted file mode 100644 index a656e228bf716f..00000000000000 --- a/src/python_testing/TestConformanceTest.py +++ /dev/null @@ -1,131 +0,0 @@ -# -# Copyright (c) 2024 Project CHIP Authors -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -from typing import Any - -import chip.clusters as Clusters -from conformance_support import ConformanceDecision -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main -from mobly import asserts -from spec_parsing_support import build_xml_clusters, build_xml_device_types -from TC_DeviceConformance import DeviceConformanceTests - - -def is_mandatory(conformance): - return conformance(0, [], []).decision == ConformanceDecision.MANDATORY - - -class TestConformanceSupport(MatterBaseTest, DeviceConformanceTests): - def setup_class(self): - self.xml_clusters, self.problems = build_xml_clusters() - self.xml_device_types, problems = build_xml_device_types() - self.problems.extend(problems) - - def _create_minimal_cluster(self, cluster_id: int) -> dict[int, Any]: - attrs = {} - attrs[GlobalAttributeIds.FEATURE_MAP_ID] = 0 - - mandatory_attributes = [id for id, a in self.xml_clusters[cluster_id].attributes.items() if is_mandatory(a.conformance)] - for m in mandatory_attributes: - # dummy versions - we're not using the values in this test - attrs[m] = 0 - attrs[GlobalAttributeIds.ATTRIBUTE_LIST_ID] = mandatory_attributes - mandatory_accepted_commands = [id for id, a in self.xml_clusters[cluster_id].accepted_commands.items() - if is_mandatory(a.conformance)] - attrs[GlobalAttributeIds.ACCEPTED_COMMAND_LIST_ID] = mandatory_accepted_commands - mandatory_generated_commands = [id for id, a in self.xml_clusters[cluster_id].generated_commands.items() - if is_mandatory(a.conformance)] - attrs[GlobalAttributeIds.GENERATED_COMMAND_LIST_ID] = mandatory_generated_commands - attrs[GlobalAttributeIds.CLUSTER_REVISION_ID] = self.xml_clusters[cluster_id].revision - return attrs - - def _create_minimal_dt(self, device_type_id: int) -> dict[int, dict[int, Any]]: - ''' Creates the internals of an endpoint_tlv with the minimal set of clusters, with the minimal set of attributes and commands. Global attributes only. - Does NOT take into account overrides yet. - ''' - endpoint_tlv = {} - required_servers = [id for id, c in self.xml_device_types[device_type_id].server_clusters.items() - if is_mandatory(c.conformance)] - required_clients = [id for id, c in self.xml_device_types[device_type_id].client_clusters.items() - if is_mandatory(c.conformance)] - device_type_revision = self.xml_device_types[device_type_id].revision - - for s in required_servers: - endpoint_tlv[s] = self._create_minimal_cluster(s) - - # Descriptor - attr = Clusters.Descriptor.Attributes - attrs = {} - attrs[attr.FeatureMap.attribute_id] = 0 - attrs[attr.AcceptedCommandList.attribute_id] = [] - attrs[attr.GeneratedCommandList.attribute_id] = [] - attrs[attr.ClusterRevision.attribute_id] = self.xml_clusters[Clusters.Descriptor.id].revision - attrs[attr.DeviceTypeList.attribute_id] = [ - Clusters.Descriptor.Structs.DeviceTypeStruct(deviceType=device_type_id, revision=device_type_revision)] - attrs[attr.ServerList.attribute_id] = required_servers - attrs[attr.ClientList.attribute_id] = required_clients - attrs[attr.PartsList.attribute_id] = [] - attrs[attr.AttributeList.attribute_id] = [] - attrs[attr.AttributeList.attribute_id] = list(attrs.keys()) - - endpoint_tlv[Clusters.Descriptor.id] = attrs - return endpoint_tlv - - def add_macl(self, root_endpoint: dict[int, dict[int, Any]]): - ac = Clusters.AccessControl - root_endpoint[ac.id][ac.Attributes.FeatureMap.attribute_id] = ac.Bitmaps.Feature.kManagedDevice - root_endpoint[ac.id][ac.Attributes.Arl.attribute_id] = [] - root_endpoint[ac.id][ac.Attributes.CommissioningARL.attribute_id] = [] - root_endpoint[ac.id][ac.Attributes.AttributeList.attribute_id].extend([ - ac.Attributes.Arl.attribute_id, ac.Attributes.CommissioningARL.attribute_id]) - root_endpoint[ac.id][ac.Attributes.AcceptedCommandList.attribute_id].append(ac.Commands.ReviewFabricRestrictions.command_id) - root_endpoint[ac.id][ac.Attributes.GeneratedCommandList.attribute_id].append( - ac.Commands.ReviewFabricRestrictionsResponse.command_id) - - @async_test_body - async def test_macl_handling(self): - nim_id = self._get_device_type_id('network infrastructure manager') - root_node_id = self._get_device_type_id('root node') - on_off_id = self._get_device_type_id('On/Off Light') - - root = self._create_minimal_dt(device_type_id=root_node_id) - nim = self._create_minimal_dt(device_type_id=nim_id) - self.endpoints_tlv = {0: root, 1: nim} - asserts.assert_true(self._has_nim(), "Did not find NIM in generated device") - - success, problems = self.check_conformance(ignore_in_progress=False, is_ci=False) - self.problems.extend(problems) - asserts.assert_true(success, "Unexpected failure parsing minimal dt") - - self.add_macl(root) - # A MACL is allowed when there is a NIM, so this should succeed as well - success, problems = self.check_conformance(ignore_in_progress=False, is_ci=False) - self.problems.extend(problems) - asserts.assert_true(success, "Unexpected failure with NIM and MACL") - - # A MACL is not allowed when there is no NIM - self.endpoints_tlv[1] = self._create_minimal_dt(device_type_id=on_off_id) - success, problems = self.check_conformance(ignore_in_progress=False, is_ci=False) - self.problems.extend(problems) - asserts.assert_false(success, "Unexpected success with On/Off and MACL") - - # TODO: what happens if there is a NIM and a non-NIM endpoint? - - -if __name__ == "__main__": - default_matter_test_main() diff --git a/src/python_testing/execute_python_tests.py b/src/python_testing/execute_python_tests.py index 86d88e5aa1c7a5..ad3fc83c910bf8 100644 --- a/src/python_testing/execute_python_tests.py +++ b/src/python_testing/execute_python_tests.py @@ -87,7 +87,6 @@ def main(search_directory, env_file): "TestChoiceConformanceSupport.py", "TC_DEMTestBase.py", "choice_conformance_support.py", - "TestConformanceTest.py", # Unit test of the conformance test (TC_DeviceConformance) - does not run against an app. "TestIdChecks.py", "TestSpecParsingDeviceType.py", "TestMatterTestingSupport.py", From ddf8b8fbb76a02ef610b3c701b0528d70ba22e9e Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 21 Aug 2024 13:03:02 -0400 Subject: [PATCH 33/52] Fix UnregisterAllCommandHandlersForEndpoint to work correctly. (#35100) Fixes https://github.com/project-chip/connectedhomeip/issues/34953 --- src/app/CommandHandlerInterfaceRegistry.cpp | 7 +- src/app/tests/BUILD.gn | 1 + .../TestCommandHandlerInterfaceRegistry.cpp | 103 ++++++++++++++++++ 3 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 src/app/tests/TestCommandHandlerInterfaceRegistry.cpp diff --git a/src/app/CommandHandlerInterfaceRegistry.cpp b/src/app/CommandHandlerInterfaceRegistry.cpp index 01436853dd1a55..8345be5dcc2805 100644 --- a/src/app/CommandHandlerInterfaceRegistry.cpp +++ b/src/app/CommandHandlerInterfaceRegistry.cpp @@ -68,8 +68,11 @@ void CommandHandlerInterfaceRegistry::UnregisterAllCommandHandlersForEndpoint(En { CommandHandlerInterface * prev = nullptr; - for (auto * cur = mCommandHandlerList; cur; cur = cur->GetNext()) + for (auto * cur = mCommandHandlerList; cur;) { + // Fetch next node in the list before we remove this one. + auto * next = cur->GetNext(); + if (cur->MatchesEndpoint(endpointId)) { if (prev == nullptr) @@ -87,6 +90,8 @@ void CommandHandlerInterfaceRegistry::UnregisterAllCommandHandlersForEndpoint(En { prev = cur; } + + cur = next; } } diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index 1bce08d55e0571..104a57a2fc019a 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -194,6 +194,7 @@ chip_test_suite("tests") { "TestBasicCommandPathRegistry.cpp", "TestBindingTable.cpp", "TestBuilderParser.cpp", + "TestCommandHandlerInterfaceRegistry.cpp", "TestCommandInteraction.cpp", "TestCommandPathParams.cpp", "TestConcreteAttributePath.cpp", diff --git a/src/app/tests/TestCommandHandlerInterfaceRegistry.cpp b/src/app/tests/TestCommandHandlerInterfaceRegistry.cpp new file mode 100644 index 00000000000000..aed017362c83f5 --- /dev/null +++ b/src/app/tests/TestCommandHandlerInterfaceRegistry.cpp @@ -0,0 +1,103 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include + +#include + +namespace chip { +namespace app { + +namespace { + +class TestCommandHandlerInterface : public CommandHandlerInterface +{ +public: + TestCommandHandlerInterface(Optional endpointId, ClusterId clusterId) : + CommandHandlerInterface(endpointId, clusterId) + {} + + // Just need this to compile + void InvokeCommand(HandlerContext & handlerContext) override {} +}; + +} // anonymous namespace + +TEST(TestCommandHandlerInterfaceRegistry, TestRegisterUnregister) +{ + TestCommandHandlerInterface a(Optional(1), 1); + TestCommandHandlerInterface b(Optional(1), 2); + TestCommandHandlerInterface c(Optional(2), 1); + TestCommandHandlerInterface d(NullOptional, 3); + + CommandHandlerInterfaceRegistry registry; + EXPECT_EQ(registry.RegisterCommandHandler(&a), CHIP_NO_ERROR); + EXPECT_EQ(registry.RegisterCommandHandler(&b), CHIP_NO_ERROR); + EXPECT_EQ(registry.RegisterCommandHandler(&c), CHIP_NO_ERROR); + EXPECT_EQ(registry.RegisterCommandHandler(&d), CHIP_NO_ERROR); + + EXPECT_EQ(registry.GetCommandHandler(1, 1), &a); + EXPECT_EQ(registry.GetCommandHandler(1, 2), &b); + EXPECT_EQ(registry.GetCommandHandler(2, 1), &c); + EXPECT_EQ(registry.GetCommandHandler(1, 3), &d); + EXPECT_EQ(registry.GetCommandHandler(5, 3), &d); + + EXPECT_EQ(registry.UnregisterCommandHandler(&b), CHIP_NO_ERROR); + + EXPECT_EQ(registry.GetCommandHandler(1, 1), &a); + EXPECT_EQ(registry.GetCommandHandler(1, 2), nullptr); + EXPECT_EQ(registry.GetCommandHandler(2, 1), &c); + EXPECT_EQ(registry.GetCommandHandler(1, 3), &d); + EXPECT_EQ(registry.GetCommandHandler(5, 3), &d); + + EXPECT_EQ(registry.UnregisterCommandHandler(&b), CHIP_ERROR_KEY_NOT_FOUND); +} + +TEST(TestCommandHandlerInterfaceRegistry, TestUnregisterAll) +{ + TestCommandHandlerInterface a(Optional(1), 1); + TestCommandHandlerInterface b(Optional(1), 2); + TestCommandHandlerInterface c(Optional(2), 1); + TestCommandHandlerInterface d(NullOptional, 3); + + CommandHandlerInterfaceRegistry registry; + EXPECT_EQ(registry.RegisterCommandHandler(&a), CHIP_NO_ERROR); + EXPECT_EQ(registry.RegisterCommandHandler(&b), CHIP_NO_ERROR); + EXPECT_EQ(registry.RegisterCommandHandler(&c), CHIP_NO_ERROR); + EXPECT_EQ(registry.RegisterCommandHandler(&d), CHIP_NO_ERROR); + + EXPECT_EQ(registry.GetCommandHandler(1, 1), &a); + EXPECT_EQ(registry.GetCommandHandler(1, 2), &b); + EXPECT_EQ(registry.GetCommandHandler(2, 1), &c); + EXPECT_EQ(registry.GetCommandHandler(1, 3), &d); + EXPECT_EQ(registry.GetCommandHandler(5, 3), &d); + + registry.UnregisterAllCommandHandlersForEndpoint(1); + + EXPECT_EQ(registry.GetCommandHandler(1, 1), nullptr); + EXPECT_EQ(registry.GetCommandHandler(1, 2), nullptr); + EXPECT_EQ(registry.GetCommandHandler(2, 1), &c); + EXPECT_EQ(registry.GetCommandHandler(1, 3), &d); + EXPECT_EQ(registry.GetCommandHandler(5, 3), &d); +} + +} // namespace app +} // namespace chip From fd9dfe26964b5f77e08782ce7ed1ff8b259a69b8 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 21 Aug 2024 13:03:39 -0400 Subject: [PATCH 34/52] Add missing CFLAGS to instrument things for fuzzers. (#35082) -fno-sanitize-coverage=pc-table is added since we are already using inline-8bit-counters and trace-cmp to provide instrumentation for the fuzzers. It also helps reduce memory usage and improve fuzzer performance. --- build/config/compiler/BUILD.gn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index fee0d745f6d136..2e2ebe606f089f 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -415,6 +415,8 @@ declare_args() { config("sanitize_address") { defines = [] cflags = [ + "-fsanitize-coverage=inline-8bit-counters,trace-cmp", + "-fno-sanitize-coverage=pc-table", "-fsanitize=address", "-fno-omit-frame-pointer", ] From 150aad355231832c220b5d4e9da0ba00e81b0b8d Mon Sep 17 00:00:00 2001 From: Paul Regan <64710345+paulr34@users.noreply.github.com> Date: Wed, 21 Aug 2024 13:27:19 -0400 Subject: [PATCH 35/52] adding mandatory endpointComposition data to XML for ZAP to consume (#34818) * adding endpointComposition data to XML for ZAP to consume * explicitly adding constraint as defined by the spec and defining compositions types * fix composition type tag * changing back to prevent both types being true which is not allowed * explciitly setting conformance and contraint to account for all scenarios --- .../zap-templates/zcl/data-model/chip/matter-devices.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml index 14f4b9edf39958..ea18e985628071 100644 --- a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml +++ b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml @@ -2209,6 +2209,12 @@ limitations under the License. 0x0070 Simple Endpoint + + tree + + 0x0071 + + From 849634bdb00ad1083ff3e615f3eac1448a21a0bc Mon Sep 17 00:00:00 2001 From: Thirupathi S <108743108+Thirsrin@users.noreply.github.com> Date: Wed, 21 Aug 2024 23:27:17 +0530 Subject: [PATCH 36/52] Colorcontrol xml file sync with specs (#33612) * doorlock xml file sync with specs and colorcontrol xml type changes * build error resolved * Restyled by clang-format * build error resolved * addressed review comments * Restyled by clang-format * Addressed review comments * Restyled by clang-format * build error solved * build error solved * build error solved * build error solved * build issue resolved * Restyled by clang-format * resolved build errors * removed doorlock xml changes * Restyled by clang-format * resolved build errors * Restyled by clang-format * resolved build errors * addressed review comments * addressed review comments * resolved build errors * resolved build errors * zap generated changes * Restyled by clang-format * Revert colorloopdirection type change * build error resolved * Restyled by clang-format * rebased and zap generated * color control xml file updated * build error solved * ameba build error resolved * Restyled by clang-format * ameba build error resolved * doorlock changes removed * ameba build error resolved * ameba build error resolved * addressed review comments * addressed review comments * Restyled by clang-format * Addressed review comments * Addressed review comments * Restyled by clang-format * build error resolved * build error resolved * addressed reviews comments and build error resolved * Restyled by clang-format * ZAP issue resolved * scripts updated * scripts updated * added enum values in compatenum.h file * Restyled by whitespace * Restyled by clang-format * added enum values in compatenum.h file * Restyled by whitespace * Restyled by clang-format * added enum values in compatenum.h file * added header file for to_underlying * build error resolved * build error resolved --------- Co-authored-by: Restyled.io --- .../all-clusters-app.matter | 182 ++++---- .../ameba/main/include/ColorControlCommands.h | 204 ++++----- .../all-clusters-minimal-app.matter | 182 ++++---- ...de_colortemperaturelight_hbUnzYVeyn.matter | 182 ++++---- ...tnode_extendedcolorlight_8lcaaYJVAa.matter | 182 ++++---- examples/common/imgui_ui/windows/light.cpp | 14 +- examples/common/imgui_ui/windows/light.h | 3 +- .../light-switch-app.matter | 182 ++++---- .../light-switch-app/qpg/zap/switch.matter | 182 ++++---- .../data_model/lighting-app-ethernet.matter | 182 ++++---- .../data_model/lighting-app-thread.matter | 182 ++++---- .../data_model/lighting-app-wifi.matter | 182 ++++---- .../lighting-common/lighting-app.matter | 182 ++++---- examples/lighting-app/qpg/zap/light.matter | 182 ++++---- .../data_model/lighting-thread-app.matter | 182 ++++---- .../data_model/lighting-wifi-app.matter | 182 ++++---- .../lighting-app/tizen/src/DBusInterface.cpp | 6 +- examples/lighting-app/tizen/src/main.cpp | 2 +- .../placeholder/linux/apps/app1/config.matter | 364 ++++++++-------- .../placeholder/linux/apps/app2/config.matter | 364 ++++++++-------- .../virtual-device-app.matter | 182 ++++---- .../color-control-server.cpp | 301 ++++++------- .../color-control-server.h | 44 +- src/app/common/CompatEnumNames.h | 46 ++ .../data-model/chip/color-control-cluster.xml | 187 ++++---- .../data_model/controller-clusters.matter | 182 ++++---- .../CHIPAttributeTLVValueDecoder.cpp | 4 +- .../python/chip/clusters/Objects.py | 143 +++--- .../MTRAttributeTLVValueDecoder.mm | 10 +- .../CHIP/zap-generated/MTRBaseClusters.h | 106 ++--- .../CHIP/zap-generated/MTRBaseClusters.mm | 2 +- .../zap-generated/MTRCommandPayloadsObjc.mm | 76 ++-- src/python_testing/TC_CC_2_2.py | 8 +- .../zap-generated/attributes/Accessors.cpp | 70 +-- .../zap-generated/attributes/Accessors.h | 44 +- .../zap-generated/cluster-enums-check.h | 56 +-- .../app-common/zap-generated/cluster-enums.h | 102 +++-- .../zap-generated/cluster-objects.h | 410 +++++++++--------- .../zap-generated/cluster/Commands.h | 23 +- .../cluster/logging/DataModelLogger.cpp | 10 +- .../zap-generated/cluster/Commands.h | 76 ++-- 41 files changed, 2825 insertions(+), 2580 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 46debb8a6cd363..c18c6164c5c717 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -5847,65 +5847,62 @@ cluster ThermostatUserInterfaceConfiguration = 516 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -5916,16 +5913,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -5957,13 +5965,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -5977,150 +5985,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/examples/all-clusters-app/ameba/main/include/ColorControlCommands.h b/examples/all-clusters-app/ameba/main/include/ColorControlCommands.h index a80b5fe02d659d..73241be444dbcb 100644 --- a/examples/all-clusters-app/ameba/main/include/ColorControlCommands.h +++ b/examples/all-clusters-app/ameba/main/include/ColorControlCommands.h @@ -360,29 +360,29 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E { case Clusters::ColorControl::Commands::MoveToHue::Id: moveToHueCommand.hue = static_cast(data->args[0]); - moveToHueCommand.direction = static_cast(data->args[1]); + moveToHueCommand.direction = static_cast(data->args[1]); moveToHueCommand.transitionTime = static_cast(data->args[2]); - moveToHueCommand.optionsMask = static_cast(data->args[3]); - moveToHueCommand.optionsOverride = static_cast(data->args[4]); + moveToHueCommand.optionsMask = static_cast(data->args[3]); + moveToHueCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, moveToHueCommand, onSuccess, onFailure); break; case Clusters::ColorControl::Commands::MoveHue::Id: - moveHueCommand.moveMode = static_cast(data->args[0]); + moveHueCommand.moveMode = static_cast(data->args[0]); moveHueCommand.rate = static_cast(data->args[1]); - moveHueCommand.optionsMask = static_cast(data->args[2]); - moveHueCommand.optionsOverride = static_cast(data->args[3]); + moveHueCommand.optionsMask = static_cast(data->args[2]); + moveHueCommand.optionsOverride = static_cast(data->args[3]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, moveHueCommand, onSuccess, onFailure); break; case Clusters::ColorControl::Commands::StepHue::Id: - stepHueCommand.stepMode = static_cast(data->args[0]); + stepHueCommand.stepMode = static_cast(data->args[0]); stepHueCommand.stepSize = static_cast(data->args[1]); stepHueCommand.transitionTime = static_cast(data->args[2]); - stepHueCommand.optionsMask = static_cast(data->args[3]); - stepHueCommand.optionsOverride = static_cast(data->args[4]); + stepHueCommand.optionsMask = static_cast(data->args[3]); + stepHueCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, stepHueCommand, onSuccess, onFailure); break; @@ -390,27 +390,27 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E case Clusters::ColorControl::Commands::MoveToSaturation::Id: moveToSaturationCommand.saturation = static_cast(data->args[0]); moveToSaturationCommand.transitionTime = static_cast(data->args[1]); - moveToSaturationCommand.optionsMask = static_cast(data->args[2]); - moveToSaturationCommand.optionsOverride = static_cast(data->args[3]); + moveToSaturationCommand.optionsMask = static_cast(data->args[2]); + moveToSaturationCommand.optionsOverride = static_cast(data->args[3]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, moveToSaturationCommand, onSuccess, onFailure); break; case Clusters::ColorControl::Commands::MoveSaturation::Id: - moveSaturationCommand.moveMode = static_cast(data->args[0]); + moveSaturationCommand.moveMode = static_cast(data->args[0]); moveSaturationCommand.rate = static_cast(data->args[1]); - moveSaturationCommand.optionsMask = static_cast(data->args[2]); - moveSaturationCommand.optionsOverride = static_cast(data->args[3]); + moveSaturationCommand.optionsMask = static_cast(data->args[2]); + moveSaturationCommand.optionsOverride = static_cast(data->args[3]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, moveSaturationCommand, onSuccess, onFailure); break; case Clusters::ColorControl::Commands::StepSaturation::Id: - stepSaturationCommand.stepMode = static_cast(data->args[0]); + stepSaturationCommand.stepMode = static_cast(data->args[0]); stepSaturationCommand.stepSize = static_cast(data->args[1]); stepSaturationCommand.transitionTime = static_cast(data->args[2]); - stepSaturationCommand.optionsMask = static_cast(data->args[3]); - stepSaturationCommand.optionsOverride = static_cast(data->args[4]); + stepSaturationCommand.optionsMask = static_cast(data->args[3]); + stepSaturationCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, stepSaturationCommand, onSuccess, onFailure); break; @@ -419,8 +419,8 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E moveToHueAndSaturationCommand.hue = static_cast(data->args[0]); moveToHueAndSaturationCommand.saturation = static_cast(data->args[1]); moveToHueAndSaturationCommand.transitionTime = static_cast(data->args[2]); - moveToHueAndSaturationCommand.optionsMask = static_cast(data->args[3]); - moveToHueAndSaturationCommand.optionsOverride = static_cast(data->args[4]); + moveToHueAndSaturationCommand.optionsMask = static_cast(data->args[3]); + moveToHueAndSaturationCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, moveToHueAndSaturationCommand, onSuccess, onFailure); break; @@ -429,8 +429,8 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E moveToColorCommand.colorX = static_cast(data->args[0]); moveToColorCommand.colorY = static_cast(data->args[1]); moveToColorCommand.transitionTime = static_cast(data->args[2]); - moveToColorCommand.optionsMask = static_cast(data->args[3]); - moveToColorCommand.optionsOverride = static_cast(data->args[4]); + moveToColorCommand.optionsMask = static_cast(data->args[3]); + moveToColorCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, moveToColorCommand, onSuccess, onFailure); break; @@ -438,8 +438,8 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E case Clusters::ColorControl::Commands::MoveColor::Id: moveColorCommand.rateX = static_cast(data->args[0]); moveColorCommand.rateY = static_cast(data->args[1]); - moveColorCommand.optionsMask = static_cast(data->args[2]); - moveColorCommand.optionsOverride = static_cast(data->args[3]); + moveColorCommand.optionsMask = static_cast(data->args[2]); + moveColorCommand.optionsOverride = static_cast(data->args[3]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, moveColorCommand, onSuccess, onFailure); break; @@ -448,8 +448,8 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E stepColorCommand.stepX = static_cast(data->args[0]); stepColorCommand.stepY = static_cast(data->args[1]); stepColorCommand.transitionTime = static_cast(data->args[2]); - stepColorCommand.optionsMask = static_cast(data->args[3]); - stepColorCommand.optionsOverride = static_cast(data->args[4]); + stepColorCommand.optionsMask = static_cast(data->args[3]); + stepColorCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, stepColorCommand, onSuccess, onFailure); break; @@ -457,37 +457,37 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E case Clusters::ColorControl::Commands::MoveToColorTemperature::Id: moveToColorTemperatureCommand.colorTemperatureMireds = static_cast(data->args[0]); moveToColorTemperatureCommand.transitionTime = static_cast(data->args[1]); - moveToColorTemperatureCommand.optionsMask = static_cast(data->args[2]); - moveToColorTemperatureCommand.optionsOverride = static_cast(data->args[3]); + moveToColorTemperatureCommand.optionsMask = static_cast(data->args[2]); + moveToColorTemperatureCommand.optionsOverride = static_cast(data->args[3]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, moveToColorTemperatureCommand, onSuccess, onFailure); break; case Clusters::ColorControl::Commands::EnhancedMoveToHue::Id: enhancedMoveToHueCommand.enhancedHue = static_cast(data->args[0]); - enhancedMoveToHueCommand.direction = static_cast(data->args[1]); + enhancedMoveToHueCommand.direction = static_cast(data->args[1]); enhancedMoveToHueCommand.transitionTime = static_cast(data->args[2]); - enhancedMoveToHueCommand.optionsMask = static_cast(data->args[3]); - enhancedMoveToHueCommand.optionsOverride = static_cast(data->args[4]); + enhancedMoveToHueCommand.optionsMask = static_cast(data->args[3]); + enhancedMoveToHueCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, enhancedMoveToHueCommand, onSuccess, onFailure); break; case Clusters::ColorControl::Commands::EnhancedMoveHue::Id: - enhancedMoveHueCommand.moveMode = static_cast(data->args[0]); + enhancedMoveHueCommand.moveMode = static_cast(data->args[0]); enhancedMoveHueCommand.rate = static_cast(data->args[1]); - enhancedMoveHueCommand.optionsMask = static_cast(data->args[2]); - enhancedMoveHueCommand.optionsOverride = static_cast(data->args[3]); + enhancedMoveHueCommand.optionsMask = static_cast(data->args[2]); + enhancedMoveHueCommand.optionsOverride = static_cast(data->args[3]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, enhancedMoveHueCommand, onSuccess, onFailure); break; case Clusters::ColorControl::Commands::EnhancedStepHue::Id: - enhancedStepHueCommand.stepMode = static_cast(data->args[0]); + enhancedStepHueCommand.stepMode = static_cast(data->args[0]); enhancedStepHueCommand.stepSize = static_cast(data->args[1]); enhancedStepHueCommand.transitionTime = static_cast(data->args[2]); - enhancedStepHueCommand.optionsMask = static_cast(data->args[3]); - enhancedStepHueCommand.optionsOverride = static_cast(data->args[4]); + enhancedStepHueCommand.optionsMask = static_cast(data->args[3]); + enhancedStepHueCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, enhancedStepHueCommand, onSuccess, onFailure); break; @@ -496,51 +496,51 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E enhancedMoveToHueAndSaturationCommand.enhancedHue = static_cast(data->args[0]); enhancedMoveToHueAndSaturationCommand.saturation = static_cast(data->args[1]); enhancedMoveToHueAndSaturationCommand.transitionTime = static_cast(data->args[2]); - enhancedMoveToHueAndSaturationCommand.optionsMask = static_cast(data->args[3]); - enhancedMoveToHueAndSaturationCommand.optionsOverride = static_cast(data->args[4]); + enhancedMoveToHueAndSaturationCommand.optionsMask = static_cast(data->args[3]); + enhancedMoveToHueAndSaturationCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, enhancedMoveToHueAndSaturationCommand, onSuccess, onFailure); break; case Clusters::ColorControl::Commands::ColorLoopSet::Id: colorLoopSetCommand.updateFlags = - static_cast>(data->args[0]); - colorLoopSetCommand.action = static_cast(data->args[1]); - colorLoopSetCommand.direction = static_cast(data->args[2]); + static_cast>(data->args[0]); + colorLoopSetCommand.action = static_cast(data->args[1]); + colorLoopSetCommand.direction = static_cast(data->args[2]); colorLoopSetCommand.time = static_cast(data->args[3]); colorLoopSetCommand.startHue = static_cast(data->args[4]); - colorLoopSetCommand.optionsMask = static_cast(data->args[5]); - colorLoopSetCommand.optionsOverride = static_cast(data->args[6]); + colorLoopSetCommand.optionsMask = static_cast(data->args[5]); + colorLoopSetCommand.optionsOverride = static_cast(data->args[6]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, colorLoopSetCommand, onSuccess, onFailure); break; case Clusters::ColorControl::Commands::StopMoveStep::Id: - stopMoveStepCommand.optionsMask = static_cast(data->args[0]); - stopMoveStepCommand.optionsOverride = static_cast(data->args[1]); + stopMoveStepCommand.optionsMask = static_cast(data->args[0]); + stopMoveStepCommand.optionsOverride = static_cast(data->args[1]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, stopMoveStepCommand, onSuccess, onFailure); break; case Clusters::ColorControl::Commands::MoveColorTemperature::Id: - moveColorTemperatureCommand.moveMode = static_cast(data->args[0]); + moveColorTemperatureCommand.moveMode = static_cast(data->args[0]); moveColorTemperatureCommand.rate = static_cast(data->args[1]); moveColorTemperatureCommand.colorTemperatureMinimumMireds = static_cast(data->args[2]); moveColorTemperatureCommand.colorTemperatureMaximumMireds = static_cast(data->args[3]); - moveColorTemperatureCommand.optionsMask = static_cast(data->args[4]); - moveColorTemperatureCommand.optionsOverride = static_cast(data->args[5]); + moveColorTemperatureCommand.optionsMask = static_cast(data->args[4]); + moveColorTemperatureCommand.optionsOverride = static_cast(data->args[5]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, moveColorTemperatureCommand, onSuccess, onFailure); break; case Clusters::ColorControl::Commands::StepColorTemperature::Id: - stepColorTemperatureCommand.stepMode = static_cast(data->args[0]); + stepColorTemperatureCommand.stepMode = static_cast(data->args[0]); stepColorTemperatureCommand.stepSize = static_cast(data->args[1]); stepColorTemperatureCommand.transitionTime = static_cast(data->args[2]); stepColorTemperatureCommand.colorTemperatureMinimumMireds = static_cast(data->args[3]); stepColorTemperatureCommand.colorTemperatureMaximumMireds = static_cast(data->args[4]); - stepColorTemperatureCommand.optionsMask = static_cast(data->args[5]); - stepColorTemperatureCommand.optionsOverride = static_cast(data->args[6]); + stepColorTemperatureCommand.optionsMask = static_cast(data->args[5]); + stepColorTemperatureCommand.optionsOverride = static_cast(data->args[6]); Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(), binding.remote, stepColorTemperatureCommand, onSuccess, onFailure); break; @@ -577,52 +577,52 @@ void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const Emb { case Clusters::ColorControl::Commands::MoveToHue::Id: moveToHueCommand.hue = static_cast(data->args[0]); - moveToHueCommand.direction = static_cast(data->args[1]); + moveToHueCommand.direction = static_cast(data->args[1]); moveToHueCommand.transitionTime = static_cast(data->args[2]); - moveToHueCommand.optionsMask = static_cast(data->args[3]); - moveToHueCommand.optionsOverride = static_cast(data->args[4]); + moveToHueCommand.optionsMask = static_cast(data->args[3]); + moveToHueCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, moveToHueCommand); break; case Clusters::ColorControl::Commands::MoveHue::Id: - moveHueCommand.moveMode = static_cast(data->args[0]); + moveHueCommand.moveMode = static_cast(data->args[0]); moveHueCommand.rate = static_cast(data->args[1]); - moveHueCommand.optionsMask = static_cast(data->args[2]); - moveHueCommand.optionsOverride = static_cast(data->args[3]); + moveHueCommand.optionsMask = static_cast(data->args[2]); + moveHueCommand.optionsOverride = static_cast(data->args[3]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, moveHueCommand); break; case Clusters::ColorControl::Commands::StepHue::Id: - stepHueCommand.stepMode = static_cast(data->args[0]); + stepHueCommand.stepMode = static_cast(data->args[0]); stepHueCommand.stepSize = static_cast(data->args[1]); stepHueCommand.transitionTime = static_cast(data->args[2]); - stepHueCommand.optionsMask = static_cast(data->args[3]); - stepHueCommand.optionsOverride = static_cast(data->args[4]); + stepHueCommand.optionsMask = static_cast(data->args[3]); + stepHueCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, stepHueCommand); break; case Clusters::ColorControl::Commands::MoveToSaturation::Id: moveToSaturationCommand.saturation = static_cast(data->args[0]); moveToSaturationCommand.transitionTime = static_cast(data->args[1]); - moveToSaturationCommand.optionsMask = static_cast(data->args[2]); - moveToSaturationCommand.optionsOverride = static_cast(data->args[3]); + moveToSaturationCommand.optionsMask = static_cast(data->args[2]); + moveToSaturationCommand.optionsOverride = static_cast(data->args[3]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, moveToSaturationCommand); break; case Clusters::ColorControl::Commands::MoveSaturation::Id: - moveSaturationCommand.moveMode = static_cast(data->args[0]); + moveSaturationCommand.moveMode = static_cast(data->args[0]); moveSaturationCommand.rate = static_cast(data->args[1]); - moveSaturationCommand.optionsMask = static_cast(data->args[2]); - moveSaturationCommand.optionsOverride = static_cast(data->args[3]); + moveSaturationCommand.optionsMask = static_cast(data->args[2]); + moveSaturationCommand.optionsOverride = static_cast(data->args[3]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, moveSaturationCommand); break; case Clusters::ColorControl::Commands::StepSaturation::Id: - stepSaturationCommand.stepMode = static_cast(data->args[0]); + stepSaturationCommand.stepMode = static_cast(data->args[0]); stepSaturationCommand.stepSize = static_cast(data->args[1]); stepSaturationCommand.transitionTime = static_cast(data->args[2]); - stepSaturationCommand.optionsMask = static_cast(data->args[3]); - stepSaturationCommand.optionsOverride = static_cast(data->args[4]); + stepSaturationCommand.optionsMask = static_cast(data->args[3]); + stepSaturationCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, stepSaturationCommand); break; @@ -630,8 +630,8 @@ void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const Emb moveToHueAndSaturationCommand.hue = static_cast(data->args[0]); moveToHueAndSaturationCommand.saturation = static_cast(data->args[1]); moveToHueAndSaturationCommand.transitionTime = static_cast(data->args[2]); - moveToHueAndSaturationCommand.optionsMask = static_cast(data->args[3]); - moveToHueAndSaturationCommand.optionsOverride = static_cast(data->args[4]); + moveToHueAndSaturationCommand.optionsMask = static_cast(data->args[3]); + moveToHueAndSaturationCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, moveToHueAndSaturationCommand); break; @@ -639,16 +639,16 @@ void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const Emb moveToColorCommand.colorX = static_cast(data->args[0]); moveToColorCommand.colorY = static_cast(data->args[1]); moveToColorCommand.transitionTime = static_cast(data->args[2]); - moveToColorCommand.optionsMask = static_cast(data->args[3]); - moveToColorCommand.optionsOverride = static_cast(data->args[4]); + moveToColorCommand.optionsMask = static_cast(data->args[3]); + moveToColorCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, moveToColorCommand); break; case Clusters::ColorControl::Commands::MoveColor::Id: moveColorCommand.rateX = static_cast(data->args[0]); moveColorCommand.rateY = static_cast(data->args[1]); - moveColorCommand.optionsMask = static_cast(data->args[2]); - moveColorCommand.optionsOverride = static_cast(data->args[3]); + moveColorCommand.optionsMask = static_cast(data->args[2]); + moveColorCommand.optionsOverride = static_cast(data->args[3]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, moveColorCommand); break; @@ -656,42 +656,42 @@ void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const Emb stepColorCommand.stepX = static_cast(data->args[0]); stepColorCommand.stepY = static_cast(data->args[1]); stepColorCommand.transitionTime = static_cast(data->args[2]); - stepColorCommand.optionsMask = static_cast(data->args[3]); - stepColorCommand.optionsOverride = static_cast(data->args[4]); + stepColorCommand.optionsMask = static_cast(data->args[3]); + stepColorCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, stepColorCommand); break; case Clusters::ColorControl::Commands::MoveToColorTemperature::Id: moveToColorTemperatureCommand.colorTemperatureMireds = static_cast(data->args[0]); moveToColorTemperatureCommand.transitionTime = static_cast(data->args[1]); - moveToColorTemperatureCommand.optionsMask = static_cast(data->args[2]); - moveToColorTemperatureCommand.optionsOverride = static_cast(data->args[3]); + moveToColorTemperatureCommand.optionsMask = static_cast(data->args[2]); + moveToColorTemperatureCommand.optionsOverride = static_cast(data->args[3]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, moveToColorTemperatureCommand); break; case Clusters::ColorControl::Commands::EnhancedMoveToHue::Id: enhancedMoveToHueCommand.enhancedHue = static_cast(data->args[0]); - enhancedMoveToHueCommand.direction = static_cast(data->args[1]); + enhancedMoveToHueCommand.direction = static_cast(data->args[1]); enhancedMoveToHueCommand.transitionTime = static_cast(data->args[2]); - enhancedMoveToHueCommand.optionsMask = static_cast(data->args[3]); - enhancedMoveToHueCommand.optionsOverride = static_cast(data->args[4]); + enhancedMoveToHueCommand.optionsMask = static_cast(data->args[3]); + enhancedMoveToHueCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, enhancedMoveToHueCommand); break; case Clusters::ColorControl::Commands::EnhancedMoveHue::Id: - enhancedMoveHueCommand.moveMode = static_cast(data->args[0]); + enhancedMoveHueCommand.moveMode = static_cast(data->args[0]); enhancedMoveHueCommand.rate = static_cast(data->args[1]); - enhancedMoveHueCommand.optionsMask = static_cast(data->args[2]); - enhancedMoveHueCommand.optionsOverride = static_cast(data->args[3]); + enhancedMoveHueCommand.optionsMask = static_cast(data->args[2]); + enhancedMoveHueCommand.optionsOverride = static_cast(data->args[3]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, enhancedMoveHueCommand); break; case Clusters::ColorControl::Commands::EnhancedStepHue::Id: - enhancedStepHueCommand.stepMode = static_cast(data->args[0]); + enhancedStepHueCommand.stepMode = static_cast(data->args[0]); enhancedStepHueCommand.stepSize = static_cast(data->args[1]); enhancedStepHueCommand.transitionTime = static_cast(data->args[2]); - enhancedStepHueCommand.optionsMask = static_cast(data->args[3]); - enhancedStepHueCommand.optionsOverride = static_cast(data->args[4]); + enhancedStepHueCommand.optionsMask = static_cast(data->args[3]); + enhancedStepHueCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, enhancedStepHueCommand); break; @@ -699,48 +699,48 @@ void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const Emb enhancedMoveToHueAndSaturationCommand.enhancedHue = static_cast(data->args[0]); enhancedMoveToHueAndSaturationCommand.saturation = static_cast(data->args[1]); enhancedMoveToHueAndSaturationCommand.transitionTime = static_cast(data->args[2]); - enhancedMoveToHueAndSaturationCommand.optionsMask = static_cast(data->args[3]); - enhancedMoveToHueAndSaturationCommand.optionsOverride = static_cast(data->args[4]); + enhancedMoveToHueAndSaturationCommand.optionsMask = static_cast(data->args[3]); + enhancedMoveToHueAndSaturationCommand.optionsOverride = static_cast(data->args[4]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, enhancedMoveToHueAndSaturationCommand); break; case Clusters::ColorControl::Commands::ColorLoopSet::Id: colorLoopSetCommand.updateFlags = - static_cast>(data->args[0]); - colorLoopSetCommand.action = static_cast(data->args[1]); - colorLoopSetCommand.direction = static_cast(data->args[2]); + static_cast>(data->args[0]); + colorLoopSetCommand.action = static_cast(data->args[1]); + colorLoopSetCommand.direction = static_cast(data->args[2]); colorLoopSetCommand.time = static_cast(data->args[3]); colorLoopSetCommand.startHue = static_cast(data->args[4]); - colorLoopSetCommand.optionsMask = static_cast(data->args[5]); - colorLoopSetCommand.optionsOverride = static_cast(data->args[6]); + colorLoopSetCommand.optionsMask = static_cast(data->args[5]); + colorLoopSetCommand.optionsOverride = static_cast(data->args[6]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, colorLoopSetCommand); break; case Clusters::ColorControl::Commands::StopMoveStep::Id: - stopMoveStepCommand.optionsMask = static_cast(data->args[0]); - stopMoveStepCommand.optionsOverride = static_cast(data->args[1]); + stopMoveStepCommand.optionsMask = static_cast(data->args[0]); + stopMoveStepCommand.optionsOverride = static_cast(data->args[1]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, stopMoveStepCommand); break; case Clusters::ColorControl::Commands::MoveColorTemperature::Id: - moveColorTemperatureCommand.moveMode = static_cast(data->args[0]); + moveColorTemperatureCommand.moveMode = static_cast(data->args[0]); moveColorTemperatureCommand.rate = static_cast(data->args[1]); moveColorTemperatureCommand.colorTemperatureMinimumMireds = static_cast(data->args[2]); moveColorTemperatureCommand.colorTemperatureMaximumMireds = static_cast(data->args[3]); - moveColorTemperatureCommand.optionsMask = static_cast(data->args[4]); - moveColorTemperatureCommand.optionsOverride = static_cast(data->args[5]); + moveColorTemperatureCommand.optionsMask = static_cast(data->args[4]); + moveColorTemperatureCommand.optionsOverride = static_cast(data->args[5]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, moveColorTemperatureCommand); break; case Clusters::ColorControl::Commands::StepColorTemperature::Id: - stepColorTemperatureCommand.stepMode = static_cast(data->args[0]); + stepColorTemperatureCommand.stepMode = static_cast(data->args[0]); stepColorTemperatureCommand.stepSize = static_cast(data->args[1]); stepColorTemperatureCommand.transitionTime = static_cast(data->args[2]); stepColorTemperatureCommand.colorTemperatureMinimumMireds = static_cast(data->args[3]); stepColorTemperatureCommand.colorTemperatureMaximumMireds = static_cast(data->args[4]); - stepColorTemperatureCommand.optionsMask = static_cast(data->args[5]); - stepColorTemperatureCommand.optionsOverride = static_cast(data->args[6]); + stepColorTemperatureCommand.optionsMask = static_cast(data->args[5]); + stepColorTemperatureCommand.optionsOverride = static_cast(data->args[6]); Controller::InvokeGroupCommandRequest(&exchangeMgr, binding.fabricIndex, binding.groupId, stepColorTemperatureCommand); break; } diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 1444915c368b6b..16f170c1379591 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -4281,65 +4281,62 @@ cluster ThermostatUserInterfaceConfiguration = 516 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -4350,16 +4347,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -4391,13 +4399,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -4411,150 +4419,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index 961f40352b1052..d8758b3043edaa 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -1715,65 +1715,62 @@ cluster GroupKeyManagement = 63 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -1784,16 +1781,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -1825,13 +1833,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -1845,150 +1853,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index d9841f769a79dd..0ef1c969727a6d 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -1816,65 +1816,62 @@ cluster FixedLabel = 64 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -1885,16 +1882,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -1926,13 +1934,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -1946,150 +1954,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/examples/common/imgui_ui/windows/light.cpp b/examples/common/imgui_ui/windows/light.cpp index 86899e044b2ed1..f4950739e6c416 100644 --- a/examples/common/imgui_ui/windows/light.cpp +++ b/examples/common/imgui_ui/windows/light.cpp @@ -155,14 +155,14 @@ void Light::Render() ImGui::Text("Color Control:"); ImGui::Indent(); const char * mode = // based on ColorMode attribute: spec 3.2.7.9 - (mColorMode == kColorModeCurrentHueAndCurrentSaturation) ? "Hue/Saturation" - : (mColorMode == kColorModeCurrentXAndCurrentY) ? "X/Y" - : (mColorMode == kColorModeColorTemperature) ? "Temperature/Mireds" - : "UNKNOWN"; + (mColorMode == ColorControl::ColorModeEnum::kCurrentHueAndCurrentSaturation) ? "Hue/Saturation" + : (mColorMode == ColorControl::ColorModeEnum::kCurrentXAndCurrentY) ? "X/Y" + : (mColorMode == ColorControl::ColorModeEnum::kColorTemperatureMireds) ? "Temperature/Mireds" + : "UNKNOWN"; ImGui::Text("Mode: %s", mode); - if (mColorMode == kColorModeCurrentHueAndCurrentSaturation) + if (mColorMode == ColorControl::ColorModeEnum::kCurrentHueAndCurrentSaturation) { const float hueDegrees = (mColorHue * 360.0f) / 254.0f; const float saturationPercent = 100.0f * (mColorSaturation / 254.0f); @@ -173,12 +173,12 @@ void Light::Render() ImGui::ColorButton("LightColor", HueSaturationToColor(hueDegrees, saturationPercent), 0 /* ImGuiColorEditFlags_* */, ImVec2(80, 80)); } - else if (mColorMode == kColorModeCurrentXAndCurrentY) + else if (mColorMode == ColorControl::ColorModeEnum::kCurrentXAndCurrentY) { ImGui::Text("Current X: %d", mColorX); ImGui::Text("Current Y: %d", mColorY); } - else if (mColorMode == kColorModeColorTemperature) + else if (mColorMode == ColorControl::ColorModeEnum::kColorTemperatureMireds) { ImGui::Text("Color Temperature Mireds: %d", mColorTemperatureMireds); } diff --git a/examples/common/imgui_ui/windows/light.h b/examples/common/imgui_ui/windows/light.h index 20942373d3111c..242f6c98b81889 100644 --- a/examples/common/imgui_ui/windows/light.h +++ b/examples/common/imgui_ui/windows/light.h @@ -62,7 +62,8 @@ class Light : public Window uint16_t mLevelRemainingTime10sOfSec = 0; // Color control - uint8_t mColorMode = kColorModeCurrentHueAndCurrentSaturation; + chip::app::Clusters::ColorControl::ColorModeEnum mColorMode = + chip::app::Clusters::ColorControl::ColorModeEnum::kCurrentHueAndCurrentSaturation; uint8_t mColorHue = 0; uint8_t mColorSaturation = 0; uint16_t mColorX = 0; diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index 8cd9c653a75bb5..3909b6073c8b9c 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -2502,65 +2502,62 @@ provisional cluster ScenesManagement = 98 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -2571,16 +2568,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -2612,13 +2620,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -2632,150 +2640,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/examples/light-switch-app/qpg/zap/switch.matter b/examples/light-switch-app/qpg/zap/switch.matter index 6924e96503d0c6..c93a50bb03e2dc 100644 --- a/examples/light-switch-app/qpg/zap/switch.matter +++ b/examples/light-switch-app/qpg/zap/switch.matter @@ -2558,65 +2558,62 @@ provisional cluster ScenesManagement = 98 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -2627,16 +2624,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -2668,13 +2676,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -2688,150 +2696,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter index 331f7e79cadfe9..30f4d63c6a4e1e 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -1855,65 +1855,62 @@ cluster UserLabel = 65 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -1924,16 +1921,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -1965,13 +1973,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -1985,150 +1993,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index f6bb26ec689619..2abf5c7251711d 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -1979,65 +1979,62 @@ cluster UserLabel = 65 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -2048,16 +2045,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -2089,13 +2097,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -2109,150 +2117,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index 9dee0bdcdb040d..b9dfeee6321680 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -1890,65 +1890,62 @@ cluster UserLabel = 65 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -1959,16 +1956,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -2000,13 +2008,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -2020,150 +2028,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 5ddd7071470692..df7f0dfe4d9a55 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -2310,65 +2310,62 @@ provisional cluster ScenesManagement = 98 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -2379,16 +2376,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -2420,13 +2428,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -2440,150 +2448,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index 6add567a134707..35e00056736443 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -1918,65 +1918,62 @@ cluster UserLabel = 65 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -1987,16 +1984,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -2028,13 +2036,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -2048,150 +2056,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index d0e06e94f94dac..f4c2928a35778e 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -2014,65 +2014,62 @@ provisional cluster ScenesManagement = 98 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -2083,16 +2080,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -2124,13 +2132,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -2144,150 +2152,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index a9d48f8ae85b3c..59919ee6b48737 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -2305,65 +2305,62 @@ provisional cluster ScenesManagement = 98 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -2374,16 +2371,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -2415,13 +2423,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -2435,150 +2443,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/examples/lighting-app/tizen/src/DBusInterface.cpp b/examples/lighting-app/tizen/src/DBusInterface.cpp index 50dbd37930b47f..36c0f19c35bb7a 100644 --- a/examples/lighting-app/tizen/src/DBusInterface.cpp +++ b/examples/lighting-app/tizen/src/DBusInterface.cpp @@ -217,11 +217,11 @@ void DBusInterface::InitOnOff() void DBusInterface::InitColor() { { - uint8_t value = 0; - auto status = Clusters::ColorControl::Attributes::ColorMode::Get(mEndpointId, &value); + auto value = Clusters::ColorControl::ColorModeEnum::kCurrentHueAndCurrentSaturation; + auto status = Clusters::ColorControl::Attributes::ColorMode::Get(mEndpointId, &value); VerifyOrReturn(status == Protocols::InteractionModel::Status::Success, ChipLogError(NotSpecified, "Error getting ColorMode: 0x%x", to_underlying(status))); - light_app_color_control_set_color_mode(mIfaceColorControl, value); + light_app_color_control_set_color_mode(mIfaceColorControl, to_underlying(value)); } { uint16_t value = 0; diff --git a/examples/lighting-app/tizen/src/main.cpp b/examples/lighting-app/tizen/src/main.cpp index c1cda62a2378d5..040a8a5fcb231f 100644 --- a/examples/lighting-app/tizen/src/main.cpp +++ b/examples/lighting-app/tizen/src/main.cpp @@ -123,7 +123,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & void emberAfColorControlClusterInitCallback(EndpointId endpoint) { // Set the color mode to color temperature. - Clusters::ColorControl::Attributes::ColorMode::Set(endpoint, ColorControlServer::EnhancedColorMode::kColorTemperature); + Clusters::ColorControl::Attributes::ColorMode::Set(endpoint, Clusters::ColorControl::ColorModeEnum::kColorTemperatureMireds); // Preserve the state of the color temperature attribute across reboots. Clusters::ColorControl::Attributes::StartUpColorTemperatureMireds::SetNull(endpoint); } diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index b72a4b280351b9..8befb87daa5f9a 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -5872,65 +5872,62 @@ cluster ThermostatUserInterfaceConfiguration = 516 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -5941,16 +5938,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -5982,13 +5990,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -6002,150 +6010,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ @@ -6192,65 +6200,62 @@ cluster ColorControl = 768 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -6261,16 +6266,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -6302,13 +6318,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -6322,150 +6338,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 41421c7e917d0e..6cfcc1ab7ea6cf 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -5829,65 +5829,62 @@ cluster ThermostatUserInterfaceConfiguration = 516 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -5898,16 +5895,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -5939,13 +5947,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -5959,150 +5967,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ @@ -6149,65 +6157,62 @@ cluster ColorControl = 768 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -6218,16 +6223,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -6259,13 +6275,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -6279,150 +6295,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index 135846fd606d48..3c20256117f2cb 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -3161,65 +3161,62 @@ cluster WindowCovering = 258 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -3230,16 +3227,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -3271,13 +3279,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -3291,150 +3299,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp index 4a4fc69b4efe07..406d06f4b1e794 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -35,31 +36,6 @@ using namespace chip::app::Clusters; using namespace chip::app::Clusters::ColorControl; using chip::Protocols::InteractionModel::Status; -// These constants are NOT currently spec compliant -// These should be changed once we have real specification enumeration -// names. -namespace chip { -namespace app { -namespace Clusters { -namespace ColorControl { - -namespace EnhancedColorMode { -constexpr uint8_t kCurrentHueAndCurrentSaturation = ColorControlServer::EnhancedColorMode::kCurrentHueAndCurrentSaturation; -constexpr uint8_t kCurrentXAndCurrentY = ColorControlServer::EnhancedColorMode::kCurrentXAndCurrentY; -constexpr uint8_t kColorTemperature = ColorControlServer::EnhancedColorMode::kColorTemperature; -constexpr uint8_t kEnhancedCurrentHueAndCurrentSaturation = - ColorControlServer::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation; -} // namespace EnhancedColorMode - -namespace Options { -constexpr uint8_t kExecuteIfOff = 1; -} // namespace Options - -} // namespace ColorControl -} // namespace Clusters -} // namespace app -} // namespace chip - #if defined(MATTER_DM_PLUGIN_SCENES_MANAGEMENT) && CHIP_CONFIG_SCENES_USE_DEFAULT_HANDLERS class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl { @@ -174,12 +150,12 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl AddAttributeValuePair(pairs, Attributes::ColorTemperatureMireds::Id, temperatureValue, attributeCount); } - uint8_t modeValue; + EnhancedColorMode modeValue; if (Status::Success != Attributes::EnhancedColorMode::Get(endpoint, &modeValue)) { - modeValue = ColorControl::EnhancedColorMode::kCurrentXAndCurrentY; // Default mode value according to spec + modeValue = EnhancedColorMode::kCurrentXAndCurrentY; // Default mode value according to spec } - AddAttributeValuePair(pairs, Attributes::EnhancedColorMode::Id, modeValue, attributeCount); + AddAttributeValuePair(pairs, Attributes::EnhancedColorMode::Id, to_underlying(modeValue), attributeCount); app::DataModel::List attributeValueList(pairs, attributeCount); @@ -226,7 +202,7 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl #endif // Initialize action attributes to default values in case they are not in the scene - uint8_t targetColorMode = 0x00; + auto targetColorMode = EnhancedColorModeEnum::kCurrentHueAndCurrentSaturation; uint8_t loopActiveValue = 0x00; uint8_t loopDirectionValue = 0x00; uint16_t loopTimeValue = 0x0019; // Default loop time value according to spec @@ -238,7 +214,7 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl switch (decodePair.attributeID) { case Attributes::CurrentX::Id: - if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kCurrentXAndCurrentY)) + if (SupportsColorMode(endpoint, EnhancedColorMode::kCurrentXAndCurrentY)) { VerifyOrReturnError(decodePair.valueUnsigned16.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); colorXTransitionState->finalValue = @@ -246,7 +222,7 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl } break; case Attributes::CurrentY::Id: - if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kCurrentXAndCurrentY)) + if (SupportsColorMode(endpoint, EnhancedColorMode::kCurrentXAndCurrentY)) { VerifyOrReturnError(decodePair.valueUnsigned16.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); colorYTransitionState->finalValue = @@ -254,14 +230,14 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl } break; case Attributes::EnhancedCurrentHue::Id: - if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation)) + if (SupportsColorMode(endpoint, EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation)) { VerifyOrReturnError(decodePair.valueUnsigned16.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); colorHueTransitionState->finalEnhancedHue = decodePair.valueUnsigned16.Value(); } break; case Attributes::CurrentSaturation::Id: - if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation)) + if (SupportsColorMode(endpoint, EnhancedColorMode::kCurrentHueAndCurrentSaturation)) { VerifyOrReturnError(decodePair.valueUnsigned8.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); colorSaturationTransitionState->finalValue = std::min(static_cast(decodePair.valueUnsigned8.Value()), @@ -281,7 +257,7 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl loopTimeValue = decodePair.valueUnsigned16.Value(); break; case Attributes::ColorTemperatureMireds::Id: - if (SupportsColorMode(endpoint, ColorControl::EnhancedColorMode::kColorTemperature)) + if (SupportsColorMode(endpoint, EnhancedColorMode::kColorTemperatureMireds)) { VerifyOrReturnError(decodePair.valueUnsigned16.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); colorTempTransitionState->finalValue = @@ -290,10 +266,9 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl break; case Attributes::EnhancedColorMode::Id: VerifyOrReturnError(decodePair.valueUnsigned8.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); - if (decodePair.valueUnsigned8.Value() <= - static_cast(ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation)) + if (decodePair.valueUnsigned8.Value() <= to_underlying(EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation)) { - targetColorMode = decodePair.valueUnsigned8.Value(); + targetColorMode = static_cast(decodePair.valueUnsigned8.Value()); } break; default: @@ -328,25 +303,25 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl // Execute movement to value depending on the mode in the saved scene switch (targetColorMode) { - case ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation: + case EnhancedColorMode::kCurrentHueAndCurrentSaturation: #ifdef MATTER_DM_PLUGIN_COLOR_CONTROL_SERVER_HSV ColorControlServer::Instance().moveToSaturation(static_cast(colorSaturationTransitionState->finalValue), transitionTime10th, endpoint); #endif // MATTER_DM_PLUGIN_COLOR_CONTROL_SERVER_HSV break; - case ColorControl::EnhancedColorMode::kCurrentXAndCurrentY: + case EnhancedColorMode::kCurrentXAndCurrentY: #ifdef MATTER_DM_PLUGIN_COLOR_CONTROL_SERVER_XY ColorControlServer::Instance().moveToColor(colorXTransitionState->finalValue, colorYTransitionState->finalValue, transitionTime10th, endpoint); #endif // MATTER_DM_PLUGIN_COLOR_CONTROL_SERVER_XY break; - case ColorControl::EnhancedColorMode::kColorTemperature: + case EnhancedColorMode::kColorTemperatureMireds: #ifdef MATTER_DM_PLUGIN_COLOR_CONTROL_SERVER_TEMP ColorControlServer::Instance().moveToColorTemp( endpoint, static_cast(colorTempTransitionState->finalValue), transitionTime10th); #endif // MATTER_DM_PLUGIN_COLOR_CONTROL_SERVER_TEMP break; - case ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation: + case EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation: #ifdef MATTER_DM_PLUGIN_COLOR_CONTROL_SERVER_HSV ColorControlServer::Instance().moveToHueAndSaturation( colorHueTransitionState->finalEnhancedHue, static_cast(colorSaturationTransitionState->finalValue), @@ -361,20 +336,20 @@ class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl } private: - bool SupportsColorMode(EndpointId endpoint, uint8_t mode) + bool SupportsColorMode(EndpointId endpoint, EnhancedColorMode mode) { switch (mode) { - case ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation: + case EnhancedColorMode::kCurrentHueAndCurrentSaturation: return ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kHueAndSaturation); break; - case ColorControl::EnhancedColorMode::kCurrentXAndCurrentY: + case EnhancedColorMode::kCurrentXAndCurrentY: return ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kXy); break; - case ColorControl::EnhancedColorMode::kColorTemperature: + case EnhancedColorMode::kColorTemperatureMireds: return ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kColorTemperature); break; - case ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation: + case EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation: return ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kEnhancedHue); break; default: @@ -494,7 +469,7 @@ Status ColorControlServer::stopAllColorTransitions(EndpointId endpoint) } bool ColorControlServer::stopMoveStepCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, - uint8_t optionsMask, uint8_t optionsOverride) + BitMask optionsMask, BitMask optionsOverride) { EndpointId endpoint = commandPath.mEndpointId; Status status = Status::Success; @@ -534,7 +509,8 @@ bool ColorControlServer::stopMoveStepCommand(app::CommandHandler * commandObj, c return true; } -bool ColorControlServer::shouldExecuteIfOff(EndpointId endpoint, uint8_t optionMask, uint8_t optionOverride) +bool ColorControlServer::shouldExecuteIfOff(EndpointId endpoint, BitMask optionMask, + BitMask optionOverride) { // From 5.2.2.2.1.10 of ZCL7 document 14-0129-15f-zcl-ch-5-lighting.docx: // "Command execution SHALL NOT continue beyond the Options processing if @@ -549,7 +525,7 @@ bool ColorControlServer::shouldExecuteIfOff(EndpointId endpoint, uint8_t optionM return true; } - uint8_t options = 0x00; + BitMask options = 0x00; Attributes::Options::Get(endpoint, &options); bool on = true; @@ -576,23 +552,23 @@ bool ColorControlServer::shouldExecuteIfOff(EndpointId endpoint, uint8_t optionM // ---------- The following order is important in decision making ------- // -----------more readable ---------- // - if (optionMask == 0xFF && optionOverride == 0xFF) + if (optionMask == static_cast(0xFF) && optionOverride == static_cast(0xFF)) { // 0xFF are the default values passed to the command handler when // the payload is not present - in that case there is use of option // attribute to decide execution of the command - return READBITS(options, ColorControl::Options::kExecuteIfOff); + return options.Has(OptionsBitmap::kExecuteIfOff); } // ---------- The above is to distinguish if the payload is present or not - if (READBITS(optionMask, ColorControl::Options::kExecuteIfOff)) + if (optionMask.Has(OptionsBitmap::kExecuteIfOff)) { // Mask is present and set in the command payload, this indicates // use the override as temporary option - return READBITS(optionOverride, ColorControl::Options::kExecuteIfOff); + return optionOverride.Has(OptionsBitmap::kExecuteIfOff); } - // if we are here - use the option attribute bits - return (READBITS(options, ColorControl::Options::kExecuteIfOff)); + // if we are here - use the option bits + return options.Has(OptionsBitmap::kExecuteIfOff); } /** @@ -606,28 +582,28 @@ bool ColorControlServer::shouldExecuteIfOff(EndpointId endpoint, uint8_t optionM * @param endpoint * @param newColorMode */ -void ColorControlServer::handleModeSwitch(EndpointId endpoint, uint8_t newColorMode) +void ColorControlServer::handleModeSwitch(EndpointId endpoint, EnhancedColorModeEnum newColorMode) { - uint8_t oldColorMode = 0; + auto oldColorMode = ColorModeEnum::kCurrentHueAndCurrentSaturation; Attributes::ColorMode::Get(endpoint, &oldColorMode); uint8_t colorModeTransition; - if (oldColorMode == newColorMode) + if (static_cast(oldColorMode) == newColorMode) { return; } Attributes::EnhancedColorMode::Set(endpoint, newColorMode); - if (newColorMode == ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation) + if (newColorMode == EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation) { - // Transpose COLOR_MODE_EHSV to ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation after setting + // Transpose COLOR_MODE_EHSV to EnhancedColorMode::kCurrentHueAndCurrentSaturation after setting // EnhancedColorMode - newColorMode = ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation; + newColorMode = EnhancedColorMode::kCurrentHueAndCurrentSaturation; } - Attributes::ColorMode::Set(endpoint, newColorMode); + Attributes::ColorMode::Set(endpoint, static_cast(newColorMode)); - colorModeTransition = static_cast((newColorMode << 4) + oldColorMode); + colorModeTransition = static_cast((to_underlying(newColorMode) << 4) + to_underlying(oldColorMode)); // Note: It may be OK to not do anything here. switch (colorModeTransition) @@ -1044,7 +1020,7 @@ void ColorControlServer::startColorLoop(EndpointId endpoint, uint8_t startFromSt colorHueTransitionState->initialEnhancedHue = startHue; - if (direction == to_underlying(ColorLoopDirection::kIncrementHue)) + if (direction == to_underlying(ColorLoopDirectionEnum::kIncrement)) { colorHueTransitionState->finalEnhancedHue = static_cast(startHue - 1); } @@ -1053,7 +1029,7 @@ void ColorControlServer::startColorLoop(EndpointId endpoint, uint8_t startFromSt colorHueTransitionState->finalEnhancedHue = static_cast(startHue + 1); } - colorHueTransitionState->up = (direction == to_underlying(ColorLoopDirection::kIncrementHue)); + colorHueTransitionState->up = (direction == to_underlying(ColorLoopDirectionEnum::kIncrement)); colorHueTransitionState->repeat = true; colorHueTransitionState->stepsRemaining = static_cast(time * TRANSITION_STEPS_PER_1S); @@ -1297,7 +1273,7 @@ Status ColorControlServer::moveToSaturation(uint8_t saturation, uint16_t transit stopAllColorTransitions(endpoint); // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation); + handleModeSwitch(endpoint, EnhancedColorMode::kCurrentHueAndCurrentSaturation); // now, kick off the state machine. initSaturationTransitionState(endpoint, colorSaturationTransitionState); @@ -1421,8 +1397,8 @@ Status ColorControlServer::moveToHueAndSaturation(uint16_t hue, uint8_t saturati * @return false Failed */ bool ColorControlServer::moveHueCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, - HueMoveMode moveMode, uint16_t rate, uint8_t optionsMask, uint8_t optionsOverride, - bool isEnhanced) + HueMoveMode moveMode, uint16_t rate, BitMask optionsMask, + BitMask optionsOverride, bool isEnhanced) { MATTER_TRACE_SCOPE("moveHue", "ColorControl"); EndpointId endpoint = commandPath.mEndpointId; @@ -1464,11 +1440,11 @@ bool ColorControlServer::moveHueCommand(app::CommandHandler * commandObj, const // Handle color mode transition, if necessary. if (isEnhanced) { - handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation); + handleModeSwitch(endpoint, EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation); } else { - handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation); + handleModeSwitch(endpoint, EnhancedColorMode::kCurrentHueAndCurrentSaturation); } if (moveMode == HueMoveMode::kUp) @@ -1531,15 +1507,16 @@ bool ColorControlServer::moveHueCommand(app::CommandHandler * commandObj, const * @return false Failed */ bool ColorControlServer::moveToHueCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, - uint16_t hue, HueDirection moveDirection, uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride, bool isEnhanced) + uint16_t hue, DirectionEnum moveDirection, uint16_t transitionTime, + BitMask optionsMask, BitMask optionsOverride, + bool isEnhanced) { MATTER_TRACE_SCOPE("moveToHue", "ColorControl"); EndpointId endpoint = commandPath.mEndpointId; Status status = Status::Success; uint16_t currentHue = 0; - HueDirection direction; + DirectionEnum direction; ColorHueTransitionState * colorHueTransitionState = getColorHueTransitionState(endpoint); @@ -1568,33 +1545,33 @@ bool ColorControlServer::moveToHueCommand(app::CommandHandler * commandObj, cons // Convert the ShortestDistance/LongestDistance moveDirection values into Up/Down. switch (moveDirection) { - case HueDirection::kShortestDistance: + case DirectionEnum::kShortest: if ((isEnhanced && (static_cast(currentHue - hue) > HALF_MAX_UINT16T)) || (!isEnhanced && (static_cast(currentHue - hue) > HALF_MAX_UINT8T))) { - direction = HueDirection::kUp; + direction = DirectionEnum::kUp; } else { - direction = HueDirection::kDown; + direction = DirectionEnum::kDown; } break; - case HueDirection::kLongestDistance: + case DirectionEnum::kLongest: if ((isEnhanced && (static_cast(currentHue - hue) > HALF_MAX_UINT16T)) || (!isEnhanced && (static_cast(currentHue - hue) > HALF_MAX_UINT8T))) { - direction = HueDirection::kDown; + direction = DirectionEnum::kDown; } else { - direction = HueDirection::kUp; + direction = DirectionEnum::kUp; } break; - case HueDirection::kUp: - case HueDirection::kDown: + case DirectionEnum::kUp: + case DirectionEnum::kDown: direction = moveDirection; break; - case HueDirection::kUnknownEnumValue: + case DirectionEnum::kUnknownEnumValue: commandObj->AddStatus(commandPath, Status::InvalidCommand); return true; /* No default case, so if a new direction value gets added we will just fail @@ -1613,11 +1590,11 @@ bool ColorControlServer::moveToHueCommand(app::CommandHandler * commandObj, cons // Handle color mode transition, if necessary. if (isEnhanced) { - handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation); + handleModeSwitch(endpoint, EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation); } else { - handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation); + handleModeSwitch(endpoint, EnhancedColorMode::kCurrentHueAndCurrentSaturation); } // now, kick off the state machine. @@ -1637,7 +1614,7 @@ bool ColorControlServer::moveToHueCommand(app::CommandHandler * commandObj, cons colorHueTransitionState->timeRemaining = transitionTime; colorHueTransitionState->transitionTime = transitionTime; colorHueTransitionState->endpoint = endpoint; - colorHueTransitionState->up = (direction == HueDirection::kUp); + colorHueTransitionState->up = (direction == DirectionEnum::kUp); colorHueTransitionState->repeat = false; SetHSVRemainingTime(endpoint); @@ -1667,8 +1644,9 @@ bool ColorControlServer::moveToHueCommand(app::CommandHandler * commandObj, cons */ bool ColorControlServer::moveToHueAndSaturationCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, uint16_t hue, - uint8_t saturation, uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride, bool isEnhanced) + uint8_t saturation, uint16_t transitionTime, + BitMask optionsMask, BitMask optionsOverride, + bool isEnhanced) { MATTER_TRACE_SCOPE("moveToHueAndSaturation", "ColorControl"); // limit checking: hue and saturation are 0..254. Spec dictates we ignore @@ -1707,8 +1685,8 @@ bool ColorControlServer::moveToHueAndSaturationCommand(app::CommandHandler * com * @return false Failed */ bool ColorControlServer::stepHueCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, - HueStepMode stepMode, uint16_t stepSize, uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride, bool isEnhanced) + HueStepMode stepMode, uint16_t stepSize, uint16_t transitionTime, + BitMask optionsMask, BitMask optionsOverride, bool isEnhanced) { MATTER_TRACE_SCOPE("stepHue", "ColorControl"); EndpointId endpoint = commandPath.mEndpointId; @@ -1737,11 +1715,11 @@ bool ColorControlServer::stepHueCommand(app::CommandHandler * commandObj, const // Handle color mode transition, if necessary. if (isEnhanced) { - handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation); + handleModeSwitch(endpoint, EnhancedColorMode::kEnhancedCurrentHueAndCurrentSaturation); } else { - handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation); + handleModeSwitch(endpoint, EnhancedColorMode::kCurrentHueAndCurrentSaturation); } // now, kick off the state machine. @@ -1839,7 +1817,7 @@ bool ColorControlServer::moveSaturationCommand(app::CommandHandler * commandObj, } // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation); + handleModeSwitch(endpoint, EnhancedColorMode::kCurrentHueAndCurrentSaturation); if (moveMode == SaturationMoveMode::kUp) { @@ -1908,14 +1886,14 @@ bool ColorControlServer::stepSaturationCommand(app::CommandHandler * commandObj, const Commands::StepSaturation::DecodableType & commandData) { MATTER_TRACE_SCOPE("stepSaturation", "ColorControl"); - auto stepMode = commandData.stepMode; - uint8_t stepSize = commandData.stepSize; - uint8_t transitionTime = commandData.transitionTime; - uint8_t optionsMask = commandData.optionsMask; - uint8_t optionsOverride = commandData.optionsOverride; - EndpointId endpoint = commandPath.mEndpointId; - Status status = Status::Success; - uint8_t currentSaturation = 0; + auto stepMode = commandData.stepMode; + uint8_t stepSize = commandData.stepSize; + uint8_t transitionTime = commandData.transitionTime; + BitMask optionsMask = commandData.optionsMask; + BitMask optionsOverride = commandData.optionsOverride; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + uint8_t currentSaturation = 0; Color16uTransitionState * colorSaturationTransitionState = getSaturationTransitionState(endpoint); VerifyOrExit(colorSaturationTransitionState != nullptr, status = Status::UnsupportedEndpoint); @@ -1937,7 +1915,7 @@ bool ColorControlServer::stepSaturationCommand(app::CommandHandler * commandObj, stopAllColorTransitions(endpoint); // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kCurrentHueAndCurrentSaturation); + handleModeSwitch(endpoint, EnhancedColorMode::kCurrentHueAndCurrentSaturation); // now, kick off the state machine. initSaturationTransitionState(endpoint, colorSaturationTransitionState); @@ -1973,24 +1951,24 @@ bool ColorControlServer::colorLoopCommand(app::CommandHandler * commandObj, cons const Commands::ColorLoopSet::DecodableType & commandData) { MATTER_TRACE_SCOPE("colorLoop", "ColorControl"); - auto updateFlags = commandData.updateFlags; - auto action = commandData.action; - auto direction = commandData.direction; - uint16_t time = commandData.time; - uint16_t startHue = commandData.startHue; - uint8_t optionsMask = commandData.optionsMask; - uint8_t optionsOverride = commandData.optionsOverride; - EndpointId endpoint = commandPath.mEndpointId; - Status status = Status::Success; - uint8_t isColorLoopActive = 0; - uint8_t deactiveColorLoop = 0; + auto updateFlags = commandData.updateFlags; + auto action = commandData.action; + auto direction = commandData.direction; + uint16_t time = commandData.time; + uint16_t startHue = commandData.startHue; + BitMask optionsMask = commandData.optionsMask; + BitMask optionsOverride = commandData.optionsOverride; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + uint8_t isColorLoopActive = 0; + uint8_t deactiveColorLoop = 0; uint16_t epIndex = getEndpointIndex(endpoint); ColorHueTransitionState * colorHueTransitionState = getColorHueTransitionStateByIndex(epIndex); VerifyOrExit(colorHueTransitionState != nullptr, status = Status::UnsupportedEndpoint); // Validate the action and direction parameters of the command - if (action == ColorLoopAction::kUnknownEnumValue || direction == ColorLoopDirection::kUnknownEnumValue) + if (action == ColorLoopActionEnum::kUnknownEnumValue || direction == ColorLoopDirectionEnum::kUnknownEnumValue) { commandObj->AddStatus(commandPath, Status::InvalidCommand); return true; @@ -2017,10 +1995,10 @@ bool ColorControlServer::colorLoopCommand(app::CommandHandler * commandObj, cons // Checks if color loop is active and stays active if (isColorLoopActive && !deactiveColorLoop) { - colorHueTransitionState->up = (direction == ColorLoopDirection::kIncrementHue); + colorHueTransitionState->up = (direction == ColorLoopDirectionEnum::kIncrement); colorHueTransitionState->initialEnhancedHue = colorHueTransitionState->currentEnhancedHue; - if (direction == ColorLoopDirection::kIncrementHue) + if (direction == ColorLoopDirectionEnum::kIncrement) { colorHueTransitionState->finalEnhancedHue = static_cast(colorHueTransitionState->initialEnhancedHue - 1); } @@ -2346,12 +2324,12 @@ bool ColorControlServer::moveToColorCommand(app::CommandHandler * commandObj, co bool ColorControlServer::moveColorCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::MoveColor::DecodableType & commandData) { - int16_t rateX = commandData.rateX; - int16_t rateY = commandData.rateY; - uint8_t optionsMask = commandData.optionsMask; - uint8_t optionsOverride = commandData.optionsOverride; - EndpointId endpoint = commandPath.mEndpointId; - Status status = Status::Success; + int16_t rateX = commandData.rateX; + int16_t rateY = commandData.rateY; + BitMask optionsMask = commandData.optionsMask; + BitMask optionsOverride = commandData.optionsOverride; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; uint16_t epIndex = getEndpointIndex(endpoint); Color16uTransitionState * colorXTransitionState = getXTransitionStateByIndex(epIndex); @@ -2380,7 +2358,7 @@ bool ColorControlServer::moveColorCommand(app::CommandHandler * commandObj, cons } // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kCurrentXAndCurrentY); + handleModeSwitch(endpoint, EnhancedColorMode::kCurrentXAndCurrentY); // now, kick off the state machine. Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->initialValue)); @@ -2438,16 +2416,16 @@ bool ColorControlServer::moveColorCommand(app::CommandHandler * commandObj, cons bool ColorControlServer::stepColorCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::StepColor::DecodableType & commandData) { - int16_t stepX = commandData.stepX; - int16_t stepY = commandData.stepY; - uint16_t transitionTime = commandData.transitionTime; - uint8_t optionsMask = commandData.optionsMask; - uint8_t optionsOverride = commandData.optionsOverride; - EndpointId endpoint = commandPath.mEndpointId; - uint16_t currentColorX = 0; - uint16_t currentColorY = 0; - uint16_t colorX = 0; - uint16_t colorY = 0; + int16_t stepX = commandData.stepX; + int16_t stepY = commandData.stepY; + uint16_t transitionTime = commandData.transitionTime; + BitMask optionsMask = commandData.optionsMask; + BitMask optionsOverride = commandData.optionsOverride; + EndpointId endpoint = commandPath.mEndpointId; + uint16_t currentColorX = 0; + uint16_t currentColorY = 0; + uint16_t colorX = 0; + uint16_t colorY = 0; Status status = Status::Success; @@ -2480,7 +2458,7 @@ bool ColorControlServer::stepColorCommand(app::CommandHandler * commandObj, cons stopAllColorTransitions(endpoint); // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kCurrentXAndCurrentY); + handleModeSwitch(endpoint, EnhancedColorMode::kCurrentXAndCurrentY); // now, kick off the state machine. colorXTransitionState->initialValue = currentColorX; @@ -2615,7 +2593,7 @@ Status ColorControlServer::moveToColorTemp(EndpointId aEndpoint, uint16_t colorT stopAllColorTransitions(endpoint); // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kColorTemperature); + handleModeSwitch(endpoint, EnhancedColorMode::kColorTemperatureMireds); if (colorTemperature < temperatureMin) { @@ -2724,11 +2702,10 @@ void ColorControlServer::startUpColorTempCommand(EndpointId endpoint) if (status == Status::Success) { // Set ColorMode attributes to reflect ColorTemperature. - uint8_t updateColorMode = ColorControl::EnhancedColorMode::kColorTemperature; + auto updateColorMode = ColorModeEnum::kColorTemperatureMireds; Attributes::ColorMode::Set(endpoint, updateColorMode); - updateColorMode = ColorControl::EnhancedColorMode::kColorTemperature; - Attributes::EnhancedColorMode::Set(endpoint, updateColorMode); + Attributes::EnhancedColorMode::Set(endpoint, static_cast(updateColorMode)); } } } @@ -2798,16 +2775,16 @@ void ColorControlServer::updateTempCommand(EndpointId endpoint) bool ColorControlServer::moveColorTempCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::MoveColorTemperature::DecodableType & commandData) { - auto moveMode = commandData.moveMode; - uint16_t rate = commandData.rate; - uint16_t colorTemperatureMinimum = commandData.colorTemperatureMinimumMireds; - uint16_t colorTemperatureMaximum = commandData.colorTemperatureMaximumMireds; - uint8_t optionsMask = commandData.optionsMask; - uint8_t optionsOverride = commandData.optionsOverride; - EndpointId endpoint = commandPath.mEndpointId; - Status status = Status::Success; - uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE; - uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE; + auto moveMode = commandData.moveMode; + uint16_t rate = commandData.rate; + uint16_t colorTemperatureMinimum = commandData.colorTemperatureMinimumMireds; + uint16_t colorTemperatureMaximum = commandData.colorTemperatureMaximumMireds; + BitMask optionsMask = commandData.optionsMask; + BitMask optionsOverride = commandData.optionsOverride; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE; + uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE; uint16_t transitionTime; Color16uTransitionState * colorTempTransitionState = getTempTransitionState(endpoint); @@ -2854,7 +2831,7 @@ bool ColorControlServer::moveColorTempCommand(app::CommandHandler * commandObj, } // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kColorTemperature); + handleModeSwitch(endpoint, EnhancedColorMode::kColorTemperatureMireds); // now, kick off the state machine. colorTempTransitionState->initialValue = 0; @@ -2922,17 +2899,17 @@ bool ColorControlServer::moveToColorTempCommand(app::CommandHandler * commandObj bool ColorControlServer::stepColorTempCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::StepColorTemperature::DecodableType & commandData) { - auto stepMode = commandData.stepMode; - uint16_t stepSize = commandData.stepSize; - uint16_t transitionTime = commandData.transitionTime; - uint16_t colorTemperatureMinimum = commandData.colorTemperatureMinimumMireds; - uint16_t colorTemperatureMaximum = commandData.colorTemperatureMaximumMireds; - uint8_t optionsMask = commandData.optionsMask; - uint8_t optionsOverride = commandData.optionsOverride; - EndpointId endpoint = commandPath.mEndpointId; - Status status = Status::Success; - uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE; - uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE; + auto stepMode = commandData.stepMode; + uint16_t stepSize = commandData.stepSize; + uint16_t transitionTime = commandData.transitionTime; + uint16_t colorTemperatureMinimum = commandData.colorTemperatureMinimumMireds; + uint16_t colorTemperatureMaximum = commandData.colorTemperatureMaximumMireds; + BitMask optionsMask = commandData.optionsMask; + BitMask optionsOverride = commandData.optionsOverride; + EndpointId endpoint = commandPath.mEndpointId; + Status status = Status::Success; + uint16_t tempPhysicalMin = MIN_TEMPERATURE_VALUE; + uint16_t tempPhysicalMax = MAX_TEMPERATURE_VALUE; Color16uTransitionState * colorTempTransitionState = getTempTransitionState(endpoint); VerifyOrExit(colorTempTransitionState != nullptr, status = Status::UnsupportedEndpoint); @@ -2971,7 +2948,7 @@ bool ColorControlServer::stepColorTempCommand(app::CommandHandler * commandObj, } // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, ColorControl::EnhancedColorMode::kColorTemperature); + handleModeSwitch(endpoint, EnhancedColorMode::kColorTemperatureMireds); // now, kick off the state machine. colorTempTransitionState->initialValue = 0; @@ -3058,10 +3035,10 @@ void ColorControlServer::levelControlColorTempChangeCommand(EndpointId endpoint) return; } - uint8_t colorMode = 0; + auto colorMode = ColorModeEnum::kCurrentHueAndCurrentSaturation; Attributes::ColorMode::Get(endpoint, &colorMode); - if (colorMode == ColorControl::EnhancedColorMode::kColorTemperature) + if (static_cast(colorMode) == EnhancedColorMode::kColorTemperatureMireds) { app::DataModel::Nullable currentLevel; Status status = LevelControl::Attributes::CurrentLevel::Get(endpoint, currentLevel); diff --git a/src/app/clusters/color-control-server/color-control-server.h b/src/app/clusters/color-control-server/color-control-server.h index 4238fed1dd8b2d..1ed9e33c403538 100644 --- a/src/app/clusters/color-control-server/color-control-server.h +++ b/src/app/clusters/color-control-server/color-control-server.h @@ -71,18 +71,10 @@ class ColorControlServer /********************************************************** * Enums *********************************************************/ - using HueStepMode = chip::app::Clusters::ColorControl::HueStepMode; - using HueMoveMode = chip::app::Clusters::ColorControl::HueMoveMode; - using HueDirection = chip::app::Clusters::ColorControl::HueDirection; - using Feature = chip::app::Clusters::ColorControl::Feature; - - enum EnhancedColorMode : uint8_t - { - kCurrentHueAndCurrentSaturation = 0, - kCurrentXAndCurrentY = 1, - kColorTemperature = 2, - kEnhancedCurrentHueAndCurrentSaturation = 3, - }; + using StepModeEnum = chip::app::Clusters::ColorControl::StepModeEnum; + using MoveModeEnum = chip::app::Clusters::ColorControl::MoveModeEnum; + using DirectionEnum = chip::app::Clusters::ColorControl::DirectionEnum; + using Feature = chip::app::Clusters::ColorControl::Feature; enum Conversion { @@ -150,20 +142,27 @@ class ColorControlServer bool HasFeature(chip::EndpointId endpoint, Feature feature); chip::Protocols::InteractionModel::Status stopAllColorTransitions(chip::EndpointId endpoint); bool stopMoveStepCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - uint8_t optionsMask, uint8_t optionsOverride); + chip::BitMask optionsMask, + chip::BitMask optionsOverride); #ifdef MATTER_DM_PLUGIN_COLOR_CONTROL_SERVER_HSV bool moveHueCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - HueMoveMode moveMode, uint16_t rate, uint8_t optionsMask, uint8_t optionsOverride, bool isEnhanced); + MoveModeEnum moveMode, uint16_t rate, + chip::BitMask optionsMask, + chip::BitMask optionsOverride, bool isEnhanced); bool moveToHueCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, uint16_t hue, - HueDirection moveDirection, uint16_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride, - bool isEnhanced); + DirectionEnum moveDirection, uint16_t transitionTime, + chip::BitMask optionsMask, + chip::BitMask optionsOverride, bool isEnhanced); bool moveToHueAndSaturationCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - uint16_t hue, uint8_t saturation, uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride, bool isEnhanced); + uint16_t hue, uint8_t saturation, uint16_t transitionTime, + chip::BitMask optionsMask, + chip::BitMask optionsOverride, + bool isEnhanced); bool stepHueCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - HueStepMode stepMode, uint16_t stepSize, uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride, bool isEnhanced); + StepModeEnum stepMode, uint16_t stepSize, uint16_t transitionTime, + chip::BitMask optionsMask, + chip::BitMask optionsOverride, bool isEnhanced); bool moveSaturationCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ColorControl::Commands::MoveSaturation::DecodableType & commandData); bool moveToSaturationCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, @@ -224,8 +223,9 @@ class ColorControlServer } } - bool shouldExecuteIfOff(chip::EndpointId endpoint, uint8_t optionMask, uint8_t optionOverride); - void handleModeSwitch(chip::EndpointId endpoint, uint8_t newColorMode); + bool shouldExecuteIfOff(chip::EndpointId endpoint, chip::BitMask optionMask, + chip::BitMask optionOverride); + void handleModeSwitch(chip::EndpointId endpoint, chip::app::Clusters::ColorControl::EnhancedColorModeEnum newColorMode); uint16_t computeTransitionTimeFromStateAndRate(Color16uTransitionState * p, uint16_t rate); EmberEventControl * getEventControl(chip::EndpointId endpoint); void computePwmFromHsv(chip::EndpointId endpoint); diff --git a/src/app/common/CompatEnumNames.h b/src/app/common/CompatEnumNames.h index ceb91c1981d203..a3154cbb682975 100644 --- a/src/app/common/CompatEnumNames.h +++ b/src/app/common/CompatEnumNames.h @@ -21,6 +21,8 @@ */ #pragma once +#include + namespace chip { namespace app { namespace Clusters { @@ -80,6 +82,50 @@ using StepMode = StepModeEnum; using LevelControlOptions = OptionsBitmap; } // namespace LevelControl +namespace ColorControl { +// https://github.com/project-chip/connectedhomeip/pull/33612 renamed this +enum class ColorMode : uint8_t +{ + kCurrentHueAndCurrentSaturation = to_underlying(ColorModeEnum::kCurrentHueAndCurrentSaturation), + kCurrentXAndCurrentY = to_underlying(ColorModeEnum::kCurrentXAndCurrentY), + kColorTemperature = to_underlying(ColorModeEnum::kColorTemperatureMireds), + kUnknownEnumValue = to_underlying(ColorModeEnum::kUnknownEnumValue) +}; + +enum class HueDirection : uint8_t +{ + ShortestDistance = to_underlying(DirectionEnum::kShortest), + LongestDistance = to_underlying(DirectionEnum::kLongest), + Up = to_underlying(DirectionEnum::kUp), + Down = to_underlying(DirectionEnum::kDown), + kUnknownEnumValue = to_underlying(DirectionEnum::kUnknownEnumValue) +}; + +enum class ColorCapabilities : uint16_t +{ + ColorLoopSupported = to_underlying(ColorCapabilitiesBitmap::kColorLoop), + ColorTemperatureSupported = to_underlying(ColorCapabilitiesBitmap::kColorTemperature), + EnhancedHueSupported = to_underlying(ColorCapabilitiesBitmap::kEnhancedHue), + HueSaturationSupported = to_underlying(ColorCapabilitiesBitmap::kHueSaturation), + XYAttributesSupported = to_underlying(ColorCapabilitiesBitmap::kXy) +}; + +enum class ColorLoopDirection : uint8_t +{ + DecrementHue = to_underlying(ColorLoopDirectionEnum::kDecrement), + IncrementHue = to_underlying(ColorLoopDirectionEnum::kIncrement), + kUnknownEnumValue = to_underlying(ColorLoopDirectionEnum::kUnknownEnumValue) +}; + +using EnhancedColorMode = EnhancedColorModeEnum; +using ColorLoopUpdateFlags = UpdateFlagsBitmap; +using ColorLoopAction = ColorLoopActionEnum; +using HueMoveMode = MoveModeEnum; +using HueStepMode = StepModeEnum; +using SaturationMoveMode = MoveModeEnum; +using SaturationStepMode = StepModeEnum; +} // namespace ColorControl + namespace RefrigeratorAlarm { // https://github.com/project-chip/connectedhomeip/pull/31517 renamed this using AlarmMap = AlarmBitmap; diff --git a/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml index c97d4a59baa00b..f72140e712a703 100644 --- a/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml @@ -17,57 +17,44 @@ limitations under the License. - + - - + + - + - + - - - - - - - - - - - - - - + - + - + - - - - - + + + + + - + @@ -75,17 +62,39 @@ limitations under the License. - + - + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -128,15 +137,15 @@ limitations under the License. CurrentY - DriftCompensation + DriftCompensation CompensationText ColorTemperatureMireds - ColorMode + ColorMode - Options + Options NumberOfPrimaries @@ -254,31 +263,31 @@ limitations under the License. Move to specified hue. - + - - + + Move hue up or down at specified rate. - + - - + + Step hue up or down by specified size at specified rate. - + - - + + @@ -287,29 +296,29 @@ limitations under the License. - - + + Move saturation up or down at specified rate. - + - - + + Step saturation up or down by specified size at specified rate. - + - - + + @@ -319,8 +328,8 @@ limitations under the License. - - + + @@ -330,8 +339,8 @@ limitations under the License. - - + + @@ -340,8 +349,8 @@ limitations under the License. - - + + @@ -351,8 +360,8 @@ limitations under the License. - - + + @@ -361,20 +370,20 @@ limitations under the License. - - + + EnhancedCurrentHue - EnhancedColorMode - ColorLoopActive - ColorLoopDirection + EnhancedColorMode + ColorLoopActive + ColorLoopDirection ColorLoopTime ColorLoopStartEnhancedHue ColorLoopStoredEnhancedHue - ColorCapabilities + ColorCapabilities ColorTempPhysicalMinMireds ColorTempPhysicalMaxMireds @@ -383,31 +392,31 @@ limitations under the License. Command description for EnhancedMoveToHue - + - - + + Command description for EnhancedMoveHue - + - - + + Command description for EnhancedStepHue - + - - + + @@ -417,54 +426,54 @@ limitations under the License. - - + + Command description for ColorLoopSet - - - + + + - - + + Command description for StopMoveStep - - + + Command description for MoveColorTemperature - + - - + + Command description for StepColorTemperature - + - - + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 02408e1ecf74b0..bfb1354849c9c4 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -7145,65 +7145,62 @@ cluster ThermostatUserInterfaceConfiguration = 516 { cluster ColorControl = 768 { revision 7; - enum ColorLoopAction : enum8 { + enum ColorLoopActionEnum : enum8 { kDeactivate = 0; kActivateFromColorLoopStartEnhancedHue = 1; kActivateFromEnhancedCurrentHue = 2; } - enum ColorLoopDirection : enum8 { - kDecrementHue = 0; - kIncrementHue = 1; + enum ColorLoopDirectionEnum : enum8 { + kDecrement = 0; + kIncrement = 1; } - enum ColorMode : enum8 { + enum ColorModeEnum : enum8 { kCurrentHueAndCurrentSaturation = 0; kCurrentXAndCurrentY = 1; - kColorTemperature = 2; + kColorTemperatureMireds = 2; } - enum HueDirection : enum8 { - kShortestDistance = 0; - kLongestDistance = 1; + enum DirectionEnum : enum8 { + kShortest = 0; + kLongest = 1; kUp = 2; kDown = 3; } - enum HueMoveMode : enum8 { - kStop = 0; - kUp = 1; - kDown = 3; + enum DriftCompensationEnum : enum8 { + kNone = 0; + kOtherOrUnknown = 1; + kTemperatureMonitoring = 2; + kOpticalLuminanceMonitoringAndFeedback = 3; + kOpticalColorMonitoringAndFeedback = 4; } - enum HueStepMode : enum8 { - kUp = 1; - kDown = 3; + enum EnhancedColorModeEnum : enum8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperatureMireds = 2; + kEnhancedCurrentHueAndCurrentSaturation = 3; } - enum SaturationMoveMode : enum8 { + enum MoveModeEnum : enum8 { kStop = 0; kUp = 1; kDown = 3; } - enum SaturationStepMode : enum8 { + enum StepModeEnum : enum8 { kUp = 1; kDown = 3; } - bitmap ColorCapabilities : bitmap16 { - kHueSaturationSupported = 0x1; - kEnhancedHueSupported = 0x2; - kColorLoopSupported = 0x4; - kXYAttributesSupported = 0x8; - kColorTemperatureSupported = 0x10; - } - - bitmap ColorLoopUpdateFlags : bitmap8 { - kUpdateAction = 0x1; - kUpdateDirection = 0x2; - kUpdateTime = 0x4; - kUpdateStartHue = 0x8; + bitmap ColorCapabilitiesBitmap : bitmap16 { + kHueSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; } bitmap Feature : bitmap32 { @@ -7214,16 +7211,27 @@ cluster ColorControl = 768 { kColorTemperature = 0x10; } + bitmap OptionsBitmap : bitmap8 { + kExecuteIfOff = 0x1; + } + + bitmap UpdateFlagsBitmap : bitmap8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + readonly attribute optional int8u currentHue = 0; readonly attribute optional int8u currentSaturation = 1; readonly attribute optional int16u remainingTime = 2; readonly attribute optional int16u currentX = 3; readonly attribute optional int16u currentY = 4; - readonly attribute optional enum8 driftCompensation = 5; + readonly attribute optional DriftCompensationEnum driftCompensation = 5; readonly attribute optional char_string<254> compensationText = 6; readonly attribute optional int16u colorTemperatureMireds = 7; - readonly attribute enum8 colorMode = 8; - attribute bitmap8 options = 15; + readonly attribute ColorModeEnum colorMode = 8; + attribute OptionsBitmap options = 15; readonly attribute nullable int8u numberOfPrimaries = 16; readonly attribute optional int16u primary1X = 17; readonly attribute optional int16u primary1Y = 18; @@ -7255,13 +7263,13 @@ cluster ColorControl = 768 { attribute access(write: manage) optional int16u colorPointBY = 59; attribute access(write: manage) optional nullable int8u colorPointBIntensity = 60; readonly attribute optional int16u enhancedCurrentHue = 16384; - readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute EnhancedColorModeEnum enhancedColorMode = 16385; readonly attribute optional int8u colorLoopActive = 16386; readonly attribute optional int8u colorLoopDirection = 16387; readonly attribute optional int16u colorLoopTime = 16388; readonly attribute optional int16u colorLoopStartEnhancedHue = 16389; readonly attribute optional int16u colorLoopStoredEnhancedHue = 16390; - readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute ColorCapabilitiesBitmap colorCapabilities = 16394; readonly attribute optional int16u colorTempPhysicalMinMireds = 16395; readonly attribute optional int16u colorTempPhysicalMaxMireds = 16396; readonly attribute optional int16u coupleColorTempToLevelMinMireds = 16397; @@ -7275,150 +7283,150 @@ cluster ColorControl = 768 { request struct MoveToHueRequest { int8u hue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToSaturationRequest { int8u saturation = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct MoveSaturationRequest { - SaturationMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int8u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepSaturationRequest { - SaturationStepMode stepMode = 0; + StepModeEnum stepMode = 0; int8u stepSize = 1; int8u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToHueAndSaturationRequest { int8u hue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorRequest { int16u colorX = 0; int16u colorY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveColorRequest { int16s rateX = 0; int16s rateY = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct StepColorRequest { int16s stepX = 0; int16s stepY = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct MoveToColorTemperatureRequest { int16u colorTemperatureMireds = 0; int16u transitionTime = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedMoveToHueRequest { int16u enhancedHue = 0; - HueDirection direction = 1; + DirectionEnum direction = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveHueRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; - bitmap8 optionsMask = 2; - bitmap8 optionsOverride = 3; + OptionsBitmap optionsMask = 2; + OptionsBitmap optionsOverride = 3; } request struct EnhancedStepHueRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct EnhancedMoveToHueAndSaturationRequest { int16u enhancedHue = 0; int8u saturation = 1; int16u transitionTime = 2; - bitmap8 optionsMask = 3; - bitmap8 optionsOverride = 4; + OptionsBitmap optionsMask = 3; + OptionsBitmap optionsOverride = 4; } request struct ColorLoopSetRequest { - ColorLoopUpdateFlags updateFlags = 0; - ColorLoopAction action = 1; - ColorLoopDirection direction = 2; + UpdateFlagsBitmap updateFlags = 0; + ColorLoopActionEnum action = 1; + ColorLoopDirectionEnum direction = 2; int16u time = 3; int16u startHue = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } request struct StopMoveStepRequest { - bitmap8 optionsMask = 0; - bitmap8 optionsOverride = 1; + OptionsBitmap optionsMask = 0; + OptionsBitmap optionsOverride = 1; } request struct MoveColorTemperatureRequest { - HueMoveMode moveMode = 0; + MoveModeEnum moveMode = 0; int16u rate = 1; int16u colorTemperatureMinimumMireds = 2; int16u colorTemperatureMaximumMireds = 3; - bitmap8 optionsMask = 4; - bitmap8 optionsOverride = 5; + OptionsBitmap optionsMask = 4; + OptionsBitmap optionsOverride = 5; } request struct StepColorTemperatureRequest { - HueStepMode stepMode = 0; + StepModeEnum stepMode = 0; int16u stepSize = 1; int16u transitionTime = 2; int16u colorTemperatureMinimumMireds = 3; int16u colorTemperatureMaximumMireds = 4; - bitmap8 optionsMask = 5; - bitmap8 optionsOverride = 6; + OptionsBitmap optionsMask = 5; + OptionsBitmap optionsOverride = 6; } /** Move to specified hue. */ diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 82a4a6fe42e669..db775e5d52e5c6 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -32152,7 +32152,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value; std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); + jint jnivalue = static_cast(cppValue.Raw()); chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, value); return value; @@ -32830,7 +32830,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value; std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); + jint jnivalue = static_cast(cppValue.Raw()); chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, value); return value; diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index ed3c9154cc8c3a..6b8ecd1c82b577 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -34913,10 +34913,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="remainingTime", Tag=0x00000002, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="currentX", Tag=0x00000003, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="currentY", Tag=0x00000004, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="driftCompensation", Tag=0x00000005, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="driftCompensation", Tag=0x00000005, Type=typing.Optional[ColorControl.Enums.DriftCompensationEnum]), ClusterObjectFieldDescriptor(Label="compensationText", Tag=0x00000006, Type=typing.Optional[str]), ClusterObjectFieldDescriptor(Label="colorTemperatureMireds", Tag=0x00000007, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="colorMode", Tag=0x00000008, Type=uint), + ClusterObjectFieldDescriptor(Label="colorMode", Tag=0x00000008, Type=ColorControl.Enums.ColorModeEnum), ClusterObjectFieldDescriptor(Label="options", Tag=0x0000000F, Type=uint), ClusterObjectFieldDescriptor(Label="numberOfPrimaries", Tag=0x00000010, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="primary1X", Tag=0x00000011, Type=typing.Optional[uint]), @@ -34949,7 +34949,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="colorPointBY", Tag=0x0000003B, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="colorPointBIntensity", Tag=0x0000003C, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="enhancedCurrentHue", Tag=0x00004000, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="enhancedColorMode", Tag=0x00004001, Type=uint), + ClusterObjectFieldDescriptor(Label="enhancedColorMode", Tag=0x00004001, Type=ColorControl.Enums.EnhancedColorModeEnum), ClusterObjectFieldDescriptor(Label="colorLoopActive", Tag=0x00004002, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="colorLoopDirection", Tag=0x00004003, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="colorLoopTime", Tag=0x00004004, Type=typing.Optional[uint]), @@ -34973,10 +34973,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: remainingTime: 'typing.Optional[uint]' = None currentX: 'typing.Optional[uint]' = None currentY: 'typing.Optional[uint]' = None - driftCompensation: 'typing.Optional[uint]' = None + driftCompensation: 'typing.Optional[ColorControl.Enums.DriftCompensationEnum]' = None compensationText: 'typing.Optional[str]' = None colorTemperatureMireds: 'typing.Optional[uint]' = None - colorMode: 'uint' = None + colorMode: 'ColorControl.Enums.ColorModeEnum' = None options: 'uint' = None numberOfPrimaries: 'typing.Union[Nullable, uint]' = None primary1X: 'typing.Optional[uint]' = None @@ -35009,7 +35009,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: colorPointBY: 'typing.Optional[uint]' = None colorPointBIntensity: 'typing.Union[None, Nullable, uint]' = None enhancedCurrentHue: 'typing.Optional[uint]' = None - enhancedColorMode: 'uint' = None + enhancedColorMode: 'ColorControl.Enums.EnhancedColorModeEnum' = None colorLoopActive: 'typing.Optional[uint]' = None colorLoopDirection: 'typing.Optional[uint]' = None colorLoopTime: 'typing.Optional[uint]' = None @@ -35028,7 +35028,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: - class ColorLoopAction(MatterIntEnum): + class ColorLoopActionEnum(MatterIntEnum): kDeactivate = 0x00 kActivateFromColorLoopStartEnhancedHue = 0x01 kActivateFromEnhancedCurrentHue = 0x02 @@ -35038,28 +35038,28 @@ class ColorLoopAction(MatterIntEnum): # enum value. This specific value should never be transmitted. kUnknownEnumValue = 3, - class ColorLoopDirection(MatterIntEnum): - kDecrementHue = 0x00 - kIncrementHue = 0x01 + class ColorLoopDirectionEnum(MatterIntEnum): + kDecrement = 0x00 + kIncrement = 0x01 # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. kUnknownEnumValue = 2, - class ColorMode(MatterIntEnum): + class ColorModeEnum(MatterIntEnum): kCurrentHueAndCurrentSaturation = 0x00 kCurrentXAndCurrentY = 0x01 - kColorTemperature = 0x02 + kColorTemperatureMireds = 0x02 # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. kUnknownEnumValue = 3, - class HueDirection(MatterIntEnum): - kShortestDistance = 0x00 - kLongestDistance = 0x01 + class DirectionEnum(MatterIntEnum): + kShortest = 0x00 + kLongest = 0x01 kUp = 0x02 kDown = 0x03 # All received enum values that are not listed above will be mapped @@ -35068,26 +35068,30 @@ class HueDirection(MatterIntEnum): # enum value. This specific value should never be transmitted. kUnknownEnumValue = 4, - class HueMoveMode(MatterIntEnum): - kStop = 0x00 - kUp = 0x01 - kDown = 0x03 + class DriftCompensationEnum(MatterIntEnum): + kNone = 0x00 + kOtherOrUnknown = 0x01 + kTemperatureMonitoring = 0x02 + kOpticalLuminanceMonitoringAndFeedback = 0x03 + kOpticalColorMonitoringAndFeedback = 0x04 # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 5, - class HueStepMode(MatterIntEnum): - kUp = 0x01 - kDown = 0x03 + class EnhancedColorModeEnum(MatterIntEnum): + kCurrentHueAndCurrentSaturation = 0x00 + kCurrentXAndCurrentY = 0x01 + kColorTemperatureMireds = 0x02 + kEnhancedCurrentHueAndCurrentSaturation = 0x03 # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 0, + kUnknownEnumValue = 4, - class SaturationMoveMode(MatterIntEnum): + class MoveModeEnum(MatterIntEnum): kStop = 0x00 kUp = 0x01 kDown = 0x03 @@ -35097,7 +35101,7 @@ class SaturationMoveMode(MatterIntEnum): # enum value. This specific value should never be transmitted. kUnknownEnumValue = 2, - class SaturationStepMode(MatterIntEnum): + class StepModeEnum(MatterIntEnum): kUp = 0x01 kDown = 0x03 # All received enum values that are not listed above will be mapped @@ -35107,18 +35111,12 @@ class SaturationStepMode(MatterIntEnum): kUnknownEnumValue = 0, class Bitmaps: - class ColorCapabilities(IntFlag): - kHueSaturationSupported = 0x1 - kEnhancedHueSupported = 0x2 - kColorLoopSupported = 0x4 - kXYAttributesSupported = 0x8 - kColorTemperatureSupported = 0x10 - - class ColorLoopUpdateFlags(IntFlag): - kUpdateAction = 0x1 - kUpdateDirection = 0x2 - kUpdateTime = 0x4 - kUpdateStartHue = 0x8 + class ColorCapabilitiesBitmap(IntFlag): + kHueSaturation = 0x1 + kEnhancedHue = 0x2 + kColorLoop = 0x4 + kXy = 0x8 + kColorTemperature = 0x10 class Feature(IntFlag): kHueAndSaturation = 0x1 @@ -35127,6 +35125,15 @@ class Feature(IntFlag): kXy = 0x8 kColorTemperature = 0x10 + class OptionsBitmap(IntFlag): + kExecuteIfOff = 0x1 + + class UpdateFlagsBitmap(IntFlag): + kUpdateAction = 0x1 + kUpdateDirection = 0x2 + kUpdateTime = 0x4 + kUpdateStartHue = 0x8 + class Commands: @dataclass class MoveToHue(ClusterCommand): @@ -35140,14 +35147,14 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor(Label="hue", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="direction", Tag=1, Type=ColorControl.Enums.HueDirection), + ClusterObjectFieldDescriptor(Label="direction", Tag=1, Type=ColorControl.Enums.DirectionEnum), ClusterObjectFieldDescriptor(Label="transitionTime", Tag=2, Type=uint), ClusterObjectFieldDescriptor(Label="optionsMask", Tag=3, Type=uint), ClusterObjectFieldDescriptor(Label="optionsOverride", Tag=4, Type=uint), ]) hue: 'uint' = 0 - direction: 'ColorControl.Enums.HueDirection' = 0 + direction: 'ColorControl.Enums.DirectionEnum' = 0 transitionTime: 'uint' = 0 optionsMask: 'uint' = 0 optionsOverride: 'uint' = 0 @@ -35163,13 +35170,13 @@ class MoveHue(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="moveMode", Tag=0, Type=ColorControl.Enums.HueMoveMode), + ClusterObjectFieldDescriptor(Label="moveMode", Tag=0, Type=ColorControl.Enums.MoveModeEnum), ClusterObjectFieldDescriptor(Label="rate", Tag=1, Type=uint), ClusterObjectFieldDescriptor(Label="optionsMask", Tag=2, Type=uint), ClusterObjectFieldDescriptor(Label="optionsOverride", Tag=3, Type=uint), ]) - moveMode: 'ColorControl.Enums.HueMoveMode' = 0 + moveMode: 'ColorControl.Enums.MoveModeEnum' = 0 rate: 'uint' = 0 optionsMask: 'uint' = 0 optionsOverride: 'uint' = 0 @@ -35185,14 +35192,14 @@ class StepHue(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="stepMode", Tag=0, Type=ColorControl.Enums.HueStepMode), + ClusterObjectFieldDescriptor(Label="stepMode", Tag=0, Type=ColorControl.Enums.StepModeEnum), ClusterObjectFieldDescriptor(Label="stepSize", Tag=1, Type=uint), ClusterObjectFieldDescriptor(Label="transitionTime", Tag=2, Type=uint), ClusterObjectFieldDescriptor(Label="optionsMask", Tag=3, Type=uint), ClusterObjectFieldDescriptor(Label="optionsOverride", Tag=4, Type=uint), ]) - stepMode: 'ColorControl.Enums.HueStepMode' = 0 + stepMode: 'ColorControl.Enums.StepModeEnum' = 0 stepSize: 'uint' = 0 transitionTime: 'uint' = 0 optionsMask: 'uint' = 0 @@ -35231,13 +35238,13 @@ class MoveSaturation(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="moveMode", Tag=0, Type=ColorControl.Enums.SaturationMoveMode), + ClusterObjectFieldDescriptor(Label="moveMode", Tag=0, Type=ColorControl.Enums.MoveModeEnum), ClusterObjectFieldDescriptor(Label="rate", Tag=1, Type=uint), ClusterObjectFieldDescriptor(Label="optionsMask", Tag=2, Type=uint), ClusterObjectFieldDescriptor(Label="optionsOverride", Tag=3, Type=uint), ]) - moveMode: 'ColorControl.Enums.SaturationMoveMode' = 0 + moveMode: 'ColorControl.Enums.MoveModeEnum' = 0 rate: 'uint' = 0 optionsMask: 'uint' = 0 optionsOverride: 'uint' = 0 @@ -35253,14 +35260,14 @@ class StepSaturation(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="stepMode", Tag=0, Type=ColorControl.Enums.SaturationStepMode), + ClusterObjectFieldDescriptor(Label="stepMode", Tag=0, Type=ColorControl.Enums.StepModeEnum), ClusterObjectFieldDescriptor(Label="stepSize", Tag=1, Type=uint), ClusterObjectFieldDescriptor(Label="transitionTime", Tag=2, Type=uint), ClusterObjectFieldDescriptor(Label="optionsMask", Tag=3, Type=uint), ClusterObjectFieldDescriptor(Label="optionsOverride", Tag=4, Type=uint), ]) - stepMode: 'ColorControl.Enums.SaturationStepMode' = 0 + stepMode: 'ColorControl.Enums.StepModeEnum' = 0 stepSize: 'uint' = 0 transitionTime: 'uint' = 0 optionsMask: 'uint' = 0 @@ -35394,14 +35401,14 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor(Label="enhancedHue", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="direction", Tag=1, Type=ColorControl.Enums.HueDirection), + ClusterObjectFieldDescriptor(Label="direction", Tag=1, Type=ColorControl.Enums.DirectionEnum), ClusterObjectFieldDescriptor(Label="transitionTime", Tag=2, Type=uint), ClusterObjectFieldDescriptor(Label="optionsMask", Tag=3, Type=uint), ClusterObjectFieldDescriptor(Label="optionsOverride", Tag=4, Type=uint), ]) enhancedHue: 'uint' = 0 - direction: 'ColorControl.Enums.HueDirection' = 0 + direction: 'ColorControl.Enums.DirectionEnum' = 0 transitionTime: 'uint' = 0 optionsMask: 'uint' = 0 optionsOverride: 'uint' = 0 @@ -35417,13 +35424,13 @@ class EnhancedMoveHue(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="moveMode", Tag=0, Type=ColorControl.Enums.HueMoveMode), + ClusterObjectFieldDescriptor(Label="moveMode", Tag=0, Type=ColorControl.Enums.MoveModeEnum), ClusterObjectFieldDescriptor(Label="rate", Tag=1, Type=uint), ClusterObjectFieldDescriptor(Label="optionsMask", Tag=2, Type=uint), ClusterObjectFieldDescriptor(Label="optionsOverride", Tag=3, Type=uint), ]) - moveMode: 'ColorControl.Enums.HueMoveMode' = 0 + moveMode: 'ColorControl.Enums.MoveModeEnum' = 0 rate: 'uint' = 0 optionsMask: 'uint' = 0 optionsOverride: 'uint' = 0 @@ -35439,14 +35446,14 @@ class EnhancedStepHue(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="stepMode", Tag=0, Type=ColorControl.Enums.HueStepMode), + ClusterObjectFieldDescriptor(Label="stepMode", Tag=0, Type=ColorControl.Enums.StepModeEnum), ClusterObjectFieldDescriptor(Label="stepSize", Tag=1, Type=uint), ClusterObjectFieldDescriptor(Label="transitionTime", Tag=2, Type=uint), ClusterObjectFieldDescriptor(Label="optionsMask", Tag=3, Type=uint), ClusterObjectFieldDescriptor(Label="optionsOverride", Tag=4, Type=uint), ]) - stepMode: 'ColorControl.Enums.HueStepMode' = 0 + stepMode: 'ColorControl.Enums.StepModeEnum' = 0 stepSize: 'uint' = 0 transitionTime: 'uint' = 0 optionsMask: 'uint' = 0 @@ -35488,8 +35495,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor(Label="updateFlags", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="action", Tag=1, Type=ColorControl.Enums.ColorLoopAction), - ClusterObjectFieldDescriptor(Label="direction", Tag=2, Type=ColorControl.Enums.ColorLoopDirection), + ClusterObjectFieldDescriptor(Label="action", Tag=1, Type=ColorControl.Enums.ColorLoopActionEnum), + ClusterObjectFieldDescriptor(Label="direction", Tag=2, Type=ColorControl.Enums.ColorLoopDirectionEnum), ClusterObjectFieldDescriptor(Label="time", Tag=3, Type=uint), ClusterObjectFieldDescriptor(Label="startHue", Tag=4, Type=uint), ClusterObjectFieldDescriptor(Label="optionsMask", Tag=5, Type=uint), @@ -35497,8 +35504,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: ]) updateFlags: 'uint' = 0 - action: 'ColorControl.Enums.ColorLoopAction' = 0 - direction: 'ColorControl.Enums.ColorLoopDirection' = 0 + action: 'ColorControl.Enums.ColorLoopActionEnum' = 0 + direction: 'ColorControl.Enums.ColorLoopDirectionEnum' = 0 time: 'uint' = 0 startHue: 'uint' = 0 optionsMask: 'uint' = 0 @@ -35533,7 +35540,7 @@ class MoveColorTemperature(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="moveMode", Tag=0, Type=ColorControl.Enums.HueMoveMode), + ClusterObjectFieldDescriptor(Label="moveMode", Tag=0, Type=ColorControl.Enums.MoveModeEnum), ClusterObjectFieldDescriptor(Label="rate", Tag=1, Type=uint), ClusterObjectFieldDescriptor(Label="colorTemperatureMinimumMireds", Tag=2, Type=uint), ClusterObjectFieldDescriptor(Label="colorTemperatureMaximumMireds", Tag=3, Type=uint), @@ -35541,7 +35548,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="optionsOverride", Tag=5, Type=uint), ]) - moveMode: 'ColorControl.Enums.HueMoveMode' = 0 + moveMode: 'ColorControl.Enums.MoveModeEnum' = 0 rate: 'uint' = 0 colorTemperatureMinimumMireds: 'uint' = 0 colorTemperatureMaximumMireds: 'uint' = 0 @@ -35559,7 +35566,7 @@ class StepColorTemperature(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="stepMode", Tag=0, Type=ColorControl.Enums.HueStepMode), + ClusterObjectFieldDescriptor(Label="stepMode", Tag=0, Type=ColorControl.Enums.StepModeEnum), ClusterObjectFieldDescriptor(Label="stepSize", Tag=1, Type=uint), ClusterObjectFieldDescriptor(Label="transitionTime", Tag=2, Type=uint), ClusterObjectFieldDescriptor(Label="colorTemperatureMinimumMireds", Tag=3, Type=uint), @@ -35568,7 +35575,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="optionsOverride", Tag=6, Type=uint), ]) - stepMode: 'ColorControl.Enums.HueStepMode' = 0 + stepMode: 'ColorControl.Enums.StepModeEnum' = 0 stepSize: 'uint' = 0 transitionTime: 'uint' = 0 colorTemperatureMinimumMireds: 'uint' = 0 @@ -35669,9 +35676,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=typing.Optional[ColorControl.Enums.DriftCompensationEnum]) - value: 'typing.Optional[uint]' = None + value: 'typing.Optional[ColorControl.Enums.DriftCompensationEnum]' = None @dataclass class CompensationText(ClusterAttributeDescriptor): @@ -35717,9 +35724,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=ColorControl.Enums.ColorModeEnum) - value: 'uint' = 0 + value: 'ColorControl.Enums.ColorModeEnum' = 0 @dataclass class Options(ClusterAttributeDescriptor): @@ -36245,9 +36252,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=ColorControl.Enums.EnhancedColorModeEnum) - value: 'uint' = 0 + value: 'ColorControl.Enums.EnhancedColorModeEnum' = 0 @dataclass class ColorLoopActive(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index f899dba1fafe44..472a630d93df68 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -12882,7 +12882,7 @@ static id _Nullable DecodeAttributeValueForColorControlCluster(AttributeId aAttr return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } case Attributes::CompensationText::Id: { @@ -12920,7 +12920,7 @@ static id _Nullable DecodeAttributeValueForColorControlCluster(AttributeId aAttr return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } case Attributes::Options::Id: { @@ -12931,7 +12931,7 @@ static id _Nullable DecodeAttributeValueForColorControlCluster(AttributeId aAttr return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } case Attributes::NumberOfPrimaries::Id: { @@ -13323,7 +13323,7 @@ static id _Nullable DecodeAttributeValueForColorControlCluster(AttributeId aAttr return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } case Attributes::ColorLoopActive::Id: { @@ -13389,7 +13389,7 @@ static id _Nullable DecodeAttributeValueForColorControlCluster(AttributeId aAttr return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; return value; } case Attributes::ColorTempPhysicalMinMireds::Id: { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index fab6862dd96a67..efb5fca9547fab 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -20203,65 +20203,62 @@ typedef NS_ENUM(uint8_t, MTRThermostatUserInterfaceConfigurationTemperatureDispl } MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4)); typedef NS_ENUM(uint8_t, MTRColorControlColorLoopAction) { - MTRColorControlColorLoopActionDeactivate MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, - MTRColorControlColorLoopActionActivateFromColorLoopStartEnhancedHue MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, - MTRColorControlColorLoopActionActivateFromEnhancedCurrentHue MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x02, -} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); + MTRColorControlColorLoopActionDeactivate MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRColorControlColorLoopActionActivateFromColorLoopStartEnhancedHue MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRColorControlColorLoopActionActivateFromEnhancedCurrentHue MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRColorControlColorLoopDirection) { - MTRColorControlColorLoopDirectionDecrementHue MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, - MTRColorControlColorLoopDirectionIncrementHue MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, -} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); + MTRColorControlColorLoopDirectionDecrement MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRColorControlColorLoopDirectionIncrement MTR_PROVISIONALLY_AVAILABLE = 0x01, +} MTR_PROVISIONALLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRColorControlColorMode) { - MTRColorControlColorModeCurrentHueAndCurrentSaturation MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, - MTRColorControlColorModeCurrentXAndCurrentY MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, - MTRColorControlColorModeColorTemperature MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x02, -} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); - -typedef NS_ENUM(uint8_t, MTRColorControlHueDirection) { - MTRColorControlHueDirectionShortestDistance MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, - MTRColorControlHueDirectionLongestDistance MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, - MTRColorControlHueDirectionUp MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x02, - MTRColorControlHueDirectionDown MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x03, -} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); + MTRColorControlColorModeCurrentHueAndCurrentSaturation MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRColorControlColorModeCurrentXAndCurrentY MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRColorControlColorModeColorTemperatureMireds MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; -typedef NS_ENUM(uint8_t, MTRColorControlHueMoveMode) { - MTRColorControlHueMoveModeStop MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, - MTRColorControlHueMoveModeUp MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, - MTRColorControlHueMoveModeDown MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x03, -} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_ENUM(uint8_t, MTRColorControlDirection) { + MTRColorControlDirectionShortest MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRColorControlDirectionLongest MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRColorControlDirectionUp MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRColorControlDirectionDown MTR_PROVISIONALLY_AVAILABLE = 0x03, +} MTR_PROVISIONALLY_AVAILABLE; -typedef NS_ENUM(uint8_t, MTRColorControlHueStepMode) { - MTRColorControlHueStepModeUp MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, - MTRColorControlHueStepModeDown MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x03, -} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_ENUM(uint8_t, MTRColorControlDriftCompensation) { + MTRColorControlDriftCompensationNone MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRColorControlDriftCompensationOtherOrUnknown MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRColorControlDriftCompensationTemperatureMonitoring MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRColorControlDriftCompensationOpticalLuminanceMonitoringAndFeedback MTR_PROVISIONALLY_AVAILABLE = 0x03, + MTRColorControlDriftCompensationOpticalColorMonitoringAndFeedback MTR_PROVISIONALLY_AVAILABLE = 0x04, +} MTR_PROVISIONALLY_AVAILABLE; -typedef NS_ENUM(uint8_t, MTRColorControlSaturationMoveMode) { - MTRColorControlSaturationMoveModeStop MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, - MTRColorControlSaturationMoveModeUp MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, - MTRColorControlSaturationMoveModeDown MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x03, -} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_ENUM(uint8_t, MTRColorControlEnhancedColorMode) { + MTRColorControlEnhancedColorModeCurrentHueAndCurrentSaturation MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRColorControlEnhancedColorModeCurrentXAndCurrentY MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRColorControlEnhancedColorModeColorTemperatureMireds MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRColorControlEnhancedColorModeEnhancedCurrentHueAndCurrentSaturation MTR_PROVISIONALLY_AVAILABLE = 0x03, +} MTR_PROVISIONALLY_AVAILABLE; -typedef NS_ENUM(uint8_t, MTRColorControlSaturationStepMode) { - MTRColorControlSaturationStepModeUp MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, - MTRColorControlSaturationStepModeDown MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x03, -} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_ENUM(uint8_t, MTRColorControlMoveMode) { + MTRColorControlMoveModeStop MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRColorControlMoveModeUp MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRColorControlMoveModeDown MTR_PROVISIONALLY_AVAILABLE = 0x03, +} MTR_PROVISIONALLY_AVAILABLE; -typedef NS_OPTIONS(uint16_t, MTRColorControlColorCapabilities) { - MTRColorControlColorCapabilitiesHueSaturationSupported MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, - MTRColorControlColorCapabilitiesEnhancedHueSupported MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x2, - MTRColorControlColorCapabilitiesColorLoopSupported MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x4, - MTRColorControlColorCapabilitiesXYAttributesSupported MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x8, - MTRColorControlColorCapabilitiesColorTemperatureSupported MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x10, -} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_ENUM(uint8_t, MTRColorControlStepMode) { + MTRColorControlStepModeUp MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRColorControlStepModeDown MTR_PROVISIONALLY_AVAILABLE = 0x03, +} MTR_PROVISIONALLY_AVAILABLE; -typedef NS_OPTIONS(uint8_t, MTRColorControlColorLoopUpdateFlags) { - MTRColorControlColorLoopUpdateFlagsUpdateAction MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, - MTRColorControlColorLoopUpdateFlagsUpdateDirection MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x2, - MTRColorControlColorLoopUpdateFlagsUpdateTime MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x4, - MTRColorControlColorLoopUpdateFlagsUpdateStartHue MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x8, -} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_OPTIONS(uint16_t, MTRColorControlColorCapabilitiesBitmap) { + MTRColorControlColorCapabilitiesBitmapHueSaturation MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRColorControlColorCapabilitiesBitmapEnhancedHue MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRColorControlColorCapabilitiesBitmapColorLoop MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTRColorControlColorCapabilitiesBitmapXY MTR_PROVISIONALLY_AVAILABLE = 0x8, + MTRColorControlColorCapabilitiesBitmapColorTemperature MTR_PROVISIONALLY_AVAILABLE = 0x10, +} MTR_PROVISIONALLY_AVAILABLE; typedef NS_OPTIONS(uint32_t, MTRColorControlFeature) { MTRColorControlFeatureHueAndSaturation MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, @@ -20271,6 +20268,17 @@ typedef NS_OPTIONS(uint32_t, MTRColorControlFeature) { MTRColorControlFeatureColorTemperature MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x10, } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_OPTIONS(uint8_t, MTRColorControlOptionsBitmap) { + MTRColorControlOptionsBitmapExecuteIfOff MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint8_t, MTRColorControlUpdateFlagsBitmap) { + MTRColorControlUpdateFlagsBitmapUpdateAction MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRColorControlUpdateFlagsBitmapUpdateDirection MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRColorControlUpdateFlagsBitmapUpdateTime MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTRColorControlUpdateFlagsBitmapUpdateStartHue MTR_PROVISIONALLY_AVAILABLE = 0x8, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_OPTIONS(uint8_t, MTRBallastConfigurationBallastStatusBitmap) { MTRBallastConfigurationBallastStatusBitmapBallastNonOperational MTR_PROVISIONALLY_AVAILABLE = 0x1, MTRBallastConfigurationBallastStatusBitmapLampFailure MTR_PROVISIONALLY_AVAILABLE = 0x2, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 756425bba1b764..2c81423cfbb46a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -76739,7 +76739,7 @@ - (void)writeAttributeOptionsWithValue:(NSNumber * _Nonnull)value params:(MTRWri ListFreer listFreer; using TypeInfo = ColorControl::Attributes::Options::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 976d5a0ef241be..1334d8beba2654 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -23153,10 +23153,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.transitionTime = self.transitionTime.unsignedShortValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -23250,10 +23250,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.rate = self.rate.unsignedCharValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -23353,10 +23353,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.transitionTime = self.transitionTime.unsignedCharValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -23450,10 +23450,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.transitionTime = self.transitionTime.unsignedShortValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -23547,10 +23547,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.rate = self.rate.unsignedCharValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -23650,10 +23650,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.transitionTime = self.transitionTime.unsignedCharValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -23753,10 +23753,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.transitionTime = self.transitionTime.unsignedShortValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -23856,10 +23856,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.transitionTime = self.transitionTime.unsignedShortValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -23953,10 +23953,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.rateY = self.rateY.shortValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -24056,10 +24056,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.transitionTime = self.transitionTime.unsignedShortValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -24153,10 +24153,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.transitionTime = self.transitionTime.unsignedShortValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -24268,10 +24268,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.transitionTime = self.transitionTime.unsignedShortValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -24365,10 +24365,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.rate = self.rate.unsignedShortValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -24468,10 +24468,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.transitionTime = self.transitionTime.unsignedShortValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -24571,10 +24571,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.transitionTime = self.transitionTime.unsignedShortValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -24686,10 +24686,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.startHue = self.startHue.unsignedShortValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -24771,10 +24771,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type encodableStruct; ListFreer listFreer; { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -24880,10 +24880,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.colorTemperatureMaximumMireds = self.colorTemperatureMaximumMireds.unsignedShortValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -24995,10 +24995,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.colorTemperatureMaximumMireds = self.colorTemperatureMaximumMireds.unsignedShortValue; } { - encodableStruct.optionsMask = self.optionsMask.unsignedCharValue; + encodableStruct.optionsMask = static_cast>(self.optionsMask.unsignedCharValue); } { - encodableStruct.optionsOverride = self.optionsOverride.unsignedCharValue; + encodableStruct.optionsOverride = static_cast>(self.optionsOverride.unsignedCharValue); } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); diff --git a/src/python_testing/TC_CC_2_2.py b/src/python_testing/TC_CC_2_2.py index 4f6a21b1ba2771..86080efd358456 100644 --- a/src/python_testing/TC_CC_2_2.py +++ b/src/python_testing/TC_CC_2_2.py @@ -137,14 +137,14 @@ async def test_TC_CC_2_2(self): self.step(6) if supports_hs: - cmd = cc.Commands.MoveHue(moveMode=cc.Enums.HueMoveMode.kDown, rate=225) + cmd = cc.Commands.MoveHue(moveMode=cc.Enums.MoveModeEnum.kDown, rate=225) await self.send_single_cmd(cmd) else: self.mark_current_step_skipped() self.step(7) if supports_hs: - cmd = cc.Commands.MoveSaturation(moveMode=cc.Enums.SaturationMoveMode.kDown, rate=225) + cmd = cc.Commands.MoveSaturation(moveMode=cc.Enums.MoveModeEnum.kDown, rate=225) await self.send_single_cmd(cmd) else: self.mark_current_step_skipped() @@ -173,7 +173,7 @@ def check_report_counts(attr: ClusterObjects.ClusterAttributeDescriptor): self.skip_step(15) else: self.step(10) - cmd = cc.Commands.MoveToHue(hue=254, transitionTime=100, direction=cc.Enums.HueDirection.kShortestDistance) + cmd = cc.Commands.MoveToHue(hue=254, transitionTime=100, direction=cc.Enums.DirectionEnum.kShortest) await self.send_single_cmd(cmd) self.step(11) @@ -228,7 +228,7 @@ def check_report_counts(attr: ClusterObjects.ClusterAttributeDescriptor): else: self.step(23) cmd = cc.Commands.EnhancedMoveToHue(enhancedHue=0, transitionTime=100, - direction=cc.Enums.HueDirection.kShortestDistance) + direction=cc.Enums.DirectionEnum.kShortest) await self.send_single_cmd(cmd) self.step(24) 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 c5768be8b71f3d..a8fc013fa0ce19 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 @@ -27161,9 +27161,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu namespace DriftCompensation { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::app::Clusters::ColorControl::DriftCompensationEnum * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -27177,9 +27177,10 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::ColorControl::DriftCompensationEnum value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -27190,9 +27191,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::ColorControl::DriftCompensationEnum value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -27299,9 +27300,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu namespace ColorMode { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::app::Clusters::ColorControl::ColorModeEnum * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -27315,9 +27316,10 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::ColorControl::ColorModeEnum value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -27328,9 +27330,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::ColorControl::ColorModeEnum value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -27345,9 +27347,10 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value namespace Options { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::BitMask * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -27361,9 +27364,10 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status +Set(chip::EndpointId endpoint, chip::BitMask value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -27374,9 +27378,10 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -29237,9 +29242,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu namespace EnhancedColorMode { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::app::Clusters::ColorControl::EnhancedColorModeEnum * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -29253,9 +29258,10 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::ColorControl::EnhancedColorModeEnum value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -29266,9 +29272,9 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::ColorControl::EnhancedColorModeEnum value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -29513,9 +29519,10 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu namespace ColorCapabilities { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::BitMask * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -29529,9 +29536,11 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * va return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -29542,9 +29551,10 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu return emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; 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 41422b72ca596d..cab9691ebbf4ed 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 @@ -4267,9 +4267,11 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu } // namespace CurrentY namespace DriftCompensation { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value); // enum8 -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::app::Clusters::ColorControl::DriftCompensationEnum * value); // DriftCompensationEnum +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::ColorControl::DriftCompensationEnum value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::ColorControl::DriftCompensationEnum value, + MarkAttributeDirty markDirty); } // namespace DriftCompensation namespace CompensationText { @@ -4285,15 +4287,20 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu } // namespace ColorTemperatureMireds namespace ColorMode { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value); // enum8 -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::app::Clusters::ColorControl::ColorModeEnum * value); // ColorModeEnum +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::ColorControl::ColorModeEnum value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::ColorControl::ColorModeEnum value, + MarkAttributeDirty markDirty); } // namespace ColorMode namespace Options { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::BitMask * value); // OptionsBitmap +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value); +Protocols::InteractionModel::Status +Set(chip::EndpointId endpoint, chip::BitMask value, MarkAttributeDirty markDirty); } // namespace Options namespace NumberOfPrimaries { @@ -4533,9 +4540,11 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu } // namespace EnhancedCurrentHue namespace EnhancedColorMode { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value); // enum8 -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::app::Clusters::ColorControl::EnhancedColorModeEnum * value); // EnhancedColorModeEnum +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::ColorControl::EnhancedColorModeEnum value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::ColorControl::EnhancedColorModeEnum value, + MarkAttributeDirty markDirty); } // namespace EnhancedColorMode namespace ColorLoopActive { @@ -4569,9 +4578,14 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu } // namespace ColorLoopStoredEnhancedHue namespace ColorCapabilities { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status +Get(chip::EndpointId endpoint, + chip::BitMask * value); // ColorCapabilitiesBitmap +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value, + MarkAttributeDirty markDirty); } // namespace ColorCapabilities namespace ColorTempPhysicalMinMireds { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index da2047e745d586..f63782c221d827 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -2942,9 +2942,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(ThermostatUserInterface } } -static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::ColorLoopAction val) +static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::ColorLoopActionEnum val) { - using EnumType = ColorControl::ColorLoopAction; + using EnumType = ColorControl::ColorLoopActionEnum; switch (val) { case EnumType::kDeactivate: @@ -2955,38 +2955,38 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::ColorLoop return EnumType::kUnknownEnumValue; } } -static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::ColorLoopDirection val) +static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::ColorLoopDirectionEnum val) { - using EnumType = ColorControl::ColorLoopDirection; + using EnumType = ColorControl::ColorLoopDirectionEnum; switch (val) { - case EnumType::kDecrementHue: - case EnumType::kIncrementHue: + case EnumType::kDecrement: + case EnumType::kIncrement: return val; default: return EnumType::kUnknownEnumValue; } } -static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::ColorMode val) +static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::ColorModeEnum val) { - using EnumType = ColorControl::ColorMode; + using EnumType = ColorControl::ColorModeEnum; switch (val) { case EnumType::kCurrentHueAndCurrentSaturation: case EnumType::kCurrentXAndCurrentY: - case EnumType::kColorTemperature: + case EnumType::kColorTemperatureMireds: return val; default: return EnumType::kUnknownEnumValue; } } -static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::HueDirection val) +static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::DirectionEnum val) { - using EnumType = ColorControl::HueDirection; + using EnumType = ColorControl::DirectionEnum; switch (val) { - case EnumType::kShortestDistance: - case EnumType::kLongestDistance: + case EnumType::kShortest: + case EnumType::kLongest: case EnumType::kUp: case EnumType::kDown: return val; @@ -2994,34 +2994,38 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::HueDirect return EnumType::kUnknownEnumValue; } } -static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::HueMoveMode val) +static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::DriftCompensationEnum val) { - using EnumType = ColorControl::HueMoveMode; + using EnumType = ColorControl::DriftCompensationEnum; switch (val) { - case EnumType::kStop: - case EnumType::kUp: - case EnumType::kDown: + case EnumType::kNone: + case EnumType::kOtherOrUnknown: + case EnumType::kTemperatureMonitoring: + case EnumType::kOpticalLuminanceMonitoringAndFeedback: + case EnumType::kOpticalColorMonitoringAndFeedback: return val; default: return EnumType::kUnknownEnumValue; } } -static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::HueStepMode val) +static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::EnhancedColorModeEnum val) { - using EnumType = ColorControl::HueStepMode; + using EnumType = ColorControl::EnhancedColorModeEnum; switch (val) { - case EnumType::kUp: - case EnumType::kDown: + case EnumType::kCurrentHueAndCurrentSaturation: + case EnumType::kCurrentXAndCurrentY: + case EnumType::kColorTemperatureMireds: + case EnumType::kEnhancedCurrentHueAndCurrentSaturation: return val; default: return EnumType::kUnknownEnumValue; } } -static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::SaturationMoveMode val) +static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::MoveModeEnum val) { - using EnumType = ColorControl::SaturationMoveMode; + using EnumType = ColorControl::MoveModeEnum; switch (val) { case EnumType::kStop: @@ -3032,9 +3036,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::Saturatio return EnumType::kUnknownEnumValue; } } -static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::SaturationStepMode val) +static auto __attribute__((unused)) EnsureKnownEnumValue(ColorControl::StepModeEnum val) { - using EnumType = ColorControl::SaturationStepMode; + using EnumType = ColorControl::StepModeEnum; switch (val) { case EnumType::kUp: 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 571439625e121a..e78f8f4d064648 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 @@ -4343,8 +4343,8 @@ enum class TemperatureDisplayModeEnum : uint8_t namespace ColorControl { -// Enum for ColorLoopAction -enum class ColorLoopAction : uint8_t +// Enum for ColorLoopActionEnum +enum class ColorLoopActionEnum : uint8_t { kDeactivate = 0x00, kActivateFromColorLoopStartEnhancedHue = 0x01, @@ -4356,11 +4356,11 @@ enum class ColorLoopAction : uint8_t kUnknownEnumValue = 3, }; -// Enum for ColorLoopDirection -enum class ColorLoopDirection : uint8_t +// Enum for ColorLoopDirectionEnum +enum class ColorLoopDirectionEnum : uint8_t { - kDecrementHue = 0x00, - kIncrementHue = 0x01, + kDecrement = 0x00, + kIncrement = 0x01, // All received enum values that are not listed above will be mapped // to kUnknownEnumValue. This is a helper enum value that should only // be used by code to process how it handles receiving and unknown @@ -4368,12 +4368,12 @@ enum class ColorLoopDirection : uint8_t kUnknownEnumValue = 2, }; -// Enum for ColorMode -enum class ColorMode : uint8_t +// Enum for ColorModeEnum +enum class ColorModeEnum : uint8_t { kCurrentHueAndCurrentSaturation = 0x00, kCurrentXAndCurrentY = 0x01, - kColorTemperature = 0x02, + kColorTemperatureMireds = 0x02, // All received enum values that are not listed above will be mapped // to kUnknownEnumValue. This is a helper enum value that should only // be used by code to process how it handles receiving and unknown @@ -4381,13 +4381,13 @@ enum class ColorMode : uint8_t kUnknownEnumValue = 3, }; -// Enum for HueDirection -enum class HueDirection : uint8_t +// Enum for DirectionEnum +enum class DirectionEnum : uint8_t { - kShortestDistance = 0x00, - kLongestDistance = 0x01, - kUp = 0x02, - kDown = 0x03, + kShortest = 0x00, + kLongest = 0x01, + kUp = 0x02, + kDown = 0x03, // All received enum values that are not listed above will be mapped // to kUnknownEnumValue. This is a helper enum value that should only // be used by code to process how it handles receiving and unknown @@ -4395,33 +4395,37 @@ enum class HueDirection : uint8_t kUnknownEnumValue = 4, }; -// Enum for HueMoveMode -enum class HueMoveMode : uint8_t +// Enum for DriftCompensationEnum +enum class DriftCompensationEnum : uint8_t { - kStop = 0x00, - kUp = 0x01, - kDown = 0x03, + kNone = 0x00, + kOtherOrUnknown = 0x01, + kTemperatureMonitoring = 0x02, + kOpticalLuminanceMonitoringAndFeedback = 0x03, + kOpticalColorMonitoringAndFeedback = 0x04, // All received enum values that are not listed above will be mapped // to kUnknownEnumValue. This is a helper enum value that should only // be used by code to process how it handles receiving and unknown // enum value. This specific should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 5, }; -// Enum for HueStepMode -enum class HueStepMode : uint8_t +// Enum for EnhancedColorModeEnum +enum class EnhancedColorModeEnum : uint8_t { - kUp = 0x01, - kDown = 0x03, + kCurrentHueAndCurrentSaturation = 0x00, + kCurrentXAndCurrentY = 0x01, + kColorTemperatureMireds = 0x02, + kEnhancedCurrentHueAndCurrentSaturation = 0x03, // All received enum values that are not listed above will be mapped // to kUnknownEnumValue. This is a helper enum value that should only // be used by code to process how it handles receiving and unknown // enum value. This specific should never be transmitted. - kUnknownEnumValue = 0, + kUnknownEnumValue = 4, }; -// Enum for SaturationMoveMode -enum class SaturationMoveMode : uint8_t +// Enum for MoveModeEnum +enum class MoveModeEnum : uint8_t { kStop = 0x00, kUp = 0x01, @@ -4433,8 +4437,8 @@ enum class SaturationMoveMode : uint8_t kUnknownEnumValue = 2, }; -// Enum for SaturationStepMode -enum class SaturationStepMode : uint8_t +// Enum for StepModeEnum +enum class StepModeEnum : uint8_t { kUp = 0x01, kDown = 0x03, @@ -4445,23 +4449,14 @@ enum class SaturationStepMode : uint8_t kUnknownEnumValue = 0, }; -// Bitmap for ColorCapabilities -enum class ColorCapabilities : uint16_t +// Bitmap for ColorCapabilitiesBitmap +enum class ColorCapabilitiesBitmap : uint16_t { - kHueSaturationSupported = 0x1, - kEnhancedHueSupported = 0x2, - kColorLoopSupported = 0x4, - kXYAttributesSupported = 0x8, - kColorTemperatureSupported = 0x10, -}; - -// Bitmap for ColorLoopUpdateFlags -enum class ColorLoopUpdateFlags : uint8_t -{ - kUpdateAction = 0x1, - kUpdateDirection = 0x2, - kUpdateTime = 0x4, - kUpdateStartHue = 0x8, + kHueSaturation = 0x1, + kEnhancedHue = 0x2, + kColorLoop = 0x4, + kXy = 0x8, + kColorTemperature = 0x10, }; // Bitmap for Feature @@ -4473,6 +4468,21 @@ enum class Feature : uint32_t kXy = 0x8, kColorTemperature = 0x10, }; + +// Bitmap for OptionsBitmap +enum class OptionsBitmap : uint8_t +{ + kExecuteIfOff = 0x1, +}; + +// Bitmap for UpdateFlagsBitmap +enum class UpdateFlagsBitmap : uint8_t +{ + kUpdateAction = 0x1, + kUpdateDirection = 0x2, + kUpdateTime = 0x4, + kUpdateStartHue = 0x8, +}; } // namespace ColorControl namespace BallastConfiguration { 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 f0f1dea1de536d..e18b64797bb595 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 @@ -31602,11 +31602,11 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::MoveToHue::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - uint8_t hue = static_cast(0); - HueDirection direction = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + uint8_t hue = static_cast(0); + DirectionEnum direction = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -31621,11 +31621,11 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::MoveToHue::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - uint8_t hue = static_cast(0); - HueDirection direction = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + uint8_t hue = static_cast(0); + DirectionEnum direction = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace MoveToHue @@ -31645,10 +31645,10 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::MoveHue::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - HueMoveMode moveMode = static_cast(0); - uint8_t rate = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + MoveModeEnum moveMode = static_cast(0); + uint8_t rate = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -31663,10 +31663,10 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::MoveHue::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - HueMoveMode moveMode = static_cast(0); - uint8_t rate = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + MoveModeEnum moveMode = static_cast(0); + uint8_t rate = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace MoveHue @@ -31687,11 +31687,11 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::StepHue::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - HueStepMode stepMode = static_cast(0); - uint8_t stepSize = static_cast(0); - uint8_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + StepModeEnum stepMode = static_cast(0); + uint8_t stepSize = static_cast(0); + uint8_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -31706,11 +31706,11 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::StepHue::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - HueStepMode stepMode = static_cast(0); - uint8_t stepSize = static_cast(0); - uint8_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + StepModeEnum stepMode = static_cast(0); + uint8_t stepSize = static_cast(0); + uint8_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace StepHue @@ -31730,10 +31730,10 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::MoveToSaturation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - uint8_t saturation = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + uint8_t saturation = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -31748,10 +31748,10 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::MoveToSaturation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - uint8_t saturation = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + uint8_t saturation = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace MoveToSaturation @@ -31771,10 +31771,10 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::MoveSaturation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - SaturationMoveMode moveMode = static_cast(0); - uint8_t rate = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + MoveModeEnum moveMode = static_cast(0); + uint8_t rate = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -31789,10 +31789,10 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::MoveSaturation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - SaturationMoveMode moveMode = static_cast(0); - uint8_t rate = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + MoveModeEnum moveMode = static_cast(0); + uint8_t rate = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace MoveSaturation @@ -31813,11 +31813,11 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::StepSaturation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - SaturationStepMode stepMode = static_cast(0); - uint8_t stepSize = static_cast(0); - uint8_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + StepModeEnum stepMode = static_cast(0); + uint8_t stepSize = static_cast(0); + uint8_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -31832,11 +31832,11 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::StepSaturation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - SaturationStepMode stepMode = static_cast(0); - uint8_t stepSize = static_cast(0); - uint8_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + StepModeEnum stepMode = static_cast(0); + uint8_t stepSize = static_cast(0); + uint8_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace StepSaturation @@ -31857,11 +31857,11 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::MoveToHueAndSaturation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - uint8_t hue = static_cast(0); - uint8_t saturation = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + uint8_t hue = static_cast(0); + uint8_t saturation = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -31876,11 +31876,11 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::MoveToHueAndSaturation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - uint8_t hue = static_cast(0); - uint8_t saturation = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + uint8_t hue = static_cast(0); + uint8_t saturation = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace MoveToHueAndSaturation @@ -31901,11 +31901,11 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::MoveToColor::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - uint16_t colorX = static_cast(0); - uint16_t colorY = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + uint16_t colorX = static_cast(0); + uint16_t colorY = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -31920,11 +31920,11 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::MoveToColor::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - uint16_t colorX = static_cast(0); - uint16_t colorY = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + uint16_t colorX = static_cast(0); + uint16_t colorY = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace MoveToColor @@ -31944,10 +31944,10 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::MoveColor::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - int16_t rateX = static_cast(0); - int16_t rateY = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + int16_t rateX = static_cast(0); + int16_t rateY = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -31962,10 +31962,10 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::MoveColor::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - int16_t rateX = static_cast(0); - int16_t rateY = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + int16_t rateX = static_cast(0); + int16_t rateY = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace MoveColor @@ -31986,11 +31986,11 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::StepColor::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - int16_t stepX = static_cast(0); - int16_t stepY = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + int16_t stepX = static_cast(0); + int16_t stepY = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -32005,11 +32005,11 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::StepColor::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - int16_t stepX = static_cast(0); - int16_t stepY = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + int16_t stepX = static_cast(0); + int16_t stepY = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace StepColor @@ -32029,10 +32029,10 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::MoveToColorTemperature::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - uint16_t colorTemperatureMireds = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + uint16_t colorTemperatureMireds = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -32047,10 +32047,10 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::MoveToColorTemperature::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - uint16_t colorTemperatureMireds = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + uint16_t colorTemperatureMireds = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace MoveToColorTemperature @@ -32071,11 +32071,11 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::EnhancedMoveToHue::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - uint16_t enhancedHue = static_cast(0); - HueDirection direction = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + uint16_t enhancedHue = static_cast(0); + DirectionEnum direction = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -32090,11 +32090,11 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::EnhancedMoveToHue::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - uint16_t enhancedHue = static_cast(0); - HueDirection direction = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + uint16_t enhancedHue = static_cast(0); + DirectionEnum direction = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace EnhancedMoveToHue @@ -32114,10 +32114,10 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::EnhancedMoveHue::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - HueMoveMode moveMode = static_cast(0); - uint16_t rate = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + MoveModeEnum moveMode = static_cast(0); + uint16_t rate = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -32132,10 +32132,10 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::EnhancedMoveHue::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - HueMoveMode moveMode = static_cast(0); - uint16_t rate = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + MoveModeEnum moveMode = static_cast(0); + uint16_t rate = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace EnhancedMoveHue @@ -32156,11 +32156,11 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::EnhancedStepHue::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - HueStepMode stepMode = static_cast(0); - uint16_t stepSize = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + StepModeEnum stepMode = static_cast(0); + uint16_t stepSize = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -32175,11 +32175,11 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::EnhancedStepHue::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - HueStepMode stepMode = static_cast(0); - uint16_t stepSize = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + StepModeEnum stepMode = static_cast(0); + uint16_t stepSize = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace EnhancedStepHue @@ -32200,11 +32200,11 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::EnhancedMoveToHueAndSaturation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - uint16_t enhancedHue = static_cast(0); - uint8_t saturation = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + uint16_t enhancedHue = static_cast(0); + uint8_t saturation = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -32219,11 +32219,11 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::EnhancedMoveToHueAndSaturation::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - uint16_t enhancedHue = static_cast(0); - uint8_t saturation = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + uint16_t enhancedHue = static_cast(0); + uint8_t saturation = static_cast(0); + uint16_t transitionTime = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace EnhancedMoveToHueAndSaturation @@ -32246,13 +32246,13 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::ColorLoopSet::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - chip::BitMask updateFlags = static_cast>(0); - ColorLoopAction action = static_cast(0); - ColorLoopDirection direction = static_cast(0); - uint16_t time = static_cast(0); - uint16_t startHue = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask updateFlags = static_cast>(0); + ColorLoopActionEnum action = static_cast(0); + ColorLoopDirectionEnum direction = static_cast(0); + uint16_t time = static_cast(0); + uint16_t startHue = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -32267,13 +32267,13 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::ColorLoopSet::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - chip::BitMask updateFlags = static_cast>(0); - ColorLoopAction action = static_cast(0); - ColorLoopDirection direction = static_cast(0); - uint16_t time = static_cast(0); - uint16_t startHue = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask updateFlags = static_cast>(0); + ColorLoopActionEnum action = static_cast(0); + ColorLoopDirectionEnum direction = static_cast(0); + uint16_t time = static_cast(0); + uint16_t startHue = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ColorLoopSet @@ -32291,8 +32291,8 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::StopMoveStep::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -32307,8 +32307,8 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::StopMoveStep::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace StopMoveStep @@ -32330,12 +32330,12 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::MoveColorTemperature::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - HueMoveMode moveMode = static_cast(0); - uint16_t rate = static_cast(0); - uint16_t colorTemperatureMinimumMireds = static_cast(0); - uint16_t colorTemperatureMaximumMireds = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + MoveModeEnum moveMode = static_cast(0); + uint16_t rate = static_cast(0); + uint16_t colorTemperatureMinimumMireds = static_cast(0); + uint16_t colorTemperatureMaximumMireds = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -32350,12 +32350,12 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::MoveColorTemperature::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - HueMoveMode moveMode = static_cast(0); - uint16_t rate = static_cast(0); - uint16_t colorTemperatureMinimumMireds = static_cast(0); - uint16_t colorTemperatureMaximumMireds = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + MoveModeEnum moveMode = static_cast(0); + uint16_t rate = static_cast(0); + uint16_t colorTemperatureMinimumMireds = static_cast(0); + uint16_t colorTemperatureMaximumMireds = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace MoveColorTemperature @@ -32378,13 +32378,13 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::StepColorTemperature::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - HueStepMode stepMode = static_cast(0); - uint16_t stepSize = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint16_t colorTemperatureMinimumMireds = static_cast(0); - uint16_t colorTemperatureMaximumMireds = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + StepModeEnum stepMode = static_cast(0); + uint16_t stepSize = static_cast(0); + uint16_t transitionTime = static_cast(0); + uint16_t colorTemperatureMinimumMireds = static_cast(0); + uint16_t colorTemperatureMaximumMireds = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -32399,13 +32399,13 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::StepColorTemperature::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - HueStepMode stepMode = static_cast(0); - uint16_t stepSize = static_cast(0); - uint16_t transitionTime = static_cast(0); - uint16_t colorTemperatureMinimumMireds = static_cast(0); - uint16_t colorTemperatureMaximumMireds = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + StepModeEnum stepMode = static_cast(0); + uint16_t stepSize = static_cast(0); + uint16_t transitionTime = static_cast(0); + uint16_t colorTemperatureMinimumMireds = static_cast(0); + uint16_t colorTemperatureMaximumMireds = static_cast(0); + chip::BitMask optionsMask = static_cast>(0); + chip::BitMask optionsOverride = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace StepColorTemperature @@ -32476,9 +32476,9 @@ struct TypeInfo namespace DriftCompensation { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::app::Clusters::ColorControl::DriftCompensationEnum; + using DecodableType = chip::app::Clusters::ColorControl::DriftCompensationEnum; + using DecodableArgType = chip::app::Clusters::ColorControl::DriftCompensationEnum; static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::DriftCompensation::Id; } @@ -32513,9 +32513,9 @@ struct TypeInfo namespace ColorMode { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::app::Clusters::ColorControl::ColorModeEnum; + using DecodableType = chip::app::Clusters::ColorControl::ColorModeEnum; + using DecodableArgType = chip::app::Clusters::ColorControl::ColorModeEnum; static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ColorMode::Id; } @@ -32525,9 +32525,9 @@ struct TypeInfo namespace Options { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Options::Id; } @@ -32909,9 +32909,9 @@ struct TypeInfo namespace EnhancedColorMode { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::app::Clusters::ColorControl::EnhancedColorModeEnum; + using DecodableType = chip::app::Clusters::ColorControl::EnhancedColorModeEnum; + using DecodableArgType = chip::app::Clusters::ColorControl::EnhancedColorModeEnum; static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::EnhancedColorMode::Id; } @@ -32981,9 +32981,9 @@ struct TypeInfo namespace ColorCapabilities { struct TypeInfo { - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ColorCapabilities::Id; } @@ -33088,11 +33088,13 @@ struct TypeInfo Attributes::RemainingTime::TypeInfo::DecodableType remainingTime = static_cast(0); Attributes::CurrentX::TypeInfo::DecodableType currentX = static_cast(0); Attributes::CurrentY::TypeInfo::DecodableType currentY = static_cast(0); - Attributes::DriftCompensation::TypeInfo::DecodableType driftCompensation = static_cast(0); + Attributes::DriftCompensation::TypeInfo::DecodableType driftCompensation = + static_cast(0); Attributes::CompensationText::TypeInfo::DecodableType compensationText; Attributes::ColorTemperatureMireds::TypeInfo::DecodableType colorTemperatureMireds = static_cast(0); - Attributes::ColorMode::TypeInfo::DecodableType colorMode = static_cast(0); - Attributes::Options::TypeInfo::DecodableType options = static_cast(0); + Attributes::ColorMode::TypeInfo::DecodableType colorMode = static_cast(0); + Attributes::Options::TypeInfo::DecodableType options = + static_cast>(0); Attributes::NumberOfPrimaries::TypeInfo::DecodableType numberOfPrimaries; Attributes::Primary1X::TypeInfo::DecodableType primary1X = static_cast(0); Attributes::Primary1Y::TypeInfo::DecodableType primary1Y = static_cast(0); @@ -33123,14 +33125,16 @@ struct TypeInfo Attributes::ColorPointBX::TypeInfo::DecodableType colorPointBX = static_cast(0); Attributes::ColorPointBY::TypeInfo::DecodableType colorPointBY = static_cast(0); Attributes::ColorPointBIntensity::TypeInfo::DecodableType colorPointBIntensity; - Attributes::EnhancedCurrentHue::TypeInfo::DecodableType enhancedCurrentHue = static_cast(0); - Attributes::EnhancedColorMode::TypeInfo::DecodableType enhancedColorMode = static_cast(0); + Attributes::EnhancedCurrentHue::TypeInfo::DecodableType enhancedCurrentHue = static_cast(0); + Attributes::EnhancedColorMode::TypeInfo::DecodableType enhancedColorMode = + static_cast(0); Attributes::ColorLoopActive::TypeInfo::DecodableType colorLoopActive = static_cast(0); Attributes::ColorLoopDirection::TypeInfo::DecodableType colorLoopDirection = static_cast(0); Attributes::ColorLoopTime::TypeInfo::DecodableType colorLoopTime = static_cast(0); Attributes::ColorLoopStartEnhancedHue::TypeInfo::DecodableType colorLoopStartEnhancedHue = static_cast(0); Attributes::ColorLoopStoredEnhancedHue::TypeInfo::DecodableType colorLoopStoredEnhancedHue = static_cast(0); - Attributes::ColorCapabilities::TypeInfo::DecodableType colorCapabilities = static_cast(0); + Attributes::ColorCapabilities::TypeInfo::DecodableType colorCapabilities = + static_cast>(0); Attributes::ColorTempPhysicalMinMireds::TypeInfo::DecodableType colorTempPhysicalMinMireds = static_cast(0); Attributes::ColorTempPhysicalMaxMireds::TypeInfo::DecodableType colorTempPhysicalMaxMireds = static_cast(0); Attributes::CoupleColorTempToLevelMinMireds::TypeInfo::DecodableType coupleColorTempToLevelMinMireds = diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 57259e33d69d44..add8258f1e9db3 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -23695,16 +23695,17 @@ void registerClusterColorControl(Commands & commands, CredentialIssuerCommands * WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "current-y", 0, UINT16_MAX, Attributes::CurrentY::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "drift-compensation", 0, UINT8_MAX, Attributes::DriftCompensation::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "drift-compensation", 0, UINT8_MAX, Attributes::DriftCompensation::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // make_unique>(Id, "compensation-text", Attributes::CompensationText::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "color-temperature-mireds", 0, UINT16_MAX, Attributes::ColorTemperatureMireds::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "color-mode", 0, UINT8_MAX, Attributes::ColorMode::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "options", 0, UINT8_MAX, Attributes::Options::Id, WriteCommandType::kWrite, - credsIssuerConfig), // + make_unique>( + Id, "color-mode", 0, UINT8_MAX, Attributes::ColorMode::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "options", 0, UINT8_MAX, Attributes::Options::Id, WriteCommandType::kWrite, credsIssuerConfig), // make_unique>>(Id, "number-of-primaries", 0, UINT8_MAX, Attributes::NumberOfPrimaries::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -23777,8 +23778,9 @@ void registerClusterColorControl(Commands & commands, CredentialIssuerCommands * WriteCommandType::kWrite, credsIssuerConfig), // make_unique>(Id, "enhanced-current-hue", 0, UINT16_MAX, Attributes::EnhancedCurrentHue::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "enhanced-color-mode", 0, UINT8_MAX, Attributes::EnhancedColorMode::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "enhanced-color-mode", 0, UINT8_MAX, Attributes::EnhancedColorMode::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // make_unique>(Id, "color-loop-active", 0, UINT8_MAX, Attributes::ColorLoopActive::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "color-loop-direction", 0, UINT8_MAX, Attributes::ColorLoopDirection::Id, @@ -23791,8 +23793,9 @@ void registerClusterColorControl(Commands & commands, CredentialIssuerCommands * make_unique>(Id, "color-loop-stored-enhanced-hue", 0, UINT16_MAX, Attributes::ColorLoopStoredEnhancedHue::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "color-capabilities", 0, UINT16_MAX, Attributes::ColorCapabilities::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "color-capabilities", 0, UINT16_MAX, Attributes::ColorCapabilities::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // make_unique>(Id, "color-temp-physical-min-mireds", 0, UINT16_MAX, Attributes::ColorTempPhysicalMinMireds::Id, WriteCommandType::kForceWrite, 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 aa122cb62da046..12382e3cb41495 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -15550,7 +15550,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("CurrentY", 1, value); } case ColorControl::Attributes::DriftCompensation::Id: { - uint8_t value; + chip::app::Clusters::ColorControl::DriftCompensationEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("DriftCompensation", 1, value); } @@ -15565,12 +15565,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("ColorTemperatureMireds", 1, value); } case ColorControl::Attributes::ColorMode::Id: { - uint8_t value; + chip::app::Clusters::ColorControl::ColorModeEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ColorMode", 1, value); } case ColorControl::Attributes::Options::Id: { - uint8_t value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Options", 1, value); } @@ -15730,7 +15730,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("EnhancedCurrentHue", 1, value); } case ColorControl::Attributes::EnhancedColorMode::Id: { - uint8_t value; + chip::app::Clusters::ColorControl::EnhancedColorModeEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EnhancedColorMode", 1, value); } @@ -15760,7 +15760,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("ColorLoopStoredEnhancedHue", 1, value); } case ColorControl::Attributes::ColorCapabilities::Id: { - uint16_t value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ColorCapabilities", 1, value); } 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 a61f2a6fa6b27e..004bb29c546d1e 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -117680,8 +117680,8 @@ class ColorControlMoveToHue : public ClusterCommand { params.hue = [NSNumber numberWithUnsignedChar:mRequest.hue]; params.direction = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.direction)]; params.transitionTime = [NSNumber numberWithUnsignedShort:mRequest.transitionTime]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -117733,8 +117733,8 @@ class ColorControlMoveHue : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.moveMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.moveMode)]; params.rate = [NSNumber numberWithUnsignedChar:mRequest.rate]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -117788,8 +117788,8 @@ class ColorControlStepHue : public ClusterCommand { params.stepMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.stepMode)]; params.stepSize = [NSNumber numberWithUnsignedChar:mRequest.stepSize]; params.transitionTime = [NSNumber numberWithUnsignedChar:mRequest.transitionTime]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -117841,8 +117841,8 @@ class ColorControlMoveToSaturation : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.saturation = [NSNumber numberWithUnsignedChar:mRequest.saturation]; params.transitionTime = [NSNumber numberWithUnsignedShort:mRequest.transitionTime]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -117894,8 +117894,8 @@ class ColorControlMoveSaturation : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.moveMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.moveMode)]; params.rate = [NSNumber numberWithUnsignedChar:mRequest.rate]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -117949,8 +117949,8 @@ class ColorControlStepSaturation : public ClusterCommand { params.stepMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.stepMode)]; params.stepSize = [NSNumber numberWithUnsignedChar:mRequest.stepSize]; params.transitionTime = [NSNumber numberWithUnsignedChar:mRequest.transitionTime]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -118004,8 +118004,8 @@ class ColorControlMoveToHueAndSaturation : public ClusterCommand { params.hue = [NSNumber numberWithUnsignedChar:mRequest.hue]; params.saturation = [NSNumber numberWithUnsignedChar:mRequest.saturation]; params.transitionTime = [NSNumber numberWithUnsignedShort:mRequest.transitionTime]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -118059,8 +118059,8 @@ class ColorControlMoveToColor : public ClusterCommand { params.colorX = [NSNumber numberWithUnsignedShort:mRequest.colorX]; params.colorY = [NSNumber numberWithUnsignedShort:mRequest.colorY]; params.transitionTime = [NSNumber numberWithUnsignedShort:mRequest.transitionTime]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -118112,8 +118112,8 @@ class ColorControlMoveColor : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.rateX = [NSNumber numberWithShort:mRequest.rateX]; params.rateY = [NSNumber numberWithShort:mRequest.rateY]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -118167,8 +118167,8 @@ class ColorControlStepColor : public ClusterCommand { params.stepX = [NSNumber numberWithShort:mRequest.stepX]; params.stepY = [NSNumber numberWithShort:mRequest.stepY]; params.transitionTime = [NSNumber numberWithUnsignedShort:mRequest.transitionTime]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -118220,8 +118220,8 @@ class ColorControlMoveToColorTemperature : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.colorTemperatureMireds = [NSNumber numberWithUnsignedShort:mRequest.colorTemperatureMireds]; params.transitionTime = [NSNumber numberWithUnsignedShort:mRequest.transitionTime]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -118275,8 +118275,8 @@ class ColorControlEnhancedMoveToHue : public ClusterCommand { params.enhancedHue = [NSNumber numberWithUnsignedShort:mRequest.enhancedHue]; params.direction = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.direction)]; params.transitionTime = [NSNumber numberWithUnsignedShort:mRequest.transitionTime]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -118328,8 +118328,8 @@ class ColorControlEnhancedMoveHue : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.moveMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.moveMode)]; params.rate = [NSNumber numberWithUnsignedShort:mRequest.rate]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -118383,8 +118383,8 @@ class ColorControlEnhancedStepHue : public ClusterCommand { params.stepMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.stepMode)]; params.stepSize = [NSNumber numberWithUnsignedShort:mRequest.stepSize]; params.transitionTime = [NSNumber numberWithUnsignedShort:mRequest.transitionTime]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -118438,8 +118438,8 @@ class ColorControlEnhancedMoveToHueAndSaturation : public ClusterCommand { params.enhancedHue = [NSNumber numberWithUnsignedShort:mRequest.enhancedHue]; params.saturation = [NSNumber numberWithUnsignedChar:mRequest.saturation]; params.transitionTime = [NSNumber numberWithUnsignedShort:mRequest.transitionTime]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -118497,8 +118497,8 @@ class ColorControlColorLoopSet : public ClusterCommand { params.direction = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.direction)]; params.time = [NSNumber numberWithUnsignedShort:mRequest.time]; params.startHue = [NSNumber numberWithUnsignedShort:mRequest.startHue]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -118546,8 +118546,8 @@ class ColorControlStopMoveStep : public ClusterCommand { __auto_type * cluster = [[MTRBaseClusterColorControl alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; __auto_type * params = [[MTRColorControlClusterStopMoveStepParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -118603,8 +118603,8 @@ class ColorControlMoveColorTemperature : public ClusterCommand { params.rate = [NSNumber numberWithUnsignedShort:mRequest.rate]; params.colorTemperatureMinimumMireds = [NSNumber numberWithUnsignedShort:mRequest.colorTemperatureMinimumMireds]; params.colorTemperatureMaximumMireds = [NSNumber numberWithUnsignedShort:mRequest.colorTemperatureMaximumMireds]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -118662,8 +118662,8 @@ class ColorControlStepColorTemperature : public ClusterCommand { params.transitionTime = [NSNumber numberWithUnsignedShort:mRequest.transitionTime]; params.colorTemperatureMinimumMireds = [NSNumber numberWithUnsignedShort:mRequest.colorTemperatureMinimumMireds]; params.colorTemperatureMaximumMireds = [NSNumber numberWithUnsignedShort:mRequest.colorTemperatureMaximumMireds]; - params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride]; + params.optionsMask = [NSNumber numberWithUnsignedChar:mRequest.optionsMask.Raw()]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:mRequest.optionsOverride.Raw()]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { From 0c4dde5230d5b0e3eb349b5411ceb356ddf2622e Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 21 Aug 2024 14:03:08 -0400 Subject: [PATCH 37/52] Update Darwin availability annotations. (#35108) --- .../CHIP/templates/availability.yaml | 51 ++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 507e19eae032d9..c1f1e1bd6f0e6c 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -9694,6 +9694,13 @@ - WaterHeaterMode - WiFiNetworkManagement attributes: + AccessControl: + # Targeting 1.4 + - CommissioningARL + - ARL + BridgedDeviceBasicInformation: + # Targeting 1.4 + - ProductID GeneralCommissioning: # Targeting 1.4 - TCAcceptedVersion @@ -9712,6 +9719,10 @@ - NullableGlobalEnum - NullableGlobalStruct commands: + AccessControl: + # Targeting 1.4 + - ReviewFabricRestrictions + - ReviewFabricRestrictionsResponse BridgedDeviceBasicInformation: # Targeting 1.4 - KeepActive @@ -9719,6 +9730,10 @@ # Targeting 1.4 - SetTCAcknowledgements - SetTCAcknowledgementsResponse + Thermostat: + # Targeting 1.4 + - AtomicRequest + - AtomicResponse UnitTesting: # Ideally none of UnitTesting would be exposed as public API, but # for now just start doing that for new additions to it. @@ -9727,9 +9742,17 @@ - StringEchoRequest - StringEchoResponse structs: + AccessControl: + # Targeting 1.4 + - AccessRestrictionEntryStruct + - AccessRestrictionStruct + - CommissioningAccessRestrictionEntryStruct Globals: # Test-only value - TestGlobalStruct + # Targeting 1.4 + - AtomicAttributeStatusStruct + - LocationDescriptorStruct OccupancySensing: # Targeting 1.4 - HoldTimeLimitsStruct @@ -9742,21 +9765,44 @@ NestedStruct: - d events: + AccessControl: + # Targeting 1.4 + - AccessRestrictionEntryChanged + - FabricRestrictionReviewUpdate BridgedDeviceBasicInformation: # Targeting 1.4 - ActiveChanged enums: + AccessControl: + # Targeting 1.4 + - AccessRestrictionTypeEnum Globals: # Test-only value - TestGlobalEnum + # Targeting 1.4 + - AreaTypeTag + - AtomicRequestTypeEnum + - FloorSurfaceTag + - LandmarkTag + - PositionTag + - RelativePositionTag enum values: + ApplicationLauncher: + StatusEnum: + # Targeting 1.4 + - Downloading + - Installing + - PendingUserApproval GeneralCommissioning: - # Targeting 1.4 CommissioningErrorEnum: + # Targeting 1.4 - RequiredTCNotAccepted - TCAcknowledgementsNotReceived - TCMinVersionNotMet bitmaps: + AccessControl: + # Targeting 1.4 + - Feature BridgedDeviceBasicInformation: # Targeting 1.4 - Feature @@ -9766,6 +9812,9 @@ OccupancySensing: # Targeting 1.4 - Feature + Thermostat: + # Targeting 1.4 + - OccupancyBitmap bitmap values: Switch: Feature: From 229df0c9d8cf5d58ce20ba7411de6b4de68891af Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 21 Aug 2024 14:04:16 -0400 Subject: [PATCH 38/52] Make descriptions for MTRDevice clearly say whether it's the XPC version. (#35112) This requires hoisting _nodeID and _deviceController ivars clearly into the MTRDevice superclass, so they can be accessed from subclasses. The XPC version does not have a bunch of the state the non-XPC one does, so for now it does not try to log that --- src/darwin/Framework/CHIP/MTRDevice.mm | 73 ------------------- .../Framework/CHIP/MTRDevice_Concrete.mm | 8 +- .../Framework/CHIP/MTRDevice_Internal.h | 8 ++ src/darwin/Framework/CHIP/MTRDevice_XPC.mm | 10 +++ 4 files changed, 19 insertions(+), 80 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 4fc30b90b3e433..f17e6d5c90f6eb 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -173,23 +173,6 @@ bool HaveSubscriptionEstablishedRightNow(MTRInternalDeviceState state) return state == MTRInternalDeviceStateInitialSubscriptionEstablished || state == MTRInternalDeviceStateLaterSubscriptionEstablished; } -NSString * InternalDeviceStateString(MTRInternalDeviceState state) -{ - switch (state) { - case MTRInternalDeviceStateUnsubscribed: - return @"Unsubscribed"; - case MTRInternalDeviceStateSubscribing: - return @"Subscribing"; - case MTRInternalDeviceStateInitialSubscriptionEstablished: - return @"InitialSubscriptionEstablished"; - case MTRInternalDeviceStateResubscribing: - return @"Resubscribing"; - case MTRInternalDeviceStateLaterSubscriptionEstablished: - return @"LaterSubscriptionEstablished"; - default: - return @"Unknown"; - } -} } // anonymous namespace typedef NS_ENUM(NSUInteger, MTRDeviceExpectedValueFieldIndex) { @@ -548,62 +531,6 @@ - (void)dealloc MTR_LOG("MTRDevice dealloc: %p", self); } -- (NSString *)description -{ - id _Nullable vid; - id _Nullable pid; - NSNumber * _Nullable networkFeatures; - MTRInternalDeviceState internalDeviceState; - uint32_t lastSubscriptionAttemptWait; - NSDate * _Nullable mostRecentReportTime; - NSDate * _Nullable lastSubscriptionFailureTime; - { - std::lock_guard lock(_descriptionLock); - vid = _vid; - pid = _pid; - networkFeatures = _allNetworkFeatures; - internalDeviceState = _internalDeviceStateForDescription; - lastSubscriptionAttemptWait = _lastSubscriptionAttemptWaitForDescription; - mostRecentReportTime = _mostRecentReportTimeForDescription; - lastSubscriptionFailureTime = _lastSubscriptionFailureTimeForDescription; - } - - if (vid == nil) { - vid = @"Unknown"; - } - - if (pid == nil) { - pid = @"Unknown"; - } - - NSString * wifi; - NSString * thread; - if (networkFeatures == nil) { - wifi = @"NO"; - thread = @"NO"; - } else { - wifi = YES_NO(networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureWiFiNetworkInterface); - thread = YES_NO(networkFeatures.unsignedLongLongValue & MTRNetworkCommissioningFeatureThreadNetworkInterface); - } - - NSString * reportAge; - if (mostRecentReportTime) { - reportAge = [NSString stringWithFormat:@" (%.0lfs ago)", -[mostRecentReportTime timeIntervalSinceNow]]; - } else { - reportAge = @""; - } - - NSString * subscriptionFailureAge; - if (lastSubscriptionFailureTime) { - subscriptionFailureAge = [NSString stringWithFormat:@" (%.0lfs ago)", -[lastSubscriptionFailureTime timeIntervalSinceNow]]; - } else { - subscriptionFailureAge = @""; - } - - return [NSString - stringWithFormat:@"", self, _deviceController.compressedFabricID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, vid, pid, wifi, thread, InternalDeviceStateString(internalDeviceState), static_cast(lastSubscriptionAttemptWait), static_cast(_asyncWorkQueue.itemCount), mostRecentReportTime, reportAge, lastSubscriptionFailureTime, subscriptionFailureAge, _deviceController.uniqueIdentifier]; -} - + (MTRDevice *)deviceWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller { return [controller deviceForNodeID:nodeID]; diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index c9f4b7f07d295e..120d29aff122d4 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -58,8 +58,6 @@ // allow readwrite access to superclass properties @interface MTRDevice_Concrete () -@property (nonatomic, readwrite, copy) NSNumber * nodeID; -@property (nonatomic, readwrite, nullable) MTRDeviceController * deviceController; @property (nonatomic, readwrite) MTRAsyncWorkQueue * asyncWorkQueue; @property (nonatomic, readwrite) MTRDeviceState state; @property (nonatomic, readwrite, nullable) NSDate * estimatedStartTime; @@ -356,8 +354,6 @@ @implementation MTRDevice_Concrete { } // synthesize superclass property readwrite accessors -@synthesize nodeID = _nodeID; -@synthesize deviceController = _deviceController; @synthesize queue = _queue; @synthesize asyncWorkQueue = _asyncWorkQueue; @synthesize state = _state; @@ -372,9 +368,7 @@ - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceControlle if (self = [super initForSubclassesWithNodeID:nodeID controller:controller]) { _timeSyncLock = OS_UNFAIR_LOCK_INIT; _descriptionLock = OS_UNFAIR_LOCK_INIT; - _nodeID = [nodeID copy]; _fabricIndex = controller.fabricIndex; - _deviceController = controller; _queue = dispatch_queue_create("org.csa-iot.matter.framework.device.workqueue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); _expectedValueCache = [NSMutableDictionary dictionary]; @@ -467,7 +461,7 @@ - (NSString *)description } return [NSString - stringWithFormat:@"", self, _deviceController.compressedFabricID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, vid, pid, wifi, thread, InternalDeviceStateString(internalDeviceState), static_cast(lastSubscriptionAttemptWait), static_cast(_asyncWorkQueue.itemCount), mostRecentReportTime, reportAge, lastSubscriptionFailureTime, subscriptionFailureAge, _deviceController.uniqueIdentifier]; + stringWithFormat:@"", self, _deviceController.compressedFabricID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, vid, pid, wifi, thread, InternalDeviceStateString(internalDeviceState), static_cast(lastSubscriptionAttemptWait), static_cast(_asyncWorkQueue.itemCount), mostRecentReportTime, reportAge, lastSubscriptionFailureTime, subscriptionFailureAge, _deviceController.uniqueIdentifier]; } + (MTRDevice *)deviceWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller diff --git a/src/darwin/Framework/CHIP/MTRDevice_Internal.h b/src/darwin/Framework/CHIP/MTRDevice_Internal.h index bce5abfdfed75d..b6a59ac9321d42 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDevice_Internal.h @@ -112,6 +112,14 @@ MTR_DIRECT_MEMBERS // Lock that protects overall device state, including delegate storage. os_unfair_lock _lock; NSMutableSet * _delegates; + + // Our node ID, with the ivar declared explicitly so it's accessible to + // subclasses. + NSNumber * _nodeID; + + // Our controller. Declared nullable because our property is, though in + // practice it does not look like we ever set it to nil. + MTRDeviceController * _Nullable _deviceController; } - (instancetype)initForSubclassesWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller; diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index 7dfb8da370823e..03f318d83517d7 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -93,6 +93,16 @@ - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceControlle return self; } +- (NSString *)description +{ + // TODO: Figure out whether, and if so how, to log: VID, PID, WiFi, Thread, + // internalDeviceState (do we even have such a thing here?), last + // subscription attempt wait (does that apply to us?) queued work (do we + // have any?), last report, last subscription failure (does that apply to us?). + return [NSString + stringWithFormat:@"", self, _deviceController.compressedFabricID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, _nodeID.unsignedLongLongValue, _deviceController.uniqueIdentifier]; +} + #pragma mark - Client Callbacks (MTRDeviceDelegate) // required methods for MTRDeviceDelegates From 329c965cc41ed39399a123587efb72639174571a Mon Sep 17 00:00:00 2001 From: sarthak shaha <130495524+Sarthak-Shaha@users.noreply.github.com> Date: Wed, 21 Aug 2024 14:15:25 -0400 Subject: [PATCH 39/52] removed invalid symlinks (#35129) --- .../esp32/external_platform/ESP32_custom/WiFiDnssdImpl.cpp | 1 - .../esp32/external_platform/ESP32_custom/WiFiDnssdImpl.h | 1 - 2 files changed, 2 deletions(-) delete mode 120000 examples/platform/esp32/external_platform/ESP32_custom/WiFiDnssdImpl.cpp delete mode 120000 examples/platform/esp32/external_platform/ESP32_custom/WiFiDnssdImpl.h diff --git a/examples/platform/esp32/external_platform/ESP32_custom/WiFiDnssdImpl.cpp b/examples/platform/esp32/external_platform/ESP32_custom/WiFiDnssdImpl.cpp deleted file mode 120000 index 6ca9fce6a3730d..00000000000000 --- a/examples/platform/esp32/external_platform/ESP32_custom/WiFiDnssdImpl.cpp +++ /dev/null @@ -1 +0,0 @@ -../../../../../src/platform/ESP32/WiFiDnssdImpl.cpp \ No newline at end of file diff --git a/examples/platform/esp32/external_platform/ESP32_custom/WiFiDnssdImpl.h b/examples/platform/esp32/external_platform/ESP32_custom/WiFiDnssdImpl.h deleted file mode 120000 index 213e49958733a8..00000000000000 --- a/examples/platform/esp32/external_platform/ESP32_custom/WiFiDnssdImpl.h +++ /dev/null @@ -1 +0,0 @@ -../../../../../src/platform/ESP32/WiFiDnssdImpl.h \ No newline at end of file From 68f0407592806c00b84ac3045c591e7287f3173e Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Wed, 21 Aug 2024 14:18:43 -0400 Subject: [PATCH 40/52] Update MCORE_FS_1_2 to latest testplan (#35097) --- src/python_testing/TC_MCORE_FS_1_2.py | 253 +++++++++++++++++--------- 1 file changed, 163 insertions(+), 90 deletions(-) diff --git a/src/python_testing/TC_MCORE_FS_1_2.py b/src/python_testing/TC_MCORE_FS_1_2.py index 1085b0fac0a07c..c199225b33f99c 100644 --- a/src/python_testing/TC_MCORE_FS_1_2.py +++ b/src/python_testing/TC_MCORE_FS_1_2.py @@ -19,27 +19,102 @@ # for details about the block below. # -import base64 +import hashlib import logging +import os import queue +import secrets +import signal +import struct +import subprocess import time +import uuid +from dataclasses import dataclass import chip.clusters as Clusters from chip import ChipDeviceCtrl -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from ecdsa.curves import NIST256p +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts from TC_SC_3_6 import AttributeChangeAccumulator +# Length of `w0s` and `w1s` elements +WS_LENGTH = NIST256p.baselen + 8 + + +def _generate_verifier(passcode: int, salt: bytes, iterations: int) -> bytes: + ws = hashlib.pbkdf2_hmac('sha256', struct.pack('>> pairing onnetwork 111 {setup_params.passcode}") + def steps_TC_MCORE_FS_1_2(self) -> list[TestStep]: - steps = [TestStep(1, "TH_FSA subscribes to all the Bridged Device Basic Information clusters provided by DUT_FSA to identify the presence of a Bridged Node endpoint with a UniqueID matching the UniqueID provided by the BasicInformationCluster of the TH_SED_DUT."), - TestStep(2, "TH_FSA initiates commissioning of TH_SED_DUT by sending the OpenCommissioningWindow command to the Administrator Commissioning Cluster on the endpoint with the uniqueID matching that of TH_SED_DUT."), - TestStep(3, "TH_FSA completes commissioning of TH_SED_DUT using the Enhanced Commissioning Method."), - TestStep(4, "Commission TH_SED_L onto DUT_FSAā€™s fabric using the manufacturer specified mechanism."), - TestStep(5, "TH_FSA waits for subscription report from a the Bridged Device Basic Information clusters provided by DUT_FSA to identify the presence of a Bridged Node endpoint with a UniqueID matching the UniqueID provided by the BasicInformationCluster of the TH_SED_L."), - TestStep(6, "TH_FSA initiates commissions of TH_SED_L by sending the OpenCommissioningWindow command to the Administrator Commissioning Cluster on the endpoint with the uniqueID matching that of TH_SED_L."), - TestStep(7, "TH_FSA completes commissioning of TH_SED_L using the Enhanced Commissioning Method.")] + steps = [TestStep(1, "TH subscribes to PartsList attribute of the Descriptor cluster of DUT_FSA endpoint 0."), + TestStep(2, "Follow manufacturer provided instructions to have DUT_FSA commission TH_SERVER"), + TestStep(3, "TH waits up to 30 seconds for subscription report from the PartsList attribute of the Descriptor to contain new endpoint"), + + TestStep(4, "TH uses DUT to open commissioning window to TH_SERVER"), + TestStep(5, "TH commissions TH_SERVER"), + TestStep(6, "TH reads all attributes in Basic Information cluster from TH_SERVER directly"), + TestStep(7, "TH reads all attributes in the Bridged Device Basic Information cluster on new endpoint identified in step 3 from the DUT_FSA")] return steps @property @@ -49,16 +124,21 @@ def default_timeout(self) -> int: @async_test_body async def test_TC_MCORE_FS_1_2(self): self.is_ci = self.check_pics('PICS_SDK_CI_ONLY') + min_report_interval_sec = self.user_params.get("min_report_interval_sec", 0) - max_report_interval_sec = self.user_params.get("max_report_interval_sec", 2) - report_waiting_timeout_delay_sec = self.user_params.get("report_waiting_timeout_delay_sec", 10) + max_report_interval_sec = self.user_params.get("max_report_interval_sec", 30) + th_server_port = self.user_params.get("th_server_port", 5543) + self._th_server_app_path = self.user_params.get("th_server_app_path", None) + if not self._th_server_app_path: + asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:') + if not os.path.exists(self._th_server_app_path): + asserts.fail(f'The path {self._th_server_app_path} does not exist') self.step(1) - - # Subscribe to the UniqueIDs - unique_id_queue = queue.Queue() + # Subscribe to the PartsList + root_endpoint = 0 subscription_contents = [ - (Clusters.BridgedDeviceBasicInformation.Attributes.UniqueID) # On all endpoints + (root_endpoint, Clusters.Descriptor.Attributes.PartsList) ] sub = await self.default_controller.ReadAttribute( nodeid=self.dut_node_id, @@ -66,82 +146,38 @@ async def test_TC_MCORE_FS_1_2(self): reportInterval=(min_report_interval_sec, max_report_interval_sec), keepSubscriptions=False ) + + parts_list_queue = queue.Queue() attribute_handler = AttributeChangeAccumulator( - name=self.default_controller.name, expected_attribute=Clusters.BridgedDeviceBasicInformation.Attributes.UniqueID, output=unique_id_queue) + name=self.default_controller.name, expected_attribute=Clusters.Descriptor.Attributes.PartsList, output=parts_list_queue) sub.SetAttributeUpdateCallback(attribute_handler) + cached_attributes = sub.GetAttributes() + step_1_dut_parts_list = cached_attributes[root_endpoint][Clusters.Descriptor][Clusters.Descriptor.Attributes.PartsList] - logging.info("Waiting for First BridgedDeviceBasicInformation.") - start_time = time.time() - elapsed = 0 - time_remaining = report_waiting_timeout_delay_sec - - th_sed_dut_bdbi_endpoint = -1 - th_sed_dut_unique_id = -1 - - while time_remaining > 0 and th_sed_dut_bdbi_endpoint < 0: - try: - item = unique_id_queue.get(block=True, timeout=time_remaining) - endpoint, attribute, value = item['endpoint'], item['attribute'], item['value'] - - # Record arrival of an expected subscription change when seen - if attribute == Clusters.BridgedDeviceBasicInformation.Attributes.UniqueID: - th_sed_dut_bdbi_endpoint = endpoint - th_sed_dut_unique_id = value - - except queue.Empty: - # No error, we update timeouts and keep going - pass - - elapsed = time.time() - start_time - time_remaining = report_waiting_timeout_delay_sec - elapsed - - asserts.assert_greater(th_sed_dut_bdbi_endpoint, 0, "Failed to find any BDBI instances with UniqueID present.") - logging.info("Found BDBI with UniqueID (%d) on endpoint %d." % th_sed_dut_unique_id, th_sed_dut_bdbi_endpoint) + asserts.assert_true(type_matches(step_1_dut_parts_list, list), "PartsList is expected to be a list") self.step(2) - - self.sync_passcode = 20202024 - self.th_sed_dut_discriminator = 2222 - cmd = Clusters.AdministratorCommissioning.Commands.OpenCommissioningWindow(commissioningTimeout=3*60, - PAKEPasscodeVerifier=b"+w1qZQR05Zn0bc2LDyNaDAhsrhDS5iRHPTN10+EmNx8E2OpIPC4SjWRDQVOgqcbnXdYMlpiZ168xLBqn1fx9659gGK/7f9Yc6GxpoJH8kwAUYAYyLGsYeEBt1kL6kpXjgA==", - discriminator=self.th_sed_dut_discriminator, - iterations=10000, salt=base64.b64encode(bytes('SaltyMcSalterson', 'utf-8'))) - await self.send_single_cmd(cmd, endpoint=th_sed_dut_bdbi_endpoint, timedRequestTimeoutMs=5000) - - logging.info("Commissioning Window open for TH_SED_DUT.") + setup_params = await self._create_th_server(th_server_port) + self._ask_for_vendor_commissioning_ux_operation(setup_params) self.step(3) - - self.th_sed_dut_nodeid = 1111 - await self.TH_server_controller.CommissionOnNetwork(nodeId=self.th_sed_dut_nodeid, setupPinCode=self.sync_passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.th_sed_dut_discriminator) - logging.info("Commissioning TH_SED_DUT complete") - - self.step(4) - if not self.is_ci: - self.wait_for_user_input( - "Commission TH_SED_DUT onto DUT_FSAā€™s fabric using the manufacturer specified mechanism. (ensure Synchronization is enabled.)") - else: - logging.info("Stopping after step 3 while running in CI to avoid manual steps.") - return - - self.step(5) - - th_sed_later_bdbi_endpoint = -1 - th_sed_later_unique_id = -1 - logging.info("Waiting for Second BridgedDeviceBasicInformation.") + report_waiting_timeout_delay_sec = 30 + logging.info("Waiting for update to PartsList.") start_time = time.time() elapsed = 0 time_remaining = report_waiting_timeout_delay_sec - while time_remaining > 0 and th_sed_later_bdbi_endpoint < 0: + parts_list_endpoint_count_from_step_1 = len(step_1_dut_parts_list) + step_3_dut_parts_list = None + while time_remaining > 0: try: - item = unique_id_queue.get(block=True, timeout=time_remaining) + item = parts_list_queue.get(block=True, timeout=time_remaining) endpoint, attribute, value = item['endpoint'], item['attribute'], item['value'] # Record arrival of an expected subscription change when seen - if attribute == Clusters.BridgedDeviceBasicInformation.Attributes.UniqueID and endpoint != th_sed_dut_bdbi_endpoint and th_sed_later_unique_id != th_sed_dut_unique_id: - th_sed_later_bdbi_endpoint = endpoint - th_sed_later_unique_id = value + if endpoint == root_endpoint and attribute == Clusters.Descriptor.Attributes.PartsList and len(value) > parts_list_endpoint_count_from_step_1: + step_3_dut_parts_list = value + break except queue.Empty: # No error, we update timeouts and keep going @@ -150,26 +186,63 @@ async def test_TC_MCORE_FS_1_2(self): elapsed = time.time() - start_time time_remaining = report_waiting_timeout_delay_sec - elapsed - asserts.assert_greater(th_sed_later_bdbi_endpoint, 0, "Failed to find any BDBI instances with UniqueID present.") - logging.info("Found another BDBI with UniqueID (%d) on endpoint %d." % th_sed_later_unique_id, th_sed_later_bdbi_endpoint) + asserts.assert_not_equal(step_3_dut_parts_list, None, "Timed out getting updated PartsList with new endpoint") + set_of_step_1_parts_list_endpoint = set(step_1_dut_parts_list) + set_of_step_3_parts_list_endpoint = set(step_3_dut_parts_list) + unique_endpoints_set = set_of_step_3_parts_list_endpoint - set_of_step_1_parts_list_endpoint + asserts.assert_equal(len(unique_endpoints_set), 1, "Expected only one new endpoint") + newly_added_endpoint = list(unique_endpoints_set)[0] - self.step(6) + self.step(4) - self.th_sed_later_discriminator = 3333 - # min commissioning timeout is 3*60 seconds, so use that even though the command said 30. + discriminator = 3840 + passcode = 20202021 + salt = secrets.token_bytes(16) + iterations = 2000 + verifier = _generate_verifier(passcode, salt, iterations) + + # min commissioning timeout is 3*60 seconds cmd = Clusters.AdministratorCommissioning.Commands.OpenCommissioningWindow(commissioningTimeout=3*60, - PAKEPasscodeVerifier=b"+w1qZQR05Zn0bc2LDyNaDAhsrhDS5iRHPTN10+EmNx8E2OpIPC4SjWRDQVOgqcbnXdYMlpiZ168xLBqn1fx9659gGK/7f9Yc6GxpoJH8kwAUYAYyLGsYeEBt1kL6kpXjgA==", - discriminator=self.th_sed_later_discriminator, - iterations=10000, salt=base64.b64encode(bytes('SaltyMcSalterson', 'utf-8'))) - await self.send_single_cmd(cmd, endpoint=th_sed_later_bdbi_endpoint, timedRequestTimeoutMs=5000) + PAKEPasscodeVerifier=verifier, + discriminator=discriminator, + iterations=iterations, + salt=salt) + await self.send_single_cmd(cmd, dev_ctrl=self.default_controller, node_id=self.dut_node_id, endpoint=newly_added_endpoint, timedRequestTimeoutMs=5000) - logging.info("Commissioning Window open for TH_SED_L.") + self.step(5) + self.th_server_local_nodeid = 1111 + await self.default_controller.CommissionOnNetwork(nodeId=self.th_server_local_nodeid, setupPinCode=passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=discriminator) - self.step(7) + self.step(6) + th_server_directly_read_result = await self.default_controller.ReadAttribute(self.th_server_local_nodeid, [(root_endpoint, Clusters.BasicInformation)]) + th_server_basic_info = th_server_directly_read_result[root_endpoint][Clusters.BasicInformation] - self.th_sed_later_nodeid = 2222 - await self.TH_server_controller.CommissionOnNetwork(nodeId=self.th_sed_later_nodeid, setupPinCode=self.sync_passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.th_sed_later_discriminator) - logging.info("Commissioning TH_SED_L complete") + self.step(7) + dut_read = await self.default_controller.ReadAttribute(self.dut_node_id, [(newly_added_endpoint, Clusters.BridgedDeviceBasicInformation)]) + bridged_info_for_th_server = dut_read[newly_added_endpoint][Clusters.BridgedDeviceBasicInformation] + basic_info_attr = Clusters.BasicInformation.Attributes + bridged_device_info_attr = Clusters.BridgedDeviceBasicInformation.Attributes + Clusters.BasicInformation.Attributes + asserts.assert_equal(th_server_basic_info[basic_info_attr.VendorName], + bridged_info_for_th_server[bridged_device_info_attr.VendorName], "VendorName incorrectly reported by DUT") + asserts.assert_equal(th_server_basic_info[basic_info_attr.VendorID], + bridged_info_for_th_server[bridged_device_info_attr.VendorID], "VendorID incorrectly reported by DUT") + asserts.assert_equal(th_server_basic_info[basic_info_attr.ProductName], + bridged_info_for_th_server[bridged_device_info_attr.ProductName], "ProductName incorrectly reported by DUT") + asserts.assert_equal(th_server_basic_info[basic_info_attr.ProductID], + bridged_info_for_th_server[bridged_device_info_attr.ProductID], "ProductID incorrectly reported by DUT") + asserts.assert_equal(th_server_basic_info[basic_info_attr.NodeLabel], + bridged_info_for_th_server[bridged_device_info_attr.NodeLabel], "NodeLabel incorrectly reported by DUT") + asserts.assert_equal(th_server_basic_info[basic_info_attr.HardwareVersion], + bridged_info_for_th_server[bridged_device_info_attr.HardwareVersion], "HardwareVersion incorrectly reported by DUT") + asserts.assert_equal(th_server_basic_info[basic_info_attr.HardwareVersionString], + bridged_info_for_th_server[bridged_device_info_attr.HardwareVersionString], "HardwareVersionString incorrectly reported by DUT") + asserts.assert_equal(th_server_basic_info[basic_info_attr.SoftwareVersion], + bridged_info_for_th_server[bridged_device_info_attr.SoftwareVersion], "SoftwareVersion incorrectly reported by DUT") + asserts.assert_equal(th_server_basic_info[basic_info_attr.SoftwareVersionString], + bridged_info_for_th_server[bridged_device_info_attr.SoftwareVersionString], "SoftwareVersionString incorrectly reported by DUT") + asserts.assert_equal(th_server_basic_info[basic_info_attr.UniqueID], + bridged_info_for_th_server[bridged_device_info_attr.UniqueID], "UniqueID incorrectly reported by DUT") if __name__ == "__main__": From fe20d1901a4991627ead3df3868ae5cce53358f8 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> Date: Wed, 21 Aug 2024 14:32:51 -0400 Subject: [PATCH 41/52] Removed Arithmetics operations relying on Unit test cluster from TC_S_2_2 and TC_S_2_3 (#35130) --- .../suites/certification/Test_TC_S_2_2.yaml | 33 ++----------------- .../suites/certification/Test_TC_S_2_3.yaml | 33 ++----------------- 2 files changed, 4 insertions(+), 62 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_S_2_2.yaml b/src/app/tests/suites/certification/Test_TC_S_2_2.yaml index bdb3d2b8ad90db..7e5121680ceffd 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_2.yaml @@ -50,36 +50,6 @@ tests: - name: "SceneTableSize" saveAs: maxScenes - - label: "Arithmetic operation to get the maxScenes - 1" - cluster: "Unit Testing" - command: "TestAddArguments" - arguments: - values: - - name: "arg1" - value: maxScenes - 1 - - name: "arg2" - value: 0 - response: - values: - - name: "returnValue" - saveAs: maxScenesMinusOne - value: maxScenes - 1 - - - label: "Arithmetic operation to get the fabric Capacity" - cluster: "Unit Testing" - command: "TestAddArguments" - arguments: - values: - - name: "arg1" - value: maxScenesMinusOne / 2 - - name: "arg2" - value: 0 - response: - values: - - name: "returnValue" - saveAs: fabricCapacity - value: maxScenesMinusOne / 2 - - label: "Step 0a :TH reads attribute {ServerList} from the Descriptor cluster of the endpoint that implements the Scenes Management server on the @@ -202,7 +172,8 @@ tests: - name: "Status" value: 0x00 - name: "Capacity" - value: fabricCapacity + value: (maxScenes - 1) / 2 + saveAs: fabricCapacity - name: "GroupID" value: G1 diff --git a/src/app/tests/suites/certification/Test_TC_S_2_3.yaml b/src/app/tests/suites/certification/Test_TC_S_2_3.yaml index 5a76916edb39b7..817ab532bad66c 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_3.yaml @@ -50,36 +50,6 @@ tests: - name: "SceneTableSize" saveAs: maxScenes - - label: "Arithmetic operation to get the maxScenes - 1" - cluster: "Unit Testing" - command: "TestAddArguments" - arguments: - values: - - name: "arg1" - value: maxScenes - 1 - - name: "arg2" - value: 0 - response: - values: - - name: "returnValue" - saveAs: maxScenesMinusOne - value: maxScenes - 1 - - - label: "Arithmetic operation to get the fabric Capacity" - cluster: "Unit Testing" - command: "TestAddArguments" - arguments: - values: - - name: "arg1" - value: maxScenesMinusOne / 2 - - name: "arg2" - value: 0 - response: - values: - - name: "returnValue" - saveAs: fabricCapacity - value: maxScenesMinusOne / 2 - - label: "Step 0a: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT using a key that is pre-installed on the TH. @@ -259,7 +229,8 @@ tests: - name: "Status" value: 0x00 - name: "Capacity" - value: fabricCapacity + value: (maxScenes - 1) / 2 + saveAs: fabricCapacity - name: "GroupID" value: G1 - name: "SceneList" From 85bdb2e05f3d9e48070710b064525b002f874725 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Wed, 21 Aug 2024 14:37:32 -0400 Subject: [PATCH 42/52] Add expiry to KeepActive as per spec into fabric-admin example (#35099) * Add expiry to KeepActive as per spec into fabric-admin example * Restyled by clang-format * Self Review fix * Restyled by clang-format * Name fix * Address PR comments * Address PR comments * Restyled by clang-format * Address PR comments --------- Co-authored-by: Restyled.io --- examples/fabric-admin/rpc/RpcServer.cpp | 52 +++++++++++++++++++------ 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/examples/fabric-admin/rpc/RpcServer.cpp b/examples/fabric-admin/rpc/RpcServer.cpp index d56399514ad96f..fca25c25a1301a 100644 --- a/examples/fabric-admin/rpc/RpcServer.cpp +++ b/examples/fabric-admin/rpc/RpcServer.cpp @@ -47,20 +47,32 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate public: void OnCheckInCompleted(const chip::app::ICDClientInfo & clientInfo) override { - chip::NodeId nodeId = clientInfo.peer_node.GetNodeId(); - auto it = mPendingKeepActiveTimesMs.find(nodeId); - VerifyOrReturn(it != mPendingKeepActiveTimesMs.end()); - // TODO(#33221): We also need a mechanism here to drop KeepActive - // request if they were recieved over 60 mins ago. - uint32_t stayActiveDurationMs = it->second; + // Needs for accessing mPendingCheckIn + assertChipStackLockedByCurrentThread(); + NodeId nodeId = clientInfo.peer_node.GetNodeId(); + auto it = mPendingCheckIn.find(nodeId); + VerifyOrReturn(it != mPendingCheckIn.end()); + + KeepActiveDataForCheckIn checkInData = it->second; + // Removed from pending map as check-in from this node has occured and we will handle the pending KeepActive + // request. + mPendingCheckIn.erase(nodeId); + + auto timeNow = System::SystemClock().GetMonotonicTimestamp(); + if (timeNow > checkInData.mRequestExpiryTimestamp) + { + ChipLogError( + NotSpecified, + "ICD check-in for device we have been waiting, came after KeepActive expiry. Reqeust dropped for Node ID: 0x%lx", + nodeId); + return; + } // TODO(#33221): If there is a failure in sending the message this request just gets dropped. // Work to see if there should be update to spec on whether some sort of failure later on // Should be indicated in some manner, or identify a better recovery mechanism here. - mPendingKeepActiveTimesMs.erase(nodeId); - auto onDone = [=](uint32_t promisedActiveDuration) { ActiveChanged(nodeId, promisedActiveDuration); }; - CHIP_ERROR err = StayActiveSender::SendStayActiveCommand(stayActiveDurationMs, clientInfo.peer_node, + CHIP_ERROR err = StayActiveSender::SendStayActiveCommand(checkInData.mStayActiveDurationMs, clientInfo.peer_node, chip::app::InteractionModelEngine::GetInstance(), onDone); if (err != CHIP_NO_ERROR) { @@ -147,10 +159,24 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate void ScheduleSendingKeepActiveOnCheckIn(chip::NodeId nodeId, uint32_t stayActiveDurationMs) { - mPendingKeepActiveTimesMs[nodeId] = stayActiveDurationMs; + // Needs for accessing mPendingCheckIn + assertChipStackLockedByCurrentThread(); + + auto timeNow = System::SystemClock().GetMonotonicTimestamp(); + // Spec says we should expire the request 60 mins after we get it + System::Clock::Timestamp expiryTimestamp = timeNow + System::Clock::Seconds64(60 * 60); + KeepActiveDataForCheckIn checkInData = { .mStayActiveDurationMs = stayActiveDurationMs, + .mRequestExpiryTimestamp = expiryTimestamp }; + mPendingCheckIn[nodeId] = checkInData; } private: + struct KeepActiveDataForCheckIn + { + uint32_t mStayActiveDurationMs = 0; + System::Clock::Timestamp mRequestExpiryTimestamp; + }; + struct KeepActiveWorkData { KeepActiveWorkData(FabricAdmin * fabricAdmin, chip::NodeId nodeId, uint32_t stayActiveDurationMs) : @@ -169,8 +195,10 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate chip::Platform::Delete(data); } - // Modifications to mPendingKeepActiveTimesMs should be done on the MatterEventLoop thread - std::map mPendingKeepActiveTimesMs; + // Modifications to mPendingCheckIn should be done on the MatterEventLoop thread + // otherwise we would need a mutex protecting this data to prevent race as this + // data is accessible by both RPC thread and Matter eventloop. + std::unordered_map mPendingCheckIn; }; FabricAdmin fabric_admin_service; From 6f22db05ca340fb001cc9a9ee58bf5fd37a5e5a1 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Wed, 21 Aug 2024 15:15:25 -0400 Subject: [PATCH 43/52] Move TC_BR_5 to the right directory (#35128) --- scripts/tests/chiptest/__init__.py | 2 +- .../Test_TC_BR_5.yaml} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename src/app/tests/suites/{TestFabricSyncBridgedNode.yaml => certification/Test_TC_BR_5.yaml} (96%) diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index d85e82fec6fa6c..aef22e030eae8d 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -157,7 +157,7 @@ def _GetInDevelopmentTests() -> Set[str]: # TestEventTriggersEnabled is true, which it's not in CI. "Test_TC_SMOKECO_2_6.yaml", # chip-repl does not support local timeout (07/20/2023) and test assumes # TestEventTriggersEnabled is true, which it's not in CI. - "TestFabricSyncBridgedNode.yaml", # [TODO] fabric-bridge-app lacks some feature so this test currently fails + "Test_TC_BR_5.yaml", # [TODO] Fabric Sync example app has not been integrated into CI yet. } diff --git a/src/app/tests/suites/TestFabricSyncBridgedNode.yaml b/src/app/tests/suites/certification/Test_TC_BR_5.yaml similarity index 96% rename from src/app/tests/suites/TestFabricSyncBridgedNode.yaml rename to src/app/tests/suites/certification/Test_TC_BR_5.yaml index 6624e710127442..958f98d076884f 100644 --- a/src/app/tests/suites/TestFabricSyncBridgedNode.yaml +++ b/src/app/tests/suites/certification/Test_TC_BR_5.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: Test Fabric Synchronization condition on Bridged Node Device Type +name: 3.1.5. [TC-BR-5] Conditions for Fabric Synchronization (DUT server) PICS: - MCORE.FS From 4d5beae7ecf5e4e1aa5423139e632e43228e91d5 Mon Sep 17 00:00:00 2001 From: Nivi Sarkar <55898241+nivi-apple@users.noreply.github.com> Date: Wed, 21 Aug 2024 13:03:36 -0700 Subject: [PATCH 44/52] =?UTF-8?q?Update=20the=20preset=20handle=20field=20?= =?UTF-8?q?in=20the=20SetActivePresetRequest=20c=E2=80=A6=20(#35105)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update the preset handle field in the SetActivePresetRequestRequest command to be nullable - Update the deleagte API for getting the active preset handle to return a nullable handle * Return error if CopySpanToMutableSpan fails * Restyled by clang-format * Apply suggestions from code review Co-authored-by: Boris Zbarsky --------- Co-authored-by: Restyled.io Co-authored-by: Boris Zbarsky --- .../air-purifier-app.matter | 2 +- .../all-clusters-app.matter | 2 +- .../all-clusters-minimal-app.matter | 2 +- ...umiditysensor_thermostat_56de3d5f45.matter | 2 +- ...tnode_heatingcoolingunit_ncdGai1E5a.matter | 2 +- ...tnode_roomairconditioner_9cf3607804.matter | 2 +- .../rootnode_thermostat_bm3fb8dhYi.matter | 2 +- .../placeholder/linux/apps/app1/config.matter | 4 +-- .../placeholder/linux/apps/app2/config.matter | 4 +-- .../linux/include/thermostat-delegate-impl.h | 2 +- .../linux/thermostat-delegate-impl.cpp | 14 +++++++++-- .../nxp/zap/thermostat_matter_thread.matter | 2 +- .../nxp/zap/thermostat_matter_wifi.matter | 2 +- .../qpg/zap/thermostaticRadiatorValve.matter | 2 +- .../thermostat-common/thermostat.matter | 2 +- .../thermostat-server/thermostat-delegate.h | 7 +++--- .../thermostat-server/thermostat-server.cpp | 25 ++++++++----------- .../data-model/chip/thermostat-cluster.xml | 2 +- .../data_model/controller-clusters.matter | 2 +- .../chip/devicecontroller/ChipClusters.java | 6 ++--- .../cluster/clusters/ThermostatCluster.kt | 4 +-- .../python/chip/clusters/Objects.py | 4 +-- .../zap-generated/MTRCommandPayloadsObjc.h | 2 +- .../zap-generated/MTRCommandPayloadsObjc.mm | 9 +++++-- .../zap-generated/cluster-objects.h | 4 +-- .../zap-generated/cluster/Commands.h | 6 ++++- 26 files changed, 65 insertions(+), 52 deletions(-) diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter index cb1c102b239f3e..c35b8b62e24ee6 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter @@ -1856,7 +1856,7 @@ cluster Thermostat = 513 { } request struct SetActivePresetRequestRequest { - octet_string<16> presetHandle = 0; + nullable octet_string<16> presetHandle = 0; } response struct AtomicResponse = 253 { diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index c18c6164c5c717..4180b1eef78e26 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -5696,7 +5696,7 @@ cluster Thermostat = 513 { } request struct SetActivePresetRequestRequest { - octet_string<16> presetHandle = 0; + nullable octet_string<16> presetHandle = 0; } response struct AtomicResponse = 253 { diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 16f170c1379591..363da41015d0b0 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -4130,7 +4130,7 @@ cluster Thermostat = 513 { } request struct SetActivePresetRequestRequest { - octet_string<16> presetHandle = 0; + nullable octet_string<16> presetHandle = 0; } response struct AtomicResponse = 253 { diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index ed130f29318062..d47b3a90922d57 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter @@ -1779,7 +1779,7 @@ cluster Thermostat = 513 { } request struct SetActivePresetRequestRequest { - octet_string<16> presetHandle = 0; + nullable octet_string<16> presetHandle = 0; } response struct AtomicResponse = 253 { diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index ec62d4504f8601..84b5d949b6eeba 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -2136,7 +2136,7 @@ cluster Thermostat = 513 { } request struct SetActivePresetRequestRequest { - octet_string<16> presetHandle = 0; + nullable octet_string<16> presetHandle = 0; } response struct AtomicResponse = 253 { diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter index 95e0ba20d4adcb..20b7d6b80d35f5 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -1719,7 +1719,7 @@ cluster Thermostat = 513 { } request struct SetActivePresetRequestRequest { - octet_string<16> presetHandle = 0; + nullable octet_string<16> presetHandle = 0; } response struct AtomicResponse = 253 { diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 6c27235c7d3ade..ae6441c2eaebea 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -1939,7 +1939,7 @@ cluster Thermostat = 513 { } request struct SetActivePresetRequestRequest { - octet_string<16> presetHandle = 0; + nullable octet_string<16> presetHandle = 0; } response struct AtomicResponse = 253 { diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 8befb87daa5f9a..33521a7a93fa75 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -5414,7 +5414,7 @@ cluster Thermostat = 513 { } request struct SetActivePresetRequestRequest { - octet_string<16> presetHandle = 0; + nullable octet_string<16> presetHandle = 0; } response struct AtomicResponse = 253 { @@ -5769,7 +5769,7 @@ cluster Thermostat = 513 { } request struct SetActivePresetRequestRequest { - octet_string<16> presetHandle = 0; + nullable octet_string<16> presetHandle = 0; } response struct AtomicResponse = 253 { diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 6cfcc1ab7ea6cf..86d20b24a4f629 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -5371,7 +5371,7 @@ cluster Thermostat = 513 { } request struct SetActivePresetRequestRequest { - octet_string<16> presetHandle = 0; + nullable octet_string<16> presetHandle = 0; } response struct AtomicResponse = 253 { @@ -5726,7 +5726,7 @@ cluster Thermostat = 513 { } request struct SetActivePresetRequestRequest { - octet_string<16> presetHandle = 0; + nullable octet_string<16> presetHandle = 0; } response struct AtomicResponse = 253 { diff --git a/examples/thermostat/linux/include/thermostat-delegate-impl.h b/examples/thermostat/linux/include/thermostat-delegate-impl.h index 8252f2274f9d79..6bf9d02cea462f 100644 --- a/examples/thermostat/linux/include/thermostat-delegate-impl.h +++ b/examples/thermostat/linux/include/thermostat-delegate-impl.h @@ -54,7 +54,7 @@ class ThermostatDelegate : public Delegate CHIP_ERROR GetPresetAtIndex(size_t index, PresetStructWithOwnedMembers & preset) override; - CHIP_ERROR GetActivePresetHandle(MutableByteSpan & activePresetHandle) override; + CHIP_ERROR GetActivePresetHandle(DataModel::Nullable & activePresetHandle) override; CHIP_ERROR SetActivePresetHandle(const DataModel::Nullable & newActivePresetHandle) override; diff --git a/examples/thermostat/linux/thermostat-delegate-impl.cpp b/examples/thermostat/linux/thermostat-delegate-impl.cpp index c39a757a8b0644..b931db20b7c4f7 100644 --- a/examples/thermostat/linux/thermostat-delegate-impl.cpp +++ b/examples/thermostat/linux/thermostat-delegate-impl.cpp @@ -117,9 +117,19 @@ CHIP_ERROR ThermostatDelegate::GetPresetAtIndex(size_t index, PresetStructWithOw return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; } -CHIP_ERROR ThermostatDelegate::GetActivePresetHandle(MutableByteSpan & activePresetHandle) +CHIP_ERROR ThermostatDelegate::GetActivePresetHandle(DataModel::Nullable & activePresetHandle) { - return CopySpanToMutableSpan(ByteSpan(mActivePresetHandleData, mActivePresetHandleDataSize), activePresetHandle); + if (mActivePresetHandleDataSize != 0) + { + ReturnErrorOnFailure( + CopySpanToMutableSpan(ByteSpan(mActivePresetHandleData, mActivePresetHandleDataSize), activePresetHandle.Value())); + activePresetHandle.Value().reduce_size(mActivePresetHandleDataSize); + } + else + { + activePresetHandle.SetNull(); + } + return CHIP_NO_ERROR; } CHIP_ERROR ThermostatDelegate::SetActivePresetHandle(const DataModel::Nullable & newActivePresetHandle) diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index 001e1b43ace09d..cbe6a6280d8ec4 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -2530,7 +2530,7 @@ cluster Thermostat = 513 { } request struct SetActivePresetRequestRequest { - octet_string<16> presetHandle = 0; + nullable octet_string<16> presetHandle = 0; } response struct AtomicResponse = 253 { diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index 066afc85509947..cd9ddc362e36ce 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -2441,7 +2441,7 @@ cluster Thermostat = 513 { } request struct SetActivePresetRequestRequest { - octet_string<16> presetHandle = 0; + nullable octet_string<16> presetHandle = 0; } response struct AtomicResponse = 253 { diff --git a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter index 31e5775d88148f..548db02c520b9a 100644 --- a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter +++ b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter @@ -2138,7 +2138,7 @@ cluster Thermostat = 513 { } request struct SetActivePresetRequestRequest { - octet_string<16> presetHandle = 0; + nullable octet_string<16> presetHandle = 0; } response struct AtomicResponse = 253 { diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index c53651c537894e..a66c2dfdad68ba 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -2318,7 +2318,7 @@ cluster Thermostat = 513 { } request struct SetActivePresetRequestRequest { - octet_string<16> presetHandle = 0; + nullable octet_string<16> presetHandle = 0; } response struct AtomicResponse = 253 { diff --git a/src/app/clusters/thermostat-server/thermostat-delegate.h b/src/app/clusters/thermostat-server/thermostat-delegate.h index c8c21d898af167..0f89f69468099b 100644 --- a/src/app/clusters/thermostat-server/thermostat-delegate.h +++ b/src/app/clusters/thermostat-server/thermostat-delegate.h @@ -78,11 +78,10 @@ class Delegate /** * @brief Get the ActivePresetHandle attribute value. * - * @param[out] activePresetHandle The MutableByteSpan to copy the active preset handle into. On success, - * the callee must update the length to the length of the copied data. If the value of - * the attribute is null, the callee must set the MutableByteSpan to empty. + * @param[out] activePresetHandle The nullable MutableByteSpan to copy the active preset handle into. On success, + * the size of the activePresetHandle is updated to the length of the copied data. */ - virtual CHIP_ERROR GetActivePresetHandle(MutableByteSpan & activePresetHandle) = 0; + virtual CHIP_ERROR GetActivePresetHandle(DataModel::Nullable & activePresetHandle) = 0; /** * @brief Set the ActivePresetHandle attribute value. diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp index 91c045c5ff540e..8fe70211eeda1a 100644 --- a/src/app/clusters/thermostat-server/thermostat-server.cpp +++ b/src/app/clusters/thermostat-server/thermostat-server.cpp @@ -761,19 +761,13 @@ CHIP_ERROR ThermostatAttrAccess::Read(const ConcreteReadAttributePath & aPath, A VerifyOrReturnError(delegate != nullptr, CHIP_ERROR_INCORRECT_STATE, ChipLogError(Zcl, "Delegate is null")); uint8_t buffer[kPresetHandleSize]; - MutableByteSpan activePresetHandle(buffer); + MutableByteSpan activePresetHandleSpan(buffer); + auto activePresetHandle = DataModel::MakeNullable(activePresetHandleSpan); CHIP_ERROR err = delegate->GetActivePresetHandle(activePresetHandle); ReturnErrorOnFailure(err); - if (activePresetHandle.empty()) - { - ReturnErrorOnFailure(aEncoder.EncodeNull()); - } - else - { - ReturnErrorOnFailure(aEncoder.Encode(activePresetHandle)); - } + ReturnErrorOnFailure(aEncoder.Encode(activePresetHandle)); } break; case ScheduleTypes::Id: { @@ -1299,16 +1293,16 @@ bool emberAfThermostatClusterSetActivePresetRequestCallback( return true; } - ByteSpan newPresetHandle = commandData.presetHandle; + DataModel::Nullable newPresetHandle = commandData.presetHandle; // If the preset handle passed in the command is not present in the Presets attribute, return INVALID_COMMAND. - if (!IsPresetHandlePresentInPresets(delegate, newPresetHandle)) + if (!newPresetHandle.IsNull() && !IsPresetHandlePresentInPresets(delegate, newPresetHandle.Value())) { commandObj->AddStatus(commandPath, imcode::InvalidCommand); return true; } - CHIP_ERROR err = delegate->SetActivePresetHandle(DataModel::MakeNullable(newPresetHandle)); + CHIP_ERROR err = delegate->SetActivePresetHandle(newPresetHandle); if (err != CHIP_NO_ERROR) { @@ -1470,7 +1464,8 @@ imcode commitPresets(Delegate * delegate, EndpointId endpoint) // attribute. If a preset is not found with the same presetHandle, return INVALID_IN_STATE. If there is no ActivePresetHandle // attribute set, continue with other checks. uint8_t buffer[kPresetHandleSize]; - MutableByteSpan activePresetHandle(buffer); + MutableByteSpan activePresetHandleSpan(buffer); + auto activePresetHandle = DataModel::MakeNullable(activePresetHandleSpan); err = delegate->GetActivePresetHandle(activePresetHandle); @@ -1479,9 +1474,9 @@ imcode commitPresets(Delegate * delegate, EndpointId endpoint) return imcode::InvalidInState; } - if (!activePresetHandle.empty()) + if (!activePresetHandle.IsNull()) { - uint8_t count = CountPresetsInPendingListWithPresetHandle(delegate, activePresetHandle); + uint8_t count = CountPresetsInPendingListWithPresetHandle(delegate, activePresetHandle.Value()); if (count == 0) { return imcode::InvalidInState; diff --git a/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml index 546692b1a42030..6f75aa45e985f6 100644 --- a/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/thermostat-cluster.xml @@ -481,7 +481,7 @@ limitations under the License. ID - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index bfb1354849c9c4..52f43c048aed14 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -6994,7 +6994,7 @@ cluster Thermostat = 513 { } request struct SetActivePresetRequestRequest { - octet_string<16> presetHandle = 0; + nullable octet_string<16> presetHandle = 0; } response struct AtomicResponse = 253 { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 6f3e6f62d340e7..cf344db593f46a 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -40637,16 +40637,16 @@ public void onResponse(StructType invokeStructValue) { }}, commandId, commandArgs, timedInvokeTimeoutMs); } - public void setActivePresetRequest(DefaultClusterCallback callback, byte[] presetHandle) { + public void setActivePresetRequest(DefaultClusterCallback callback, @Nullable byte[] presetHandle) { setActivePresetRequest(callback, presetHandle, 0); } - public void setActivePresetRequest(DefaultClusterCallback callback, byte[] presetHandle, int timedInvokeTimeoutMs) { + public void setActivePresetRequest(DefaultClusterCallback callback, @Nullable byte[] presetHandle, int timedInvokeTimeoutMs) { final long commandId = 6L; ArrayList elements = new ArrayList<>(); final long presetHandleFieldID = 0L; - BaseTLVType presetHandletlvValue = new ByteArrayType(presetHandle); + BaseTLVType presetHandletlvValue = presetHandle != null ? new ByteArrayType(presetHandle) : new NullType(); elements.add(new StructElement(presetHandleFieldID, presetHandletlvValue)); StructType commandArgs = new StructType(elements); diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatCluster.kt index b9166c12e937a1..6f193e694ef34f 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatCluster.kt @@ -504,7 +504,7 @@ class ThermostatCluster(private val controller: MatterController, private val en } suspend fun setActivePresetRequest( - presetHandle: ByteArray, + presetHandle: ByteArray?, timedInvokeTimeout: Duration? = null, ) { val commandId: UInt = 6u @@ -513,7 +513,7 @@ class ThermostatCluster(private val controller: MatterController, private val en tlvWriter.startStructure(AnonymousTag) val TAG_PRESET_HANDLE_REQ: Int = 0 - tlvWriter.put(ContextSpecificTag(TAG_PRESET_HANDLE_REQ), presetHandle) + presetHandle?.let { tlvWriter.put(ContextSpecificTag(TAG_PRESET_HANDLE_REQ), presetHandle) } tlvWriter.endStructure() val request: InvokeRequest = diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 6b8ecd1c82b577..624f42c8e80088 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -33168,10 +33168,10 @@ class SetActivePresetRequest(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="presetHandle", Tag=0, Type=bytes), + ClusterObjectFieldDescriptor(Label="presetHandle", Tag=0, Type=typing.Union[Nullable, bytes]), ]) - presetHandle: 'bytes' = b"" + presetHandle: 'typing.Union[Nullable, bytes]' = NullValue @dataclass class AtomicResponse(ClusterCommand): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 5c869616268ecc..a5934b16975260 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -7929,7 +7929,7 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRThermostatClusterSetActivePresetRequestParams : NSObject -@property (nonatomic, copy) NSData * _Nonnull presetHandle MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSData * _Nullable presetHandle MTR_PROVISIONALLY_AVAILABLE; /** * Controls whether the command is a timed command (using Timed Invoke). * diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 1334d8beba2654..5ae975508e9b75 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -22697,7 +22697,7 @@ - (instancetype)init { if (self = [super init]) { - _presetHandle = [NSData data]; + _presetHandle = nil; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -22730,7 +22730,12 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader chip::app::Clusters::Thermostat::Commands::SetActivePresetRequest::Type encodableStruct; ListFreer listFreer; { - encodableStruct.presetHandle = AsByteSpan(self.presetHandle); + if (self.presetHandle == nil) { + encodableStruct.presetHandle.SetNull(); + } else { + auto & nonNullValue_0 = encodableStruct.presetHandle.SetNonNull(); + nonNullValue_0 = AsByteSpan(self.presetHandle); + } } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); 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 e18b64797bb595..c2c1697ce271f3 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 @@ -30149,7 +30149,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::SetActivePresetRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - chip::ByteSpan presetHandle; + DataModel::Nullable presetHandle; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -30164,7 +30164,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::SetActivePresetRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - chip::ByteSpan presetHandle; + DataModel::Nullable presetHandle; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace SetActivePresetRequest 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 004bb29c546d1e..dc438df840c885 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -107995,7 +107995,11 @@ class ThermostatSetActivePresetRequest : public ClusterCommand { __auto_type * params = [[MTRThermostatClusterSetActivePresetRequestParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; #if MTR_ENABLE_PROVISIONAL - params.presetHandle = [NSData dataWithBytes:mRequest.presetHandle.data() length:mRequest.presetHandle.size()]; + if (mRequest.presetHandle.IsNull()) { + params.presetHandle = nil; + } else { + params.presetHandle = [NSData dataWithBytes:mRequest.presetHandle.Value().data() length:mRequest.presetHandle.Value().size()]; + } #endif // MTR_ENABLE_PROVISIONAL uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; From 2302c57932101f880df969cd7907d905ef33f467 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Wed, 21 Aug 2024 13:05:25 -0700 Subject: [PATCH 45/52] Fix fabric-bridge is accidentally added into sync list (#35132) --- .../commands/pairing/DeviceSynchronization.cpp | 6 +++++- examples/fabric-admin/device_manager/DeviceManager.h | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/examples/fabric-admin/commands/pairing/DeviceSynchronization.cpp b/examples/fabric-admin/commands/pairing/DeviceSynchronization.cpp index 3974761fdc4bc2..69ca9cdb722b23 100644 --- a/examples/fabric-admin/commands/pairing/DeviceSynchronization.cpp +++ b/examples/fabric-admin/commands/pairing/DeviceSynchronization.cpp @@ -24,6 +24,7 @@ #include #include +#include using namespace ::chip; using namespace ::chip::app; @@ -120,7 +121,10 @@ void DeviceSynchronizer::OnReportEnd() { // Report end is at the end of all attributes (success) #if defined(PW_RPC_ENABLED) - AddSynchronizedDevice(mCurrentDeviceData); + if (!DeviceMgr().IsCurrentBridgeDevice(mCurrentDeviceData.node_id)) + { + AddSynchronizedDevice(mCurrentDeviceData); + } #else ChipLogError(NotSpecified, "Cannot synchronize device with fabric bridge: RPC not enabled"); #endif diff --git a/examples/fabric-admin/device_manager/DeviceManager.h b/examples/fabric-admin/device_manager/DeviceManager.h index 1fb2ad52249938..fa94f3d09d18cf 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.h +++ b/examples/fabric-admin/device_manager/DeviceManager.h @@ -75,6 +75,15 @@ class DeviceManager : public PairingDelegate void RemoveSyncedDevice(chip::NodeId nodeId); + /** + * @brief Determines whether a given nodeId corresponds to the "current bridge device," either local or remote. + * + * @param nodeId The ID of the node being checked. + * + * @return true if the nodeId matches either the local or remote bridge device; otherwise, false. + */ + bool IsCurrentBridgeDevice(chip::NodeId nodeId) const { return nodeId == mLocalBridgeNodeId || nodeId == mRemoteBridgeNodeId; } + /** * @brief Open the commissioning window for a specific device within its own fabric. * From 3cdef41e1d548bb0eeccc647a5c4ff64874936cd Mon Sep 17 00:00:00 2001 From: Harshith-GRL <145322529+Harshith-GRL@users.noreply.github.com> Date: Thu, 22 Aug 2024 02:21:57 +0530 Subject: [PATCH 46/52] Yaml scripts update (#35093) * Removed scripts Test_TC_SC_4_10.yaml and Test_TC_SC_4_5.yaml as Test plan have removed them * step numbers corrected in Test_TC_CC_7_3.yaml and action id is updated in Test_TC_ACT_3_2.yaml * Removed scripts Test_TC_SC_4_10.yaml and Test_TC_SC_4_5.yaml as Test plan have removed them * step numbers corrected in Test_TC_CC_7_3.yaml and action id is updated in Test_TC_ACT_3_2.yaml * Reverted Action of Test_TC_ACT_3_2.yaml --- .../suites/certification/Test_TC_ACT_3_2.yaml | 6 +- .../suites/certification/Test_TC_CC_7_3.yaml | 20 ++-- .../suites/certification/Test_TC_SC_4_10.yaml | 60 ------------ .../suites/certification/Test_TC_SC_4_5.yaml | 92 ------------------- 4 files changed, 13 insertions(+), 165 deletions(-) delete mode 100644 src/app/tests/suites/certification/Test_TC_SC_4_10.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_SC_4_5.yaml diff --git a/src/app/tests/suites/certification/Test_TC_ACT_3_2.yaml b/src/app/tests/suites/certification/Test_TC_ACT_3_2.yaml index 914718896d97ca..cc409a67c6611d 100644 --- a/src/app/tests/suites/certification/Test_TC_ACT_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACT_3_2.yaml @@ -33,7 +33,7 @@ tests: "Step 0: Preparation: TH as server exposes an Actions server cluster on EP 1, with one action (supporting all possible commands) and corresponding ActionLists and EndpointLists attributes: ActionList: - contains one list element (ActionListStruct): ActionIO = 0x1001 Name + contains one list element (ActionListStruct): ActionIO = 0xA001 Name = 'some test' Type = other EndpointListID = 0xE001 SupportedCommands = 0x0fff // suppports all commands State = Inactive EndpointLists: contains one list element @@ -92,13 +92,13 @@ tests: 2. Use the above obtained ActionID to verify the following commands - ./chip-tool actions instant-action 4097 1 1 + ./chip-tool actions instant-action 40961 1 1 disabled: true - label: "Step 1: DUT issues an InstantAction command to TH" PICS: ACT.C.C00.Tx verification: | - ./chip-tool actions instant-action 4097 1 1 + ./chip-tool actions instant-action 40961 1 1 Via the TH (bridge-app), verify the InstantAction response that contains ActionID . diff --git a/src/app/tests/suites/certification/Test_TC_CC_7_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_7_3.yaml index bfdfd26ed3ca1a..4aae05d10fd1cd 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_7_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_7_3.yaml @@ -162,7 +162,7 @@ tests: maxValue: 13800 - label: - "Step 5a: TH sends EnhancedMoveToHue command to DUT with + "Step 3a: TH sends EnhancedMoveToHue command to DUT with EnhancedHue=12000, Direction=0x00 (shortest distance) and TransitionTime=0 (immediately)." PICS: CC.S.F01 && CC.S.C40.Rsp @@ -190,7 +190,7 @@ tests: value: 100 - label: - "Step 5b: TH sends EnhancedStepHue command to DUT with StepMode=0x03 + "Step 3b: TH sends EnhancedStepHue command to DUT with StepMode=0x03 (down), StepSize=6000 and TransitionTime=300 (30s)" PICS: CC.S.F01 && CC.S.C42.Rsp command: "EnhancedStepHue" @@ -216,7 +216,7 @@ tests: - name: "ms" value: 10000 - - label: "Step 5c: TH reads EnhancedCurrentHue attribute from DUT" + - label: "Step 3c: TH reads EnhancedCurrentHue attribute from DUT" command: "readAttribute" PICS: CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp attribute: "EnhancedCurrentHue" @@ -234,7 +234,7 @@ tests: - name: "ms" value: 10000 - - label: "Step 2d: TH reads EnhancedCurrentHue attribute from DUT" + - label: "Step 3d: TH reads EnhancedCurrentHue attribute from DUT" command: "readAttribute" PICS: CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp attribute: "EnhancedCurrentHue" @@ -252,7 +252,7 @@ tests: - name: "ms" value: 10000 - - label: "Step 2e: TH reads EnhancedCurrentHue attribute from DUT" + - label: "Step 3e: TH reads EnhancedCurrentHue attribute from DUT" command: "readAttribute" PICS: CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp attribute: "EnhancedCurrentHue" @@ -270,7 +270,7 @@ tests: - name: "ms" value: 5000 - - label: "Step 2f: TH reads EnhancedCurrentHue attribute from DUT" + - label: "Step 3f: TH reads EnhancedCurrentHue attribute from DUT" command: "readAttribute" PICS: CC.S.F01 && CC.S.A4000 && CC.S.C41.Rsp attribute: "EnhancedCurrentHue" @@ -279,7 +279,7 @@ tests: minValue: 5100 maxValue: 6900 - - label: "Step 6a: TH reads ColorMode attribute from DUT" + - label: "Step 4a: TH reads ColorMode attribute from DUT" PICS: CC.S.F01 && CC.S.A0008 command: "readAttribute" attribute: "ColorMode" @@ -289,7 +289,7 @@ tests: minValue: 0 maxValue: 2 - - label: "Step 6b: TH reads EnhancedColorMode attribute from DUT" + - label: "Step 4b: TH reads EnhancedColorMode attribute from DUT" PICS: CC.S.F01 && CC.S.A4001 command: "readAttribute" attribute: "EnhancedColorMode" @@ -300,7 +300,7 @@ tests: maxValue: 3 - label: - "Step 7a: TH sends EnhancedStepHue command to DUT with StepMode=0x01 + "Step 5a: TH sends EnhancedStepHue command to DUT with StepMode=0x01 (up), StepSize=0" PICS: CC.S.F01 && CC.S.C42.Rsp command: "EnhancedStepHue" @@ -320,7 +320,7 @@ tests: error: INVALID_COMMAND - label: - "Step 7b: TH sends EnhancedStepHue command to DUT with StepMode=0x03 + "Step 5b: TH sends EnhancedStepHue command to DUT with StepMode=0x03 (down), StepSize=0" PICS: CC.S.F01 && CC.S.C42.Rsp command: "EnhancedStepHue" diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_10.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_10.yaml deleted file mode 100644 index 987bc6279093a8..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_SC_4_10.yaml +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: - 15.4.10. [TC-SC-4.10] Operational Discovery - SIT ICD Node - [{DUT_Commissionee}] - -PICS: - - MCORE.ROLE.COMMISSIONEE - - MCORE.SC.SED - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Precondition" - verification: | - 1. Nodes are joined in the same Fabric - 2. DUT is a sleepy device (MCORE.SC.SED) - disabled: true - - - label: "Step 1: DUT is instructed to advertise its service" - verification: | - 1. Provision the DUT by TH (Chip-tool) - disabled: true - - - label: "Step 2: TH scans for DNS-SD advertising" - verification: | - avahi-browse -rt _matter._tcp - On the TH(Chip-tool) Log: Verify the DUT is advertising for: - - SII key is higher than the SESSION_IDLE_INTERVAL default value (> 500 milliseconds) - - SII key and SAI key is less than 3600000 (1hour in milliseconds) - - + eth0 IPv6 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local - + eth0 IPv4 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local - = eth0 IPv4 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local - hostname = [D21165B5F440B033.local] - address = [fd11:22::4b31:9932:cffe:b41a] - port = [5540] - txt = ["T=0" "SAI=300" "SII=5000" "SAT=4000"] - = eth0 IPv6 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local - hostname = [D21165B5F440B033.local] - address = [fd11:22::4b31:9932:cffe:b41a] - port = [5540] - txt = ["T=0" "SAI=300" "SII=5000"] - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_5.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_5.yaml deleted file mode 100644 index a3ba4b4f41ab1d..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_SC_4_5.yaml +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 15.4.5. [TC-SC-4.5] Discovery [DUT as Commissionee][Thread] - -PICS: - - MCORE.ROLE.COMMISSIONEE - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: - "Step 1: TH is instructed to start advertising two or more services - using DNS-SD" - verification: | - 1. On the raspi controller, publish matter service, using below command - - $avahi-publish-service 87E1B004E235A130-8FC7772401CD0696 _matter._tcp 22222 SII=3000 SAI=4000 T=0 - disabled: true - - - label: - "Step 2: By any means, DUT is instructed to perform an unicast UDP - query to the DNS-SD Discovery Proxy on TH for services" - PICS: - MCORE.SC.SII_OP_DISCOVERY_KEY && MCORE.SC.SAI_OP_DISCOVERY_KEY && - MCORE.SC.T_KEY - verification: | - avahi-browse -rt _matter._tcp - - Verify advertisement on the TH Log: - - + eth0 IPv6 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local - + eth0 IPv4 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local - = eth0 IPv4 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local - hostname = [D21165B5F440B033.local] - address = [fd11:22::4b31:9932:cffe:b41a] - port = [5540] - txt = ["T=0" "SAI=300" "SII=5000"] - = eth0 IPv6 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local - hostname = [D21165B5F440B033.local] - address = [fd11:22::4b31:9932:cffe:b41a] - port = [5540] - txt = ["T=0" "SAI=300" "SII=5000"] - disabled: true - - - label: - "Step 3: TH performs a change in one of the services configured at - step 1" - verification: | - 1. On the raspi controller, publish matter service chanding the T value 1, using below command - - $avahi-publish-service 87E1B004E235A130-8FC7772401CD0696 _matter._tcp 22222 SII=3000 SAI=4000 T=1 - disabled: true - - - label: "Step 4: DUT must receive a notification with new data" - PICS: - MCORE.SC.SII_OP_DISCOVERY_KEY && MCORE.SC.SAI_OP_DISCOVERY_KEY && - MCORE.SC.T_KEY - verification: | - avahi-browse -rt _matter._tcp - - - Verify advertisement on the TH Log: - - + eth0 IPv6 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local - + eth0 IPv4 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local - = eth0 IPv4 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local - hostname = [D21165B5F440B033.local] - address = [fd11:22::4b31:9932:cffe:b41a] - port = [5540] - txt = ["T=1" "SAI=300" "SII=5000"] - = eth0 IPv6 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local - hostname = [D21165B5F440B033.local] - address = [fd11:22::4b31:9932:cffe:b41a] - port = [5540] - txt = ["T=1" "SAI=300" "SII=5000"] - disabled: true From 03a14efa717c6ce729245ed227daf88de7d97e2a Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Wed, 21 Aug 2024 14:24:06 -0700 Subject: [PATCH 47/52] [Darwin] XPC interface for invoke needs to take into account the reply may contain non-property-list objects (#35131) --- .../Framework/CHIP/MTRDeviceController_XPC.mm | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index 31acadcce576d3..7111aa4eb7f2bd 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -43,6 +43,21 @@ @implementation MTRDeviceController_XPC @synthesize uniqueIdentifier = _uniqueIdentifier; +- (NSXPCInterface *)_interfaceForServerProtocol +{ + NSXPCInterface * interface = [NSXPCInterface interfaceWithProtocol:@protocol(MTRXPCServerProtocol)]; + + NSSet * allowedClasses = [NSSet setWithArray:@[ + [NSString class], [NSNumber class], [NSData class], [NSArray class], [NSDictionary class], [NSError class], [MTRCommandPath class], [MTRAttributePath class] + ]]; + + [interface setClasses:allowedClasses + forSelector:@selector(deviceController:nodeID:invokeCommandWithEndpointID:clusterID:commandID:commandFields:expectedValues:expectedValueInterval:timedInvokeTimeout:completion:) + argumentIndex:0 + ofReply:YES]; + return interface; +} + - (NSXPCInterface *)_interfaceForClientProtocol { NSXPCInterface * interface = [NSXPCInterface interfaceWithProtocol:@protocol(MTRXPCClientProtocol)]; @@ -84,7 +99,7 @@ - (id)initWithUniqueIdentifier:(NSUUID *)UUID xpConnectionBlock:(NSXPCConnection MTR_LOG("Set up XPC Connection: %@", self.xpcConnection); if (self.xpcConnection) { - self.xpcConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MTRXPCServerProtocol)]; + self.xpcConnection.remoteObjectInterface = [self _interfaceForServerProtocol]; self.xpcConnection.exportedInterface = [self _interfaceForClientProtocol]; self.xpcConnection.exportedObject = self; @@ -118,9 +133,9 @@ - (id)initWithUniqueIdentifier:(NSUUID *)UUID machServiceName:(NSString *)machSe MTR_LOG("Set up XPC Connection: %@", self.xpcConnection); if (self.xpcConnection) { - self.xpcConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MTRXPCServerProtocol)]; + self.xpcConnection.remoteObjectInterface = [self _interfaceForServerProtocol]; - self.xpcConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MTRXPCClientProtocol)]; + self.xpcConnection.exportedInterface = [self _interfaceForClientProtocol]; self.xpcConnection.exportedObject = self; MTR_LOG("%s: resuming new XPC connection"); From 62bf76b142208dd8b8b5bfb15a6daacd930415b1 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 21 Aug 2024 19:41:16 -0400 Subject: [PATCH 48/52] Fix Darwin to handle renames of Color Control data types. (#35135) https://github.com/project-chip/connectedhomeip/pull/33612 made the following changes to the Color Control cluster: 1) Renamed HueDirection to DirectionEnum 2) Renamed the ShortestDistance and LongestDistance values of DirectionEnum to Shortest and Longest, respectively. 3) Renamed HueMoveMode to MoveModeEnum. 4) Renamed HueStepMode to StepModeEnum. 5) Removed SaturationMoveMode in favor of MoveModeEnum. 6) Removed SaturationStepMode in favor of StepModeEnum. 7) Renamed ColorMode to ColorModeEnum. 8) Renamed the ColorTemperature value to ColorTemperatureMireds 8) Renamed ColorCapabilities to ColorCapabilitiesBitmap. 9) Renamed various fields of ColorCapabilitiesBitmap. 10) Renamed ColorLoopUpdateFlags to UpdateFlagsBitmap. 11) Renamed ColorLoopAction to ColorLoopActionEnum. 12) Added OptionsBitmap, EnhancedColorModeEnum, DriftCompensationEnum. 13) Renamed ColorLoopDirection to ColorLoopDirectionEnum. 14) Renamed the DecrementHue and IncrementHue values of ColorLoopDirectionEnum to Decrement and Increment, respectively. This change adds the right renamed/introduced/deprecated annotations for the above changes, and adds manual shims for the enums that got removed. --- .../Framework/CHIP/MTRBackwardsCompatShims.h | 29 +++ .../CHIP/templates/availability.yaml | 143 +++++++++++++- .../CHIP/zap-generated/MTRBaseClusters.h | 177 +++++++++++++----- 3 files changed, 296 insertions(+), 53 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h b/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h index 8903957414fc36..1a183c83def9b5 100644 --- a/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h +++ b/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h @@ -159,4 +159,33 @@ typedef NS_ENUM(uint8_t, MTROTASoftwareUpdateRequestorOTAUpdateState) { = 0x08, } MTR_DEPRECATED("Please use MTROTASoftwareUpdateRequestorUpdateState", ios(16.4, 17.2), macos(13.3, 14.2), watchos(9.4, 10.2), tvos(16.4, 17.2)); +/** + * ColorControl used to have HueMoveMode/SaturationMoveMode and HueStepMode/SaturationStepMode that had + * identical values. Those got replaced with MoveModeEnum and StepModeEnum respectively. We codegen + * HueMoveMode and HueStepMode as aliases of MoveModeEnum and StepModeEnum, but we need manual shims for + * SaturationMoveMode and SaturationStepMode. + */ +typedef NS_ENUM(uint8_t, MTRColorControlSaturationMoveMode) { + MTRColorControlSaturationMoveModeStop MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlMoveModeStop") + = 0x00, + MTRColorControlSaturationMoveModeUp MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlMoveModeUp") + = 0x01, + MTRColorControlSaturationMoveModeDown MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlMoveModeDown") + = 0x03, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlMoveMode"); + +typedef NS_ENUM(uint8_t, MTRColorControlSaturationStepMode) { + MTRColorControlSaturationStepModeUp MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlStepModeUp") + = 0x01, + MTRColorControlSaturationStepModeDown MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlStepModeDown") + = 0x03, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlStepMode"); + NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index c1f1e1bd6f0e6c..2272d5256d934e 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -3237,9 +3237,15 @@ - FanModeSequenceType - FanModeType ColorControl: - - ColorLoopAction - - ColorLoopDirection - - ColorMode + # ColorLoopActionEnum, ColorLoopDirectionEnum and ColorModeEnum + # were originally named ColorLoopAction, ColorLoopDirection, and + # ColorMode, but we generate the same API for the names + # with/without "Enum" at the end and the cluster name + # present/absent at the beginning, so the names can just change + # here. + - ColorLoopActionEnum + - ColorLoopDirectionEnum + - ColorModeEnum - HueDirection - HueMoveMode - HueStepMode @@ -3980,14 +3986,20 @@ - Auto - Smart ColorControl: - ColorLoopAction: + # ColorLoopActionEnum, ColorLoopDirectionEnum and ColorModeEnum + # were originally named ColorLoopAction, ColorLoopDirection, and + # ColorMode, but we generate the same API for the names + # with/without "Enum" at the end and the cluster name + # present/absent at the beginning, so the names can just change + # here. + ColorLoopActionEnum: - Deactivate - ActivateFromColorLoopStartEnhancedHue - ActivateFromEnhancedCurrentHue - ColorLoopDirection: + ColorLoopDirectionEnum: - DecrementHue - IncrementHue - ColorMode: + ColorModeEnum: - CurrentHueAndCurrentSaturation - CurrentXAndCurrentY - ColorTemperature @@ -9682,6 +9694,64 @@ - release: "Future" versions: "future" + introduced: + enums: + ColorControl: + - DirectionEnum + - DriftCompensationEnum + - EnhancedColorModeEnum + - MoveModeEnum + - StepModeEnum + enum values: + ColorControl: + ColorLoopDirectionEnum: + - Decrement + - Increment + ColorModeEnum: + - ColorTemperatureMireds + DirectionEnum: + - Shortest + - Longest + - Up + - Down + DriftCompensationEnum: + - None + - OtherOrUnknown + - TemperatureMonitoring + - OpticalLuminanceMonitoringAndFeedback + - OpticalColorMonitoringAndFeedback + EnhancedColorModeEnum: + - CurrentHueAndCurrentSaturation + - CurrentXAndCurrentY + - ColorTemperatureMireds + - EnhancedCurrentHueAndCurrentSaturation + MoveModeEnum: + - Stop + - Up + - Down + StepModeEnum: + - Up + - Down + bitmaps: + ColorControl: + - ColorCapabilitiesBitmap + - OptionsBitmap + - UpdateFlagsBitmap + bitmap values: + ColorControl: + ColorCapabilitiesBitmap: + - HueSaturation + - EnhancedHue + - ColorLoop + - XY + - ColorTemperature + OptionsBitmap: + - ExecuteIfOff + UpdateFlagsBitmap: + - UpdateAction + - UpdateDirection + - UpdateTime + - UpdateStartHue provisional: clusters: # Targeting 1.4 @@ -9820,3 +9890,64 @@ Feature: # Targeting 1.4 - ActionSwitch + renames: + enums: + ColorControl: + DirectionEnum: HueDirection + MoveModeEnum: HueMoveMode + StepModeEnum: HueStepMode + enum values: + ColorControl: + ColorLoopDirectionEnum: + Decrement: DecrementHue + Increment: IncrementHue + ColorModeEnum: + ColorTemperatureMireds: ColorTemperature + HueDirection: + Shortest: ShortestDistance + Longest: LongestDistance + bitmaps: + ColorControl: + ColorCapabilitiesBitmap: ColorCapabilities + UpdateFlagsBitmap: ColorLoopUpdateFlags + bitmap values: + ColorControl: + ColorCapabilities: + HueSaturation: HueSaturationSupported + EnhancedHue: EnhancedHueSupported + ColorLoop: ColorLoopSupported + XY: XYAttributesSupported + ColorTemperature: ColorTemperatureSupported + deprecated: + enums: + ColorControl: + - HueDirection + - HueMoveMode + - HueStepMode + enum values: + ColorControl: + ColorLoopDirectionEnum: + - DecrementHue + - IncrementHue + ColorModeEnum: + - ColorTemperature + bitmaps: + ColorControl: + - ColorCapabilities + - ColorLoopUpdateFlags + removed: + enum values: + ColorControl: + # Don't expose the new value names on the old enum names + HueDirection: + - Shortest + - Longest + bitmap values: + ColorControl: + # Don't expose the new field names on the old bitmap names + ColorCapabilities: + - HueSaturation + - EnhancedHue + - ColorLoop + - XY + - ColorTemperature diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index efb5fca9547fab..c00233470f81d6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -20203,62 +20203,129 @@ typedef NS_ENUM(uint8_t, MTRThermostatUserInterfaceConfigurationTemperatureDispl } MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4)); typedef NS_ENUM(uint8_t, MTRColorControlColorLoopAction) { - MTRColorControlColorLoopActionDeactivate MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRColorControlColorLoopActionActivateFromColorLoopStartEnhancedHue MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRColorControlColorLoopActionActivateFromEnhancedCurrentHue MTR_PROVISIONALLY_AVAILABLE = 0x02, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlColorLoopActionDeactivate MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, + MTRColorControlColorLoopActionActivateFromColorLoopStartEnhancedHue MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, + MTRColorControlColorLoopActionActivateFromEnhancedCurrentHue MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x02, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_ENUM(uint8_t, MTRColorControlColorLoopDirection) { - MTRColorControlColorLoopDirectionDecrement MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRColorControlColorLoopDirectionIncrement MTR_PROVISIONALLY_AVAILABLE = 0x01, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlColorLoopDirectionDecrement MTR_NEWLY_AVAILABLE = 0x00, + MTRColorControlColorLoopDirectionDecrementHue MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorLoopDirectionDecrement") + = 0x00, + MTRColorControlColorLoopDirectionIncrement MTR_NEWLY_AVAILABLE = 0x01, + MTRColorControlColorLoopDirectionIncrementHue MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorLoopDirectionIncrement") + = 0x01, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_ENUM(uint8_t, MTRColorControlColorMode) { - MTRColorControlColorModeCurrentHueAndCurrentSaturation MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRColorControlColorModeCurrentXAndCurrentY MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRColorControlColorModeColorTemperatureMireds MTR_PROVISIONALLY_AVAILABLE = 0x02, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlColorModeCurrentHueAndCurrentSaturation MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, + MTRColorControlColorModeCurrentXAndCurrentY MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, + MTRColorControlColorModeColorTemperatureMireds MTR_NEWLY_AVAILABLE = 0x02, + MTRColorControlColorModeColorTemperature MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorModeColorTemperatureMireds") + = 0x02, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_ENUM(uint8_t, MTRColorControlDirection) { - MTRColorControlDirectionShortest MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRColorControlDirectionLongest MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRColorControlDirectionUp MTR_PROVISIONALLY_AVAILABLE = 0x02, - MTRColorControlDirectionDown MTR_PROVISIONALLY_AVAILABLE = 0x03, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlDirectionShortest MTR_NEWLY_AVAILABLE = 0x00, + MTRColorControlDirectionLongest MTR_NEWLY_AVAILABLE = 0x01, + MTRColorControlDirectionUp MTR_NEWLY_AVAILABLE = 0x02, + MTRColorControlDirectionDown MTR_NEWLY_AVAILABLE = 0x03, +} MTR_NEWLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRColorControlHueDirection) { + MTRColorControlHueDirectionShortestDistance MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlDirectionShortest") + = 0x00, + MTRColorControlHueDirectionLongestDistance MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlDirectionLongest") + = 0x01, + MTRColorControlHueDirectionUp MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlDirectionUp") + = 0x02, + MTRColorControlHueDirectionDown MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlDirectionDown") + = 0x03, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlDirection"); typedef NS_ENUM(uint8_t, MTRColorControlDriftCompensation) { - MTRColorControlDriftCompensationNone MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRColorControlDriftCompensationOtherOrUnknown MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRColorControlDriftCompensationTemperatureMonitoring MTR_PROVISIONALLY_AVAILABLE = 0x02, - MTRColorControlDriftCompensationOpticalLuminanceMonitoringAndFeedback MTR_PROVISIONALLY_AVAILABLE = 0x03, - MTRColorControlDriftCompensationOpticalColorMonitoringAndFeedback MTR_PROVISIONALLY_AVAILABLE = 0x04, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlDriftCompensationNone MTR_NEWLY_AVAILABLE = 0x00, + MTRColorControlDriftCompensationOtherOrUnknown MTR_NEWLY_AVAILABLE = 0x01, + MTRColorControlDriftCompensationTemperatureMonitoring MTR_NEWLY_AVAILABLE = 0x02, + MTRColorControlDriftCompensationOpticalLuminanceMonitoringAndFeedback MTR_NEWLY_AVAILABLE = 0x03, + MTRColorControlDriftCompensationOpticalColorMonitoringAndFeedback MTR_NEWLY_AVAILABLE = 0x04, +} MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRColorControlEnhancedColorMode) { - MTRColorControlEnhancedColorModeCurrentHueAndCurrentSaturation MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRColorControlEnhancedColorModeCurrentXAndCurrentY MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRColorControlEnhancedColorModeColorTemperatureMireds MTR_PROVISIONALLY_AVAILABLE = 0x02, - MTRColorControlEnhancedColorModeEnhancedCurrentHueAndCurrentSaturation MTR_PROVISIONALLY_AVAILABLE = 0x03, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlEnhancedColorModeCurrentHueAndCurrentSaturation MTR_NEWLY_AVAILABLE = 0x00, + MTRColorControlEnhancedColorModeCurrentXAndCurrentY MTR_NEWLY_AVAILABLE = 0x01, + MTRColorControlEnhancedColorModeColorTemperatureMireds MTR_NEWLY_AVAILABLE = 0x02, + MTRColorControlEnhancedColorModeEnhancedCurrentHueAndCurrentSaturation MTR_NEWLY_AVAILABLE = 0x03, +} MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRColorControlMoveMode) { - MTRColorControlMoveModeStop MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRColorControlMoveModeUp MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRColorControlMoveModeDown MTR_PROVISIONALLY_AVAILABLE = 0x03, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlMoveModeStop MTR_NEWLY_AVAILABLE = 0x00, + MTRColorControlMoveModeUp MTR_NEWLY_AVAILABLE = 0x01, + MTRColorControlMoveModeDown MTR_NEWLY_AVAILABLE = 0x03, +} MTR_NEWLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRColorControlHueMoveMode) { + MTRColorControlHueMoveModeStop MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlMoveModeStop") + = 0x00, + MTRColorControlHueMoveModeUp MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlMoveModeUp") + = 0x01, + MTRColorControlHueMoveModeDown MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlMoveModeDown") + = 0x03, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlMoveMode"); typedef NS_ENUM(uint8_t, MTRColorControlStepMode) { - MTRColorControlStepModeUp MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRColorControlStepModeDown MTR_PROVISIONALLY_AVAILABLE = 0x03, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlStepModeUp MTR_NEWLY_AVAILABLE = 0x01, + MTRColorControlStepModeDown MTR_NEWLY_AVAILABLE = 0x03, +} MTR_NEWLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRColorControlHueStepMode) { + MTRColorControlHueStepModeUp MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlStepModeUp") + = 0x01, + MTRColorControlHueStepModeDown MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlStepModeDown") + = 0x03, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlStepMode"); typedef NS_OPTIONS(uint16_t, MTRColorControlColorCapabilitiesBitmap) { - MTRColorControlColorCapabilitiesBitmapHueSaturation MTR_PROVISIONALLY_AVAILABLE = 0x1, - MTRColorControlColorCapabilitiesBitmapEnhancedHue MTR_PROVISIONALLY_AVAILABLE = 0x2, - MTRColorControlColorCapabilitiesBitmapColorLoop MTR_PROVISIONALLY_AVAILABLE = 0x4, - MTRColorControlColorCapabilitiesBitmapXY MTR_PROVISIONALLY_AVAILABLE = 0x8, - MTRColorControlColorCapabilitiesBitmapColorTemperature MTR_PROVISIONALLY_AVAILABLE = 0x10, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlColorCapabilitiesBitmapHueSaturation MTR_NEWLY_AVAILABLE = 0x1, + MTRColorControlColorCapabilitiesBitmapEnhancedHue MTR_NEWLY_AVAILABLE = 0x2, + MTRColorControlColorCapabilitiesBitmapColorLoop MTR_NEWLY_AVAILABLE = 0x4, + MTRColorControlColorCapabilitiesBitmapXY MTR_NEWLY_AVAILABLE = 0x8, + MTRColorControlColorCapabilitiesBitmapColorTemperature MTR_NEWLY_AVAILABLE = 0x10, +} MTR_NEWLY_AVAILABLE; + +typedef NS_OPTIONS(uint16_t, MTRColorControlColorCapabilities) { + MTRColorControlColorCapabilitiesHueSaturationSupported MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorCapabilitiesBitmapHueSaturation") + = 0x1, + MTRColorControlColorCapabilitiesEnhancedHueSupported MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorCapabilitiesBitmapEnhancedHue") + = 0x2, + MTRColorControlColorCapabilitiesColorLoopSupported MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorCapabilitiesBitmapColorLoop") + = 0x4, + MTRColorControlColorCapabilitiesXYAttributesSupported MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorCapabilitiesBitmapXY") + = 0x8, + MTRColorControlColorCapabilitiesColorTemperatureSupported MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorCapabilitiesBitmapColorTemperature") + = 0x10, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlColorCapabilitiesBitmap"); typedef NS_OPTIONS(uint32_t, MTRColorControlFeature) { MTRColorControlFeatureHueAndSaturation MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, @@ -20269,15 +20336,31 @@ typedef NS_OPTIONS(uint32_t, MTRColorControlFeature) { } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint8_t, MTRColorControlOptionsBitmap) { - MTRColorControlOptionsBitmapExecuteIfOff MTR_PROVISIONALLY_AVAILABLE = 0x1, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlOptionsBitmapExecuteIfOff MTR_NEWLY_AVAILABLE = 0x1, +} MTR_NEWLY_AVAILABLE; typedef NS_OPTIONS(uint8_t, MTRColorControlUpdateFlagsBitmap) { - MTRColorControlUpdateFlagsBitmapUpdateAction MTR_PROVISIONALLY_AVAILABLE = 0x1, - MTRColorControlUpdateFlagsBitmapUpdateDirection MTR_PROVISIONALLY_AVAILABLE = 0x2, - MTRColorControlUpdateFlagsBitmapUpdateTime MTR_PROVISIONALLY_AVAILABLE = 0x4, - MTRColorControlUpdateFlagsBitmapUpdateStartHue MTR_PROVISIONALLY_AVAILABLE = 0x8, -} MTR_PROVISIONALLY_AVAILABLE; + MTRColorControlUpdateFlagsBitmapUpdateAction MTR_NEWLY_AVAILABLE = 0x1, + MTRColorControlUpdateFlagsBitmapUpdateDirection MTR_NEWLY_AVAILABLE = 0x2, + MTRColorControlUpdateFlagsBitmapUpdateTime MTR_NEWLY_AVAILABLE = 0x4, + MTRColorControlUpdateFlagsBitmapUpdateStartHue MTR_NEWLY_AVAILABLE = 0x8, +} MTR_NEWLY_AVAILABLE; + +typedef NS_OPTIONS(uint8_t, MTRColorControlColorLoopUpdateFlags) { + MTRColorControlColorLoopUpdateFlagsUpdateAction MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlUpdateFlagsBitmapUpdateAction") + = 0x1, + MTRColorControlColorLoopUpdateFlagsUpdateDirection MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlUpdateFlagsBitmapUpdateDirection") + = 0x2, + MTRColorControlColorLoopUpdateFlagsUpdateTime MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlUpdateFlagsBitmapUpdateTime") + = 0x4, + MTRColorControlColorLoopUpdateFlagsUpdateStartHue MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlUpdateFlagsBitmapUpdateStartHue") + = 0x8, +} MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRColorControlUpdateFlagsBitmap"); typedef NS_OPTIONS(uint8_t, MTRBallastConfigurationBallastStatusBitmap) { MTRBallastConfigurationBallastStatusBitmapBallastNonOperational MTR_PROVISIONALLY_AVAILABLE = 0x1, From dd8b002e7e65d3f6b1f1a95ef8a740607202ea38 Mon Sep 17 00:00:00 2001 From: Sharad Binjola <31142146+sharadb-amazon@users.noreply.github.com> Date: Wed, 21 Aug 2024 17:01:20 -0700 Subject: [PATCH 49/52] Re-route deprecated android casting APIs to new ones (#35136) --- .../android/App/app/build.gradle | 4 +- .../com/chip/casting/app/CastingContext.java | 2 + .../chip/casting/app/CertTestFragment.java | 12 +- .../app/CommissionerDiscoveryFragment.java | 6 +- .../chip/casting/app/ConnectionFragment.java | 10 +- .../casting/app/ContentLauncherFragment.java | 6 +- .../casting/app/MediaPlaybackFragment.java | 6 +- .../casting/app/SelectClusterFragment.java | 6 +- .../chip/casting/util/DACProviderStub.java | 2 + .../casting/util/GlobalCastingConstants.java | 11 + .../jni/com/chip/casting/AppParameters.java | 2 + .../chip/casting/CommissioningCallbacks.java | 2 + .../jni/com/chip/casting/ContentApp.java | 37 + .../chip/casting/ContentLauncherTypes.java | 2 + .../jni/com/chip/casting/DACProvider.java | 2 + .../com/chip/casting/DiscoveredNodeData.java | 26 +- .../jni/com/chip/casting/FailureCallback.java | 6 +- .../chip/casting/MatterCallbackHandler.java | 6 +- .../jni/com/chip/casting/MatterError.java | 9 + .../com/chip/casting/MediaPlaybackTypes.java | 2 + .../SubscriptionEstablishedCallback.java | 2 + .../jni/com/chip/casting/SuccessCallback.java | 2 + .../chip/casting/TargetNavigatorTypes.java | 2 + .../jni/com/chip/casting/TvCastingApp.java | 1327 ++++++++++ .../jni/com/chip/casting/VideoPlayer.java | 62 +- .../App/app/src/main/AndroidManifest.xml | 4 +- .../casting/util/GlobalCastingConstants.java | 11 - .../casting}/ChipTvCastingApplication.java | 2 +- .../app => matter/casting}/MainActivity.java | 16 +- .../chip/casting/NsdDiscoveryListener.java | 128 - .../com/chip/casting/NsdResolveListener.java | 165 -- .../jni/com/chip/casting/TvCastingApp.java | 608 ----- .../matter/casting/support/DataProvider.java | 4 +- .../App/app/src/main/jni/cpp/Constants.h | 74 - .../app/src/main/jni/cpp/ConversionUtils.cpp | 410 ---- .../app/src/main/jni/cpp/ConversionUtils.h | 36 - .../jni/cpp/MatterCallbackHandler-JNI.cpp | 419 ---- .../main/jni/cpp/MatterCallbackHandler-JNI.h | 293 --- .../app/src/main/jni/cpp/TvCastingApp-JNI.cpp | 2129 ----------------- .../app/src/main/jni/cpp/TvCastingApp-JNI.h | 162 -- .../src/main/jni/cpp/core/CastingApp-JNI.cpp | 15 +- .../cpp/core/CastingPlayerDiscovery-JNI.cpp | 1 - .../jni/cpp/core/MatterCastingPlayer-JNI.cpp | 1 - .../main/jni/cpp/core/MatterEndpoint-JNI.cpp | 1 - .../jni/cpp/{ => support}/JNIDACProvider.cpp | 8 + .../jni/cpp/{ => support}/JNIDACProvider.h | 8 + .../app/src/main/res/layout/activity_main.xml | 2 +- .../CommissionerDiscoveryListenerTest.java | 68 - examples/tv-casting-app/android/BUILD.gn | 46 +- .../tv-casting-common/core/CastingApp.cpp | 2 - 50 files changed, 1566 insertions(+), 4601 deletions(-) rename examples/tv-casting-app/android/App/app/src/{main => compat}/java/com/chip/casting/app/CastingContext.java (87%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/java/com/chip/casting/app/CertTestFragment.java (97%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/java/com/chip/casting/app/CommissionerDiscoveryFragment.java (98%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/java/com/chip/casting/app/ConnectionFragment.java (96%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/java/com/chip/casting/app/ContentLauncherFragment.java (94%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/java/com/chip/casting/app/MediaPlaybackFragment.java (97%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/java/com/chip/casting/app/SelectClusterFragment.java (95%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/java/com/chip/casting/util/DACProviderStub.java (98%) create mode 100644 examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/util/GlobalCastingConstants.java rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/AppParameters.java (97%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/CommissioningCallbacks.java (97%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/ContentApp.java (51%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/ContentLauncherTypes.java (96%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/DACProvider.java (92%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/DiscoveredNodeData.java (88%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/FailureCallback.java (85%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/MatterCallbackHandler.java (85%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/MatterError.java (84%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/MediaPlaybackTypes.java (93%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/SubscriptionEstablishedCallback.java (91%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/SuccessCallback.java (91%) rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/TargetNavigatorTypes.java (93%) create mode 100644 examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/TvCastingApp.java rename examples/tv-casting-app/android/App/app/src/{main => compat}/jni/com/chip/casting/VideoPlayer.java (81%) delete mode 100644 examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/GlobalCastingConstants.java rename examples/tv-casting-app/android/App/app/src/main/java/com/{chip/casting/app => matter/casting}/ChipTvCastingApplication.java (84%) rename examples/tv-casting-app/android/App/app/src/main/java/com/{chip/casting/app => matter/casting}/MainActivity.java (92%) delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdDiscoveryListener.java delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdResolveListener.java delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TvCastingApp.java delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/cpp/Constants.h delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.cpp delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.h delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.h delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/cpp/TvCastingApp-JNI.cpp delete mode 100644 examples/tv-casting-app/android/App/app/src/main/jni/cpp/TvCastingApp-JNI.h rename examples/tv-casting-app/android/App/app/src/main/jni/cpp/{ => support}/JNIDACProvider.cpp (98%) rename examples/tv-casting-app/android/App/app/src/main/jni/cpp/{ => support}/JNIDACProvider.h (94%) delete mode 100644 examples/tv-casting-app/android/App/app/src/test/java/com/chip/casting/dnssd/CommissionerDiscoveryListenerTest.java diff --git a/examples/tv-casting-app/android/App/app/build.gradle b/examples/tv-casting-app/android/App/app/build.gradle index 3dcdad715e6393..757e6a6522f5da 100644 --- a/examples/tv-casting-app/android/App/app/build.gradle +++ b/examples/tv-casting-app/android/App/app/build.gradle @@ -7,7 +7,7 @@ android { defaultConfig { applicationId "com.chip.casting" - minSdk 24 + minSdk 26 targetSdk 30 versionCode 1 versionName "1.0" @@ -47,6 +47,8 @@ android { java.srcDirs = [ 'src/main/java', 'src/main/jni', + 'src/compat/java', + 'src/compat/jni', ] // uncomment this code to debug diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CastingContext.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CastingContext.java similarity index 87% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CastingContext.java rename to examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CastingContext.java index acab829034bd56..b089e92b8faf0f 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CastingContext.java +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CastingContext.java @@ -5,6 +5,8 @@ import androidx.fragment.app.FragmentActivity; import com.R; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class CastingContext { private FragmentActivity fragmentActivity; diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CertTestFragment.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CertTestFragment.java similarity index 97% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CertTestFragment.java rename to examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CertTestFragment.java index 7ee9fa3c46a0ae..27f00aab8e9325 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CertTestFragment.java +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CertTestFragment.java @@ -313,7 +313,17 @@ private void runCertTests(Activity activity) { "messages_presentMessages", successFailureCallback, () -> { - tvCastingApp.messages_presentMessages(kTVApp, "CastingAppTestMessage", callback); + final byte[] messageID = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5}; + tvCastingApp.messages_presentMessages( + kTVApp, + messageID, + 0, + 0, + (long) 0, + (long) 60 * 1000, + "CastingAppTestMessage", + Optional.empty(), + callback); }); runAndWait( diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CommissionerDiscoveryFragment.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CommissionerDiscoveryFragment.java similarity index 98% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CommissionerDiscoveryFragment.java rename to examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CommissionerDiscoveryFragment.java index 3a119940b64839..c7aa931d9f00a1 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/CommissionerDiscoveryFragment.java +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/CommissionerDiscoveryFragment.java @@ -28,7 +28,11 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; -/** A {@link Fragment} to discover commissioners on the network */ +/** + * @deprecated Refer to com.matter.casting.DiscoveryExampleFragment. + *

A {@link Fragment} to discover commissioners on the network + */ +@Deprecated public class CommissionerDiscoveryFragment extends Fragment { private static final String TAG = CommissionerDiscoveryFragment.class.getSimpleName(); private static final long DISCOVERY_POLL_INTERVAL_MS = 15000; diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ConnectionFragment.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/ConnectionFragment.java similarity index 96% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ConnectionFragment.java rename to examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/ConnectionFragment.java index 09ba31b2c8776c..dcd681d7cbc70d 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ConnectionFragment.java +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/ConnectionFragment.java @@ -21,9 +21,14 @@ import com.chip.casting.util.GlobalCastingConstants; import java.util.concurrent.Executors; -/** A {@link Fragment} to get the TV Casting App commissioned / connected. */ +/** + * @deprecated Refer to com.matter.casting.ConnectionExampleFragment. + *

A {@link Fragment} to get the TV Casting App commissioned / connected + */ +@Deprecated public class ConnectionFragment extends Fragment { private static final String TAG = ConnectionFragment.class.getSimpleName(); + private static final Integer targetContentAppVendorId = 65521; private final TvCastingApp tvCastingApp; private final DiscoveredNodeData selectedCommissioner; @@ -189,7 +194,8 @@ public void handle(MatterError error) { + " port: " + selectedCommissioner.getPort()); - this.sendUdcSuccess = tvCastingApp.sendCommissioningRequest(selectedCommissioner); + this.sendUdcSuccess = + tvCastingApp.sendCommissioningRequest(selectedCommissioner, targetContentAppVendorId); updateUiOnConnectionSuccess(); } } else { diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ContentLauncherFragment.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/ContentLauncherFragment.java similarity index 94% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ContentLauncherFragment.java rename to examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/ContentLauncherFragment.java index d1c3c9f957f394..14bcfcae1568f8 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ContentLauncherFragment.java +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/ContentLauncherFragment.java @@ -15,7 +15,11 @@ import com.chip.casting.MatterError; import com.chip.casting.TvCastingApp; -/** A {@link Fragment} to send Content Launcher commands from the TV Casting App. */ +/** + * @deprecated Refer to com.matter.casting.ContentLauncherLaunchURLExampleFragment. + *

A {@link Fragment} to send Content Launcher commands from the TV Casting App. + */ +@Deprecated public class ContentLauncherFragment extends Fragment { private static final String TAG = ContentLauncherFragment.class.getSimpleName(); diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/MediaPlaybackFragment.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/MediaPlaybackFragment.java similarity index 97% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/MediaPlaybackFragment.java rename to examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/MediaPlaybackFragment.java index a9c38443a7d91e..b48dcd277122a4 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/MediaPlaybackFragment.java +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/MediaPlaybackFragment.java @@ -18,7 +18,11 @@ import com.chip.casting.SuccessCallback; import com.chip.casting.TvCastingApp; -/** A {@link Fragment} for the Media Playback cluster */ +/** + * @deprecated Refer to com.matter.casting.MediaPlaybackSubscribeToCurrentStateExampleFragment. + *

A {@link Fragment} for the Media Playback cluster + */ +@Deprecated public class MediaPlaybackFragment extends Fragment { private static final String TAG = MediaPlaybackFragment.class.getSimpleName(); diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/SelectClusterFragment.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/SelectClusterFragment.java similarity index 95% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/SelectClusterFragment.java rename to examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/SelectClusterFragment.java index f89fc36009e404..47cc4728f96cfb 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/SelectClusterFragment.java +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/app/SelectClusterFragment.java @@ -10,7 +10,11 @@ import com.R; import com.chip.casting.TvCastingApp; -/** An interstitial {@link Fragment} to select one of the supported media actions to perform */ +/** + * @deprecated Refer to com.matter.casting.ActionSelectorFragment. + *

An interstitial {@link Fragment} to select one of the supported media actions to perform + */ +@Deprecated public class SelectClusterFragment extends Fragment { private static final String TAG = SelectClusterFragment.class.getSimpleName(); diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/DACProviderStub.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/util/DACProviderStub.java similarity index 98% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/DACProviderStub.java rename to examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/util/DACProviderStub.java index 9dbae27c6e5982..2a91c055dcb47a 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/DACProviderStub.java +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/util/DACProviderStub.java @@ -11,6 +11,8 @@ import java.security.spec.ECParameterSpec; import java.security.spec.ECPrivateKeySpec; +/** @deprecated Refer to com.matter.casting.DACProviderStub. */ +@Deprecated public class DACProviderStub implements DACProvider { private String kDevelopmentDAC_Cert_FFF1_8001 = diff --git a/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/util/GlobalCastingConstants.java b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/util/GlobalCastingConstants.java new file mode 100644 index 00000000000000..526bbb07401845 --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/compat/java/com/chip/casting/util/GlobalCastingConstants.java @@ -0,0 +1,11 @@ +package com.chip.casting.util; + +public class GlobalCastingConstants { + public static final int CommissioningWindowDurationSecs = 3 * 60; + public static final int SetupPasscode = 20202021; + public static final int Discriminator = 0xF00; + + // set to true, to demo the simplified casting APIs. + // Otherwise, the deprecated casting APIs are invoked + public static final boolean ChipCastingSimplified = true; +} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/AppParameters.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/AppParameters.java similarity index 97% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/AppParameters.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/AppParameters.java index 18c9a351f0e41a..3d72b38f72eb84 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/AppParameters.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/AppParameters.java @@ -22,6 +22,8 @@ import java.math.BigInteger; import java.util.Arrays; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class AppParameters { private static final String TAG = AppParameters.class.getSimpleName(); public static final int MIN_ROTATING_DEVICE_ID_UNIQUE_ID_LENGTH = 16; diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/CommissioningCallbacks.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/CommissioningCallbacks.java similarity index 97% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/CommissioningCallbacks.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/CommissioningCallbacks.java index 9a44aba792f18b..20599a4f07352a 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/CommissioningCallbacks.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/CommissioningCallbacks.java @@ -17,6 +17,8 @@ */ package com.chip.casting; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class CommissioningCallbacks { /** * This is called when the PBKDFParamRequest is received and indicates the start of the session diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/ContentApp.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/ContentApp.java similarity index 51% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/ContentApp.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/ContentApp.java index 80efc22ef52024..1c20a40b66251a 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/ContentApp.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/ContentApp.java @@ -17,10 +17,16 @@ */ package com.chip.casting; +import chip.devicecontroller.ChipClusters; +import com.matter.casting.core.Endpoint; +import java.util.ArrayList; import java.util.List; import java.util.Objects; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class ContentApp { + private Endpoint endpoint; private short endpointId; private List clusterIds; @@ -32,6 +38,33 @@ public ContentApp(short endpointId, List clusterIds) { this.isInitialized = true; } + ContentApp(Endpoint endpoint) { + this.endpoint = endpoint; + this.endpointId = (short) endpoint.getId(); + this.clusterIds = new ArrayList<>(); + if (endpoint.getCluster(ChipClusters.ApplicationBasicCluster.class) != null) { + this.clusterIds.add((int) ChipClusters.ApplicationBasicCluster.CLUSTER_ID); + } + if (endpoint.getCluster(ChipClusters.ApplicationLauncherCluster.class) != null) { + this.clusterIds.add((int) ChipClusters.ApplicationLauncherCluster.CLUSTER_ID); + } + if (endpoint.getCluster(ChipClusters.ContentLauncherCluster.class) != null) { + this.clusterIds.add((int) ChipClusters.ContentLauncherCluster.CLUSTER_ID); + } + if (endpoint.getCluster(ChipClusters.KeypadInputCluster.class) != null) { + this.clusterIds.add((int) ChipClusters.KeypadInputCluster.CLUSTER_ID); + } + if (endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) != null) { + this.clusterIds.add((int) ChipClusters.MediaPlaybackCluster.CLUSTER_ID); + } + if (endpoint.getCluster(ChipClusters.OnOffCluster.class) != null) { + this.clusterIds.add((int) ChipClusters.OnOffCluster.CLUSTER_ID); + } + if (endpoint.getCluster(ChipClusters.TargetNavigatorCluster.class) != null) { + this.clusterIds.add((int) ChipClusters.TargetNavigatorCluster.CLUSTER_ID); + } + } + public boolean equals(Object object) { if (this == object) return true; if (object == null || getClass() != object.getClass()) return false; @@ -49,6 +82,10 @@ public java.lang.String toString() { return "endpointId=" + endpointId; } + Endpoint getEndpoint() { + return endpoint; + } + public short getEndpointId() { return endpointId; } diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/ContentLauncherTypes.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/ContentLauncherTypes.java similarity index 96% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/ContentLauncherTypes.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/ContentLauncherTypes.java index bc4ee6a6a24bdf..b6d7c3402989d9 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/ContentLauncherTypes.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/ContentLauncherTypes.java @@ -20,6 +20,8 @@ import java.util.ArrayList; import java.util.Optional; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class ContentLauncherTypes { public static class AdditionalInfo { public String name; diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/DACProvider.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/DACProvider.java similarity index 92% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/DACProvider.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/DACProvider.java index c49d73ab98c86e..7c6ac281e61568 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/DACProvider.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/DACProvider.java @@ -17,6 +17,8 @@ */ package com.chip.casting; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public interface DACProvider { byte[] GetCertificationDeclaration(); diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/DiscoveredNodeData.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/DiscoveredNodeData.java similarity index 88% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/DiscoveredNodeData.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/DiscoveredNodeData.java index a66d48a57c0e2a..39b9113c94a836 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/DiscoveredNodeData.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/DiscoveredNodeData.java @@ -19,6 +19,7 @@ import android.net.nsd.NsdServiceInfo; import android.util.Log; +import com.matter.casting.core.CastingPlayer; import java.net.InetAddress; import java.nio.charset.StandardCharsets; import java.util.Arrays; @@ -26,15 +27,18 @@ import java.util.Map; import java.util.Objects; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class DiscoveredNodeData { private static final String TAG = DiscoveredNodeData.class.getSimpleName(); - private static final int MAX_IP_ADDRESSES = 5; private static final int MAX_ROTATING_ID_LEN = 50; private static final String KEY_DEVICE_NAME = "DN"; private static final String KEY_DEVICE_TYPE = "DT"; private static final String KEY_VENDOR_PRODUCT = "VP"; + private CastingPlayer castingPlayer; + private String hostName; private String instanceName; private long longDiscriminator; @@ -119,10 +123,30 @@ public DiscoveredNodeData(VideoPlayer player) { this.port = player.getPort(); } + DiscoveredNodeData(CastingPlayer castingPlayer) { + this.castingPlayer = castingPlayer; + this.deviceName = castingPlayer.getDeviceName(); + this.ipAddresses = castingPlayer.getIpAddresses(); + this.numIPs = + castingPlayer.getIpAddresses() != null ? castingPlayer.getIpAddresses().size() : 0; + this.deviceType = castingPlayer.getDeviceType(); + this.hostName = castingPlayer.getHostName(); + this.vendorId = castingPlayer.getVendorId(); + this.productId = castingPlayer.getProductId(); + this.instanceName = castingPlayer.getInstanceName(); + if (castingPlayer.isConnected()) { + this.connectableVideoPlayer = new VideoPlayer(castingPlayer); + } + } + void setConnectableVideoPlayer(VideoPlayer videoPlayer) { this.connectableVideoPlayer = videoPlayer; } + CastingPlayer getCastingPlayer() { + return castingPlayer; + } + public boolean isPreCommissioned() { return connectableVideoPlayer != null; } diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/FailureCallback.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/FailureCallback.java similarity index 85% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/FailureCallback.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/FailureCallback.java index 2ad3b9fc7222fe..5e07e9d526b1c4 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/FailureCallback.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/FailureCallback.java @@ -19,14 +19,16 @@ import android.util.Log; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public abstract class FailureCallback { private static final String TAG = FailureCallback.class.getSimpleName(); public abstract void handle(MatterError err); - protected final void handleInternal(int errorCode, String errorMessage) { + protected final void handleInternal(MatterError err) { try { - handle(new MatterError(errorCode, errorMessage)); + handle(err); } catch (Throwable t) { Log.e(TAG, "FailureCallback::Caught an unhandled Throwable from the client: " + t); } diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MatterCallbackHandler.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MatterCallbackHandler.java similarity index 85% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MatterCallbackHandler.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MatterCallbackHandler.java index 493635beb692f1..7f1efd056e2e23 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MatterCallbackHandler.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MatterCallbackHandler.java @@ -19,14 +19,16 @@ import android.util.Log; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public abstract class MatterCallbackHandler { private static final String TAG = MatterCallbackHandler.class.getSimpleName(); public abstract void handle(MatterError err); - protected final void handleInternal(int errorCode, String errorMessage) { + protected final void handleInternal(MatterError err) { try { - handle(new MatterError(errorCode, errorMessage)); + handle(err); } catch (Throwable t) { Log.e(TAG, "MatterCallbackHandler::Caught an unhandled Throwable from the client: " + t); } diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MatterError.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MatterError.java similarity index 84% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MatterError.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MatterError.java index ac12eaccd28977..e281bdd8b63735 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MatterError.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MatterError.java @@ -19,6 +19,8 @@ import java.util.Objects; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class MatterError { private long errorCode; private String errorMessage; @@ -26,8 +28,15 @@ public class MatterError { public static final MatterError DISCOVERY_SERVICE_LOST = new MatterError(4L, "Discovery service was lost."); + public static final MatterError MATTER_INTERNAL_ERROR = new MatterError(0xac, "Internal error."); + public static final MatterError NO_ERROR = new MatterError(0, null); + MatterError(com.matter.casting.support.MatterError err) { + this.errorCode = err.getErrorCode(); + this.errorMessage = err.getErrorMessage(); + } + public MatterError(long errorCode, String errorMessage) { this.errorCode = errorCode; this.errorMessage = errorMessage; diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MediaPlaybackTypes.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MediaPlaybackTypes.java similarity index 93% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MediaPlaybackTypes.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MediaPlaybackTypes.java index 7bf37b5d1cd8e4..fc01b02dea23da 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/MediaPlaybackTypes.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/MediaPlaybackTypes.java @@ -17,6 +17,8 @@ */ package com.chip.casting; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class MediaPlaybackTypes { public enum PlaybackStateEnum { Playing, diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/SubscriptionEstablishedCallback.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/SubscriptionEstablishedCallback.java similarity index 91% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/SubscriptionEstablishedCallback.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/SubscriptionEstablishedCallback.java index aab9dcd9306fd7..dd5eab2ec66556 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/SubscriptionEstablishedCallback.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/SubscriptionEstablishedCallback.java @@ -19,6 +19,8 @@ import android.util.Log; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public abstract class SubscriptionEstablishedCallback { private static final String TAG = SubscriptionEstablishedCallback.class.getSimpleName(); diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/SuccessCallback.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/SuccessCallback.java similarity index 91% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/SuccessCallback.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/SuccessCallback.java index b82845567d8276..d1194d46f3eef0 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/SuccessCallback.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/SuccessCallback.java @@ -19,6 +19,8 @@ import android.util.Log; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public abstract class SuccessCallback { private static final String TAG = SuccessCallback.class.getSimpleName(); diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TargetNavigatorTypes.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/TargetNavigatorTypes.java similarity index 93% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TargetNavigatorTypes.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/TargetNavigatorTypes.java index 88f71bb796ceaf..832101c9564fe7 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TargetNavigatorTypes.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/TargetNavigatorTypes.java @@ -17,6 +17,8 @@ */ package com.chip.casting; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class TargetNavigatorTypes { public static class TargetInfo { public Integer identifier; diff --git a/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/TvCastingApp.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/TvCastingApp.java new file mode 100644 index 00000000000000..cd965905065bee --- /dev/null +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/TvCastingApp.java @@ -0,0 +1,1327 @@ +/* + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package com.chip.casting; + +import android.content.Context; +import android.util.Log; +import androidx.annotation.Nullable; +import chip.devicecontroller.ChipClusters; +import chip.devicecontroller.ChipStructs; +import com.matter.casting.core.CastingApp; +import com.matter.casting.core.CastingPlayer; +import com.matter.casting.core.CastingPlayerDiscovery; +import com.matter.casting.core.Endpoint; +import com.matter.casting.core.MatterCastingPlayerDiscovery; +import com.matter.casting.support.AppParameters; +import com.matter.casting.support.CommissionableData; +import com.matter.casting.support.ConnectionCallbacks; +import com.matter.casting.support.DACProvider; +import com.matter.casting.support.IdentificationDeclarationOptions; +import com.matter.casting.support.MatterCallback; +import com.matter.casting.support.MatterError; +import com.matter.casting.support.TargetAppInfo; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated +public class TvCastingApp { + private static final String TAG = TvCastingApp.class.getSimpleName(); + + private com.chip.casting.AppParameters appParametersCompat; + private int commissioningWindowTimeout; + private CommissioningCallbacks commissioningCallbacks; + private SuccessCallback onConnectionSuccess; + private FailureCallback onConnectionFailure; + private SuccessCallback onNewOrUpdatedEndpointCallback; + private CastingPlayer targetCastingPlayer; + + private abstract class CastingPlayerChangeListenerAdapter + extends CastingPlayerDiscovery.CastingPlayerChangeListener { + public abstract void initialize(SuccessCallback discoverySuccessCallback); + } + + private CastingPlayerChangeListenerAdapter castingPlayerDiscoveryChangeListener = + new CastingPlayerChangeListenerAdapter() { + private SuccessCallback discoverySuccessCallbackCompat; + + @Override + public void initialize(SuccessCallback discoverySuccessCallback) { + this.discoverySuccessCallbackCompat = discoverySuccessCallback; + } + + @Override + public void onAdded(CastingPlayer castingPlayer) { + if (discoverySuccessCallbackCompat == null) { + Log.e(TAG, "discoverySuccessCallbackCompat not set"); + return; + } + discoverySuccessCallbackCompat.handleInternal(new DiscoveredNodeData((castingPlayer))); + } + + @Override + public void onChanged(CastingPlayer castingPlayer) { + if (discoverySuccessCallbackCompat == null) { + Log.e(TAG, "discoverySuccessCallbackCompat not set"); + return; + } + discoverySuccessCallbackCompat.handleInternal(new DiscoveredNodeData((castingPlayer))); + } + + @Override + public void onRemoved(CastingPlayer castingPlayer) { + Log.e(TAG, "CastingPlayerChangeListener.onRemoved() not implemented"); + } + }; + + private interface DACProviderAdapter extends DACProvider { + void initialize(com.chip.casting.DACProvider dacProviderCompat); + } + + private DACProviderAdapter dacProvider = + new DACProviderAdapter() { + private com.chip.casting.DACProvider dacProviderCompat; + + public void initialize(com.chip.casting.DACProvider dacProviderCompat) { + this.dacProviderCompat = dacProviderCompat; + } + + @Override + public byte[] GetCertificationDeclaration() { + if (dacProviderCompat == null) { + Log.e(TAG, "dacProviderCompat not set"); + return null; + } + return dacProviderCompat.GetCertificationDeclaration(); + } + + @Override + public byte[] GetFirmwareInformation() { + if (dacProviderCompat == null) { + Log.e(TAG, "dacProviderCompat not set"); + return null; + } + return dacProviderCompat.GetFirmwareInformation(); + } + + @Override + public byte[] GetDeviceAttestationCert() { + if (dacProviderCompat == null) { + Log.e(TAG, "dacProviderCompat not set"); + return null; + } + return dacProviderCompat.GetDeviceAttestationCert(); + } + + @Override + public byte[] GetProductAttestationIntermediateCert() { + if (dacProviderCompat == null) { + Log.e(TAG, "dacProviderCompat not set"); + return null; + } + return dacProviderCompat.GetProductAttestationIntermediateCert(); + } + + @Override + public byte[] SignWithDeviceAttestationKey(byte[] message) { + if (dacProviderCompat == null) { + Log.e(TAG, "dacProviderCompat not set"); + return null; + } + return dacProviderCompat.SignWithDeviceAttestationKey(message); + } + }; + + private static final List DISCOVERY_TARGET_DEVICE_TYPE_FILTER = + Arrays.asList(35L); // Matter Casting Video player = 35; + + private static TvCastingApp sInstance; + + private TvCastingApp() {} + + public static TvCastingApp getInstance() { + if (sInstance == null) { + sInstance = new TvCastingApp(); + } + return sInstance; + } + + public boolean initApp( + Context applicationContext, com.chip.casting.AppParameters appParametersCompat) { + if (applicationContext == null + || appParametersCompat == null + || appParametersCompat.getConfigurationManager() == null) { + return false; + } + + this.appParametersCompat = appParametersCompat; + + AppParameters appParameters = + new AppParameters( + applicationContext, + () -> appParametersCompat.getConfigurationManager(), + () -> appParametersCompat.getRotatingDeviceIdUniqueId(), + () -> { + CommissionableData commissionableData = + new CommissionableData( + appParametersCompat.getSetupPasscode(), + appParametersCompat.getDiscriminator()); + commissionableData.setSpake2pIterationCount( + appParametersCompat.getSpake2pIterationCount()); + commissionableData.setSpake2pSaltBase64(appParametersCompat.getSpake2pSaltBase64()); + commissionableData.setSpake2pVerifierBase64( + appParametersCompat.getSpake2pVerifierBase64()); + return commissionableData; + }, + this.dacProvider); + + // Initialize the SDK using the appParameters and check if it returns successfully + MatterError err = CastingApp.getInstance().initialize(appParameters); + if (err.hasError()) { + Log.e(TAG, "Failed to initialize Matter CastingApp. Err: " + err); + return false; + } + + err = CastingApp.getInstance().start(); + if (err.hasError()) { + Log.e(TAG, "Failed to start Matter CastingApp. Err: " + err); + return false; + } + return true; + } + + public void setDACProvider(com.chip.casting.DACProvider dacProviderCompat) { + this.dacProvider.initialize(dacProviderCompat); + } + + public void discoverVideoPlayerCommissioners( + SuccessCallback discoverySuccessCallback, + FailureCallback discoveryFailureCallback) { + + // stop before starting another discovery session + stopVideoPlayerDiscovery(); + + castingPlayerDiscoveryChangeListener.initialize(discoverySuccessCallback); + MatterError err = + MatterCastingPlayerDiscovery.getInstance() + .addCastingPlayerChangeListener(castingPlayerDiscoveryChangeListener); + if (err.hasError()) { + Log.e(TAG, "addCastingPlayerChangeListener before starting discovery failed. Err: " + err); + discoveryFailureCallback.handleInternal(new com.chip.casting.MatterError(err)); + return; + } + + err = + MatterCastingPlayerDiscovery.getInstance() + .startDiscovery(DISCOVERY_TARGET_DEVICE_TYPE_FILTER.get(0)); + if (err.hasError()) { + Log.e(TAG, "startDiscovery failed. Err: " + err); + discoveryFailureCallback.handleInternal(new com.chip.casting.MatterError(err)); + } + } + + public void stopVideoPlayerDiscovery() { + MatterError err = MatterCastingPlayerDiscovery.getInstance().stopDiscovery(); + if (err.hasError()) { + Log.e(TAG, "stopDiscovery failed. Err: " + err); + return; + } + + err = + MatterCastingPlayerDiscovery.getInstance() + .removeCastingPlayerChangeListener(castingPlayerDiscoveryChangeListener); + if (err.hasError()) { + Log.e(TAG, "removeCastingPlayerChangeListener failed. Err: " + err); + } + } + + public boolean openBasicCommissioningWindow( + int commissioningWindowTimeout, + CommissioningCallbacks commissioningCallbacks, + SuccessCallback onConnectionSuccess, + FailureCallback onConnectionFailure, + SuccessCallback onNewOrUpdatedEndpointCallback) { + this.commissioningWindowTimeout = commissioningWindowTimeout; + this.commissioningCallbacks = commissioningCallbacks; + this.onConnectionSuccess = onConnectionSuccess; + this.onConnectionFailure = onConnectionFailure; + this.onNewOrUpdatedEndpointCallback = onNewOrUpdatedEndpointCallback; + return true; + } + + public boolean sendCommissioningRequest(DiscoveredNodeData commissioner, Integer vendorId) { + if (commissioningCallbacks == null + || onConnectionSuccess == null + || onConnectionFailure == null + || onNewOrUpdatedEndpointCallback == null) { + Log.e(TAG, "Commissioning/connection callbacks not set"); + return false; + } + + this.targetCastingPlayer = commissioner.getCastingPlayer(); + + IdentificationDeclarationOptions idOptions = new IdentificationDeclarationOptions(); + idOptions.addTargetAppInfo(new TargetAppInfo(vendorId, null)); + + MatterError err = + targetCastingPlayer.verifyOrEstablishConnection( + new ConnectionCallbacks( + new MatterCallback() { + @Override + public void handle(Void response) { + ((MatterCallbackHandler) commissioningCallbacks.getCommissioningComplete()) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + onConnectionSuccess.handleInternal(new VideoPlayer(targetCastingPlayer)); + + List endpoints = targetCastingPlayer.getEndpoints(); + if (endpoints != null) { + for (Endpoint endpoint : endpoints) { + onNewOrUpdatedEndpointCallback.handleInternal(new ContentApp(endpoint)); + } + } + } + }, + new MatterCallback() { + @Override + public void handle(MatterError err) { + onConnectionFailure.handleInternal(new com.chip.casting.MatterError(err)); + } + }, + null), + (short) this.commissioningWindowTimeout, + idOptions); + + if (err.hasError()) { + Log.e( + TAG, "sendCommissioningRequest failed to call verifyOrEstablishConnection. Err: " + err); + return false; + } + + return true; + } + + public boolean verifyOrEstablishConnection( + VideoPlayer targetVideoPlayer, + SuccessCallback onConnectionSuccess, + FailureCallback onConnectionFailure, + SuccessCallback onNewOrUpdatedEndpointCallback) { + Log.e(TAG, "verifyOrEstablishConnection is unsupported"); + return false; + } + + public void shutdownAllSubscriptions() { + MatterError err = CastingApp.getInstance().shutdownAllSubscriptions(); + if (err.hasError()) { + Log.e(TAG, "shutdownAllSubscriptions failed. Err: " + err); + } + } + + public void disconnect() { + if (targetCastingPlayer != null) { + targetCastingPlayer.disconnect(); + } + } + + public boolean purgeCache() { + MatterError err = CastingApp.getInstance().clearCache(); + if (err.hasError()) { + Log.e(TAG, "purgeCache failed. Err: " + err); + return false; + } + return true; + } + + private Endpoint getTargetEndpoint(ContentApp contentApp) { + if (targetCastingPlayer == null || targetCastingPlayer.getEndpoints() == null) { + return null; + } + + for (Endpoint endpoint : targetCastingPlayer.getEndpoints()) { + if (endpoint.getId() == contentApp.getEndpointId()) { + return endpoint; + } + } + + return null; + } + + public boolean contentLauncherLaunchURL( + ContentApp contentApp, String contentUrl, String contentDisplayStr, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ContentLauncherCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.ContentLauncherCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.launchURL( + new ChipClusters.ContentLauncherCluster.LauncherResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "LauncherResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + contentUrl, + Optional.of(contentDisplayStr), + Optional.empty()); + + return true; + } + + public boolean contentLauncher_launchContent( + ContentApp contentApp, + ContentLauncherTypes.ContentSearch searchCompat, + boolean autoPlay, + String data, + Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ContentLauncherCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.ContentLauncherCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + // translate searchCompat + ArrayList parameterList = null; + if (searchCompat.parameterList != null) { + parameterList = new ArrayList<>(); + for (ContentLauncherTypes.Parameter parameterCompat : searchCompat.parameterList) { + ArrayList externalIDList = null; + if (parameterCompat.externalIDList != null && parameterCompat.externalIDList.isPresent()) { + externalIDList = new ArrayList<>(); + for (ContentLauncherTypes.AdditionalInfo additionalInfoCompat : + parameterCompat.externalIDList.get()) { + externalIDList.add( + new ChipStructs.ContentLauncherClusterAdditionalInfoStruct( + additionalInfoCompat.name, additionalInfoCompat.value)); + } + } + parameterList.add( + new ChipStructs.ContentLauncherClusterParameterStruct( + parameterCompat.type, + parameterCompat.value, + externalIDList != null ? Optional.of(externalIDList) : Optional.empty())); + } + } + ChipStructs.ContentLauncherClusterContentSearchStruct search = + new ChipStructs.ContentLauncherClusterContentSearchStruct(parameterList); + + cluster.launchContent( + new ChipClusters.ContentLauncherCluster.LauncherResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "LauncherResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + search, + autoPlay, + data != null ? Optional.of(data) : Optional.empty(), + Optional.empty(), + Optional.empty()); + return true; + } + + public boolean mediaPlayback_play(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.play( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean mediaPlayback_pause(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.pause( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean mediaPlayback_stopPlayback(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.stop( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean mediaPlayback_next(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.next( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean mediaPlayback_previous(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.previous( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean mediaPlayback_rewind(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.rewind( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + Optional.empty()); + return true; + } + + public boolean mediaPlayback_fastForward(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.fastForward( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + Optional.empty()); + return true; + } + + public boolean mediaPlayback_startOver(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.startOver( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean mediaPlayback_seek(ContentApp contentApp, long position, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.seek( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + position); + return true; + } + + public boolean mediaPlayback_skipForward( + ContentApp contentApp, long deltaPositionMilliseconds, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.skipForward( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + deltaPositionMilliseconds); + return true; + } + + public boolean mediaPlayback_skipBackward( + ContentApp contentApp, long deltaPositionMilliseconds, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.skipBackward( + new ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "PlaybackResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + deltaPositionMilliseconds); + return true; + } + + public boolean mediaPlayback_subscribeToCurrentState( + ContentApp contentApp, + SuccessCallback readSuccessHandler, + FailureCallback readFailureHandler, + int minInterval, + int maxInterval, + SubscriptionEstablishedCallback subscriptionEstablishedHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MediaPlaybackCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MediaPlaybackCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.subscribeCurrentStateAttribute( + new ChipClusters.IntegerAttributeCallback() { + @Override + public void onSuccess(int value) { + readSuccessHandler.handleInternal(MediaPlaybackTypes.PlaybackStateEnum.values()[value]); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "IntegerAttributeCallback.onError: " + error); + readFailureHandler.handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + + @Override + public void onSubscriptionEstablished(long subscriptionId) { + subscriptionEstablishedHandler.handleInternal(); + } + }, + minInterval, + maxInterval); + return true; + } + + public boolean applicationLauncher_launchApp( + ContentApp contentApp, + short catalogVendorId, + String applicationId, + byte[] data, + Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ApplicationLauncherCluster cluster = + endpoint != null + ? endpoint.getCluster(ChipClusters.ApplicationLauncherCluster.class) + : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + // translate to application + Optional application = + Optional.empty(); + if (applicationId != null) { + application = + Optional.of( + new ChipStructs.ApplicationLauncherClusterApplicationStruct( + (int) catalogVendorId, applicationId)); + } + + cluster.launchApp( + new ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "LauncherResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + application, + data != null ? Optional.of(data) : Optional.empty()); + return true; + } + + public boolean applicationLauncher_stopApp( + ContentApp contentApp, short catalogVendorId, String applicationId, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ApplicationLauncherCluster cluster = + endpoint != null + ? endpoint.getCluster(ChipClusters.ApplicationLauncherCluster.class) + : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + // translate to application + Optional application = + Optional.empty(); + if (applicationId != null) { + application = + Optional.of( + new ChipStructs.ApplicationLauncherClusterApplicationStruct( + (int) catalogVendorId, applicationId)); + } + + cluster.stopApp( + new ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "LauncherResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + application); + return true; + } + + public boolean applicationLauncher_hideApp( + ContentApp contentApp, short catalogVendorId, String applicationId, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ApplicationLauncherCluster cluster = + endpoint != null + ? endpoint.getCluster(ChipClusters.ApplicationLauncherCluster.class) + : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + // translate to application + Optional application = + Optional.empty(); + if (applicationId != null) { + application = + Optional.of( + new ChipStructs.ApplicationLauncherClusterApplicationStruct( + (int) catalogVendorId, applicationId)); + } + + cluster.hideApp( + new ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "LauncherResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + application); + return true; + } + + public boolean targetNavigator_navigateTarget( + ContentApp contentApp, byte target, String data, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.TargetNavigatorCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.TargetNavigatorCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.navigateTarget( + new ChipClusters.TargetNavigatorCluster.NavigateTargetResponseCallback() { + @Override + public void onSuccess(Integer status, Optional data) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "NavigateTargetResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + (int) target, + data != null ? Optional.of(data) : Optional.empty()); + return true; + } + + public boolean targetNavigator_subscribeToTargetList( + ContentApp contentApp, + SuccessCallback readSuccessHandler, + FailureCallback readFailureHandler, + int minInterval, + int maxInterval, + SubscriptionEstablishedCallback subscriptionEstablishedHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.TargetNavigatorCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.TargetNavigatorCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.subscribeTargetListAttribute( + new ChipClusters.TargetNavigatorCluster.TargetListAttributeCallback() { + @Override + public void onSuccess( + List targetInfoList) { + List targetInfoListCompat = null; + if (targetInfoList != null) { + targetInfoListCompat = new ArrayList<>(); + for (ChipStructs.TargetNavigatorClusterTargetInfoStruct targetInfo : targetInfoList) { + targetInfoListCompat.add( + new TargetNavigatorTypes.TargetInfo(targetInfo.identifier, targetInfo.name)); + } + } + readSuccessHandler.handleInternal(targetInfoListCompat); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "TargetListAttributeCallback.onError: " + error); + readFailureHandler.handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + + @Override + public void onSubscriptionEstablished(long subscriptionId) { + subscriptionEstablishedHandler.handleInternal(); + } + }, + minInterval, + maxInterval); + return true; + } + + public boolean keypadInput_sendKey(ContentApp contentApp, byte keyCode, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.KeypadInputCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.KeypadInputCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.sendKey( + new ChipClusters.KeypadInputCluster.SendKeyResponseCallback() { + @Override + public void onSuccess(Integer status) { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "LauncherResponseCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + (int) keyCode); + return true; + } + + public boolean applicationBasic_readVendorName( + ContentApp contentApp, + SuccessCallback readSuccessHandler, + FailureCallback readFailureHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ApplicationBasicCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.ApplicationBasicCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.readVendorNameAttribute( + new ChipClusters.CharStringAttributeCallback() { + @Override + public void onSuccess(String value) { + readSuccessHandler.handleInternal(value); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "CharStringAttributeCallback.onError: " + error); + readFailureHandler.handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean applicationBasic_readVendorID( + ContentApp contentApp, + SuccessCallback readSuccessHandler, + FailureCallback readFailureHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ApplicationBasicCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.ApplicationBasicCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.readVendorIDAttribute( + new ChipClusters.IntegerAttributeCallback() { + @Override + public void onSuccess(int value) { + readSuccessHandler.handleInternal(value); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "IntegerAttributeCallback.onError: " + error); + readFailureHandler.handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean applicationBasic_readApplicationName( + ContentApp contentApp, + SuccessCallback readSuccessHandler, + FailureCallback readFailureHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ApplicationBasicCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.ApplicationBasicCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.readApplicationNameAttribute( + new ChipClusters.CharStringAttributeCallback() { + @Override + public void onSuccess(String value) { + readSuccessHandler.handleInternal(value); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "CharStringAttributeCallback.onError: " + error); + readFailureHandler.handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean applicationBasic_readProductID( + ContentApp contentApp, + SuccessCallback readSuccessHandler, + FailureCallback readFailureHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ApplicationBasicCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.ApplicationBasicCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.readProductIDAttribute( + new ChipClusters.IntegerAttributeCallback() { + @Override + public void onSuccess(int value) { + readSuccessHandler.handleInternal(value); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "IntegerAttributeCallback.onError: " + error); + readFailureHandler.handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean applicationBasic_readApplicationVersion( + ContentApp contentApp, + SuccessCallback readSuccessHandler, + FailureCallback readFailureHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.ApplicationBasicCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.ApplicationBasicCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.readApplicationVersionAttribute( + new ChipClusters.CharStringAttributeCallback() { + @Override + public void onSuccess(String value) { + readSuccessHandler.handleInternal(value); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "CharStringAttributeCallback.onError: " + error); + readFailureHandler.handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean onOff_on(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.OnOffCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.OnOffCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.on( + new ChipClusters.DefaultClusterCallback() { + @Override + public void onSuccess() { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "DefaultClusterCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean onOff_off(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.OnOffCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.OnOffCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.off( + new ChipClusters.DefaultClusterCallback() { + @Override + public void onSuccess() { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "DefaultClusterCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean onOff_toggle(ContentApp contentApp, Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.OnOffCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.OnOffCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.toggle( + new ChipClusters.DefaultClusterCallback() { + @Override + public void onSuccess() { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "DefaultClusterCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }); + return true; + } + + public boolean messages_presentMessages( + ContentApp contentApp, + byte[] messageID, + Integer priority, + Integer messageControl, + @Nullable Long startTime, + @Nullable Long duration, + String messageText, + Optional> responses, + Object responseHandler) { + + Endpoint endpoint = getTargetEndpoint(contentApp); + ChipClusters.MessagesCluster cluster = + endpoint != null ? endpoint.getCluster(ChipClusters.MessagesCluster.class) : null; + if (cluster == null) { + Log.e(TAG, "Cluster not found"); + return false; + } + + cluster.presentMessagesRequest( + new ChipClusters.DefaultClusterCallback() { + @Override + public void onSuccess() { + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.NO_ERROR); + } + + @Override + public void onError(Exception error) { + Log.e(TAG, "DefaultClusterCallback.onError: " + error); + ((MatterCallbackHandler) responseHandler) + .handleInternal(com.chip.casting.MatterError.MATTER_INTERNAL_ERROR); + } + }, + messageID, + priority, + messageControl, + startTime, + duration, + messageText, + responses); + return true; + } +} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/VideoPlayer.java b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/VideoPlayer.java similarity index 81% rename from examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/VideoPlayer.java rename to examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/VideoPlayer.java index fab9b027a78cc4..1933e28979f8a6 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/VideoPlayer.java +++ b/examples/tv-casting-app/android/App/app/src/compat/jni/com/chip/casting/VideoPlayer.java @@ -17,15 +17,19 @@ */ package com.chip.casting; +import com.matter.casting.core.CastingPlayer; +import com.matter.casting.core.Endpoint; import java.net.InetAddress; -import java.util.HashSet; +import java.util.ArrayList; import java.util.List; import java.util.Objects; -import java.util.Set; +/** @deprecated Use the APIs described in /examples/tv-casting-app/APIs.md instead. */ +@Deprecated public class VideoPlayer { private static final String TAG = VideoPlayer.class.getSimpleName(); + private CastingPlayer castingPlayer; private long nodeId; private byte fabricIndex; private String deviceName; @@ -82,41 +86,25 @@ public VideoPlayer( this.isInitialized = true; } - public boolean isSameAs(DiscoveredNodeData discoveredNodeData) { - // return false because 'this' VideoPlayer is not null - if (discoveredNodeData == null) { - return false; - } - - // return true if hostNames match - if (Objects.equals(hostName, discoveredNodeData.getHostName())) { - return true; - } - - // return false because deviceNames are different - if (Objects.equals(deviceName, discoveredNodeData.getDeviceName()) == false) { - return false; - } - - // return false because not even a single IP Address matches - if (ipAddresses != null) { - boolean matchFound = false; - Set discoveredNodeDataIpAddressSet = - new HashSet(discoveredNodeData.getIpAddresses()); - for (InetAddress videoPlayerIpAddress : ipAddresses) { - if (discoveredNodeDataIpAddressSet.contains(videoPlayerIpAddress)) { - matchFound = true; - break; - } - } - - if (!matchFound) { - return false; + public VideoPlayer(CastingPlayer castingPlayer) { + this.castingPlayer = castingPlayer; + this.deviceType = (int) castingPlayer.getDeviceType(); + this.deviceName = castingPlayer.getDeviceName(); + this.hostName = castingPlayer.getHostName(); + this.ipAddresses = castingPlayer.getIpAddresses(); + this.numIPs = + castingPlayer.getIpAddresses() != null ? castingPlayer.getIpAddresses().size() : 0; + this.isConnected = castingPlayer.isConnected(); + this.productId = castingPlayer.getProductId(); + this.vendorId = castingPlayer.getVendorId(); + List endpoints = castingPlayer.getEndpoints(); + if (endpoints != null) { + this.contentApps = new ArrayList<>(); + for (Endpoint endpoint : endpoints) { + contentApps.add(new ContentApp(endpoint)); } } - - // otherwise, return true - return true; + this.isInitialized = true; } public boolean equals(Object object) { @@ -175,6 +163,10 @@ public String toString() { + '}'; } + CastingPlayer getCastingPlayer() { + return castingPlayer; + } + public long getNodeId() { return nodeId; } diff --git a/examples/tv-casting-app/android/App/app/src/main/AndroidManifest.xml b/examples/tv-casting-app/android/App/app/src/main/AndroidManifest.xml index e551de818eb5b0..b47ec80a86b0d9 100644 --- a/examples/tv-casting-app/android/App/app/src/main/AndroidManifest.xml +++ b/examples/tv-casting-app/android/App/app/src/main/AndroidManifest.xml @@ -18,9 +18,9 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:name=".chip.casting.app.ChipTvCastingApplication" + android:name=".matter.casting.ChipTvCastingApplication" android:theme="@style/Theme.CHIPTVCastingApp"> - diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/GlobalCastingConstants.java b/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/GlobalCastingConstants.java deleted file mode 100644 index 483f1efedb1b46..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/util/GlobalCastingConstants.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.chip.casting.util; - -public class GlobalCastingConstants { - public static final String CommissionerServiceType = "_matterd._udp."; - public static final int CommissioningWindowDurationSecs = 3 * 60; - public static final int SetupPasscode = 20202021; - public static final int Discriminator = 0xF00; - public static final boolean ChipCastingSimplified = - true; // set to true, to demo the simplified casting APIs. Otherwise, the older deprecated - // APIs are invoked -} diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ChipTvCastingApplication.java b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ChipTvCastingApplication.java similarity index 84% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ChipTvCastingApplication.java rename to examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ChipTvCastingApplication.java index 4986cc28e49c01..bea5b88a310158 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/ChipTvCastingApplication.java +++ b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ChipTvCastingApplication.java @@ -1,4 +1,4 @@ -package com.chip.casting.app; +package com.matter.casting; import android.app.Application; diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/MainActivity.java b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/MainActivity.java similarity index 92% rename from examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/MainActivity.java rename to examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/MainActivity.java index 685dbf2fb6426e..53908322d10155 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/chip/casting/app/MainActivity.java +++ b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/MainActivity.java @@ -1,4 +1,4 @@ -package com.chip.casting.app; +package com.matter.casting; import android.os.Bundle; import android.util.Log; @@ -9,15 +9,13 @@ import com.chip.casting.AppParameters; import com.chip.casting.DiscoveredNodeData; import com.chip.casting.TvCastingApp; +import com.chip.casting.app.CertTestFragment; +import com.chip.casting.app.CommissionerDiscoveryFragment; +import com.chip.casting.app.ConnectionFragment; +import com.chip.casting.app.ContentLauncherFragment; +import com.chip.casting.app.MediaPlaybackFragment; +import com.chip.casting.app.SelectClusterFragment; import com.chip.casting.util.GlobalCastingConstants; -import com.matter.casting.ActionSelectorFragment; -import com.matter.casting.ApplicationBasicReadVendorIDExampleFragment; -import com.matter.casting.ConnectionExampleFragment; -import com.matter.casting.ContentLauncherLaunchURLExampleFragment; -import com.matter.casting.DiscoveryExampleFragment; -import com.matter.casting.InitializationExample; -import com.matter.casting.MediaPlaybackSubscribeToCurrentStateExampleFragment; -import com.matter.casting.PreferencesConfigurationManager; import com.matter.casting.core.CastingPlayer; import java.util.Random; diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdDiscoveryListener.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdDiscoveryListener.java deleted file mode 100644 index 1a9556e5fdb6d2..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdDiscoveryListener.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.chip.casting; - -import android.net.nsd.NsdManager; -import android.net.nsd.NsdServiceInfo; -import android.util.Log; -import chip.platform.NsdManagerServiceResolver; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -public class NsdDiscoveryListener implements NsdManager.DiscoveryListener { - private static final String TAG = NsdDiscoveryListener.class.getSimpleName(); - - private final NsdManager nsdManager; - private final String targetServiceType; - private final List deviceTypeFilter; - private final List preCommissionedVideoPlayers; - private final SuccessCallback successCallback; - private final FailureCallback failureCallback; - private final NsdManagerServiceResolver.NsdManagerResolverAvailState nsdManagerResolverAvailState; - private final ExecutorService resolutionExecutor; - - public NsdDiscoveryListener( - NsdManager nsdManager, - String targetServiceType, - List deviceTypeFilter, - List preCommissionedVideoPlayers, - SuccessCallback successCallback, - FailureCallback failureCallback, - NsdManagerServiceResolver.NsdManagerResolverAvailState nsdManagerResolverAvailState) { - this.nsdManager = nsdManager; - this.targetServiceType = targetServiceType; - this.deviceTypeFilter = deviceTypeFilter; - this.preCommissionedVideoPlayers = preCommissionedVideoPlayers; - this.successCallback = successCallback; - this.failureCallback = failureCallback; - this.nsdManagerResolverAvailState = nsdManagerResolverAvailState; - this.resolutionExecutor = Executors.newSingleThreadExecutor(); - } - - @Override - public void onDiscoveryStarted(String regType) { - Log.d(TAG, "Service discovery started. regType: " + regType); - } - - @Override - public void onServiceFound(NsdServiceInfo service) { - this.resolutionExecutor.execute( - new Runnable() { - @Override - public void run() { - Log.d(TAG, "Service discovery success. " + service); - if (service.getServiceType().equals(targetServiceType)) { - if (nsdManagerResolverAvailState != null) { - nsdManagerResolverAvailState.acquireResolver(); - } - - Log.d(TAG, "Calling NsdManager.resolveService for " + service); - nsdManager.resolveService( - service, - new NsdResolveListener( - nsdManager, - deviceTypeFilter, - preCommissionedVideoPlayers, - successCallback, - failureCallback, - nsdManagerResolverAvailState, - 1)); - } else { - Log.d(TAG, "Ignoring discovered service: " + service.toString()); - } - } - }); - } - - @Override - public void onServiceLost(NsdServiceInfo service) { - // When the network service is no longer available. - // Internal bookkeeping code goes here. - Log.e(TAG, "Service lost: " + service); - failureCallback.handle(MatterError.DISCOVERY_SERVICE_LOST); - } - - @Override - public void onDiscoveryStopped(String serviceType) { - Log.i(TAG, "Discovery stopped: " + serviceType); - if (nsdManagerResolverAvailState != null) { - nsdManagerResolverAvailState.signalFree(); - } - } - - @Override - public void onStartDiscoveryFailed(String serviceType, int errorCode) { - Log.e(TAG, "Discovery failed to start: Error code:" + errorCode); - TvCastingApp.getInstance().resetDiscoveryState(); - failureCallback.handle( - new MatterError( - 3, "NsdDiscoveryListener Discovery failed to start: Nsd Error code:" + errorCode)); - } - - @Override - public void onStopDiscoveryFailed(String serviceType, int errorCode) { - Log.e(TAG, "Discovery failed to stop: Error code:" + errorCode); - if (nsdManagerResolverAvailState != null) { - nsdManagerResolverAvailState.signalFree(); - } - failureCallback.handle( - new MatterError( - 3, "NsdDiscoveryListener Discovery failed to stop: Nsd Error code:" + errorCode)); - } -} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdResolveListener.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdResolveListener.java deleted file mode 100644 index 638425675dc99b..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/NsdResolveListener.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.chip.casting; - -import android.net.nsd.NsdManager; -import android.net.nsd.NsdServiceInfo; -import android.util.Log; -import chip.platform.NsdManagerServiceResolver; -import java.util.List; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; - -public class NsdResolveListener implements NsdManager.ResolveListener { - - private static final String TAG = NsdResolveListener.class.getSimpleName(); - - private static final int MAX_RESOLUTION_ATTEMPTS = 5; - private static final int RESOLUTION_ATTEMPT_DELAY_SECS = 1; - - private final NsdManager nsdManager; - private final List deviceTypeFilter; - private final List preCommissionedVideoPlayers; - private final SuccessCallback successCallback; - private final FailureCallback failureCallback; - private final NsdManagerServiceResolver.NsdManagerResolverAvailState nsdManagerResolverAvailState; - private final int resolutionAttemptNumber; - - public NsdResolveListener( - NsdManager nsdManager, - List deviceTypeFilter, - List preCommissionedVideoPlayers, - SuccessCallback successCallback, - FailureCallback failureCallback, - NsdManagerServiceResolver.NsdManagerResolverAvailState nsdManagerResolverAvailState, - int resolutionAttemptNumber) { - this.nsdManager = nsdManager; - this.deviceTypeFilter = deviceTypeFilter; - this.preCommissionedVideoPlayers = preCommissionedVideoPlayers; - if (preCommissionedVideoPlayers != null) { - for (VideoPlayer videoPlayer : preCommissionedVideoPlayers) { - Log.d(TAG, "Precommissioned video player: " + videoPlayer); - } - } - this.successCallback = successCallback; - this.failureCallback = failureCallback; - this.nsdManagerResolverAvailState = nsdManagerResolverAvailState; - this.resolutionAttemptNumber = resolutionAttemptNumber; - } - - @Override - public void onServiceResolved(NsdServiceInfo serviceInfo) { - DiscoveredNodeData discoveredNodeData = new DiscoveredNodeData(serviceInfo); - Log.d(TAG, "DiscoveredNodeData resolved: " + discoveredNodeData); - - if (nsdManagerResolverAvailState != null) { - nsdManagerResolverAvailState.signalFree(); - } - - if (isPassingDeviceTypeFilter(discoveredNodeData)) { - addCommissioningInfo(discoveredNodeData); - successCallback.handle(discoveredNodeData); - } else { - Log.d( - TAG, - "DiscoveredNodeData ignored because it did not pass the device type filter " - + discoveredNodeData); - } - } - - @Override - public void onResolveFailed(NsdServiceInfo serviceInfo, int errorCode) { - if (nsdManagerResolverAvailState != null) { - if (errorCode != NsdManager.FAILURE_ALREADY_ACTIVE - || resolutionAttemptNumber >= MAX_RESOLUTION_ATTEMPTS) { - nsdManagerResolverAvailState.signalFree(); - } - } - - switch (errorCode) { - case NsdManager.FAILURE_ALREADY_ACTIVE: - Log.e(TAG, "NsdResolveListener FAILURE_ALREADY_ACTIVE - Service: " + serviceInfo); - if (resolutionAttemptNumber < MAX_RESOLUTION_ATTEMPTS) { - Log.d(TAG, "NsdResolveListener Scheduling a retry to resolve service " + serviceInfo); - Executors.newSingleThreadScheduledExecutor() - .schedule( - new Runnable() { - @Override - public void run() { - nsdManager.resolveService( - serviceInfo, - new NsdResolveListener( - nsdManager, - deviceTypeFilter, - preCommissionedVideoPlayers, - successCallback, - failureCallback, - nsdManagerResolverAvailState, - resolutionAttemptNumber + 1)); - } - }, - RESOLUTION_ATTEMPT_DELAY_SECS, - TimeUnit.SECONDS); - } else { // giving up - failureCallback.handle( - new MatterError( - 3, "NsdResolveListener FAILURE_ALREADY_ACTIVE - Service: " + serviceInfo)); - } - break; - case NsdManager.FAILURE_INTERNAL_ERROR: - Log.e(TAG, "NsdResolveListener FAILURE_INTERNAL_ERROR - Service: " + serviceInfo); - failureCallback.handle( - new MatterError( - 3, "NsdResolveListener FAILURE_INTERNAL_ERROR - Service: " + serviceInfo)); - break; - case NsdManager.FAILURE_MAX_LIMIT: - Log.e(TAG, "NsdResolveListener FAILURE_MAX_LIMIT - Service: " + serviceInfo); - failureCallback.handle( - new MatterError(19, "NsdResolveListener FAILURE_MAX_LIMIT - Service: " + serviceInfo)); - break; - } - } - - private boolean isPassingDeviceTypeFilter(DiscoveredNodeData discoveredNodeData) { - return deviceTypeFilter == null - || deviceTypeFilter.isEmpty() - || deviceTypeFilter.contains(discoveredNodeData.getDeviceType()); - } - - private void addCommissioningInfo(DiscoveredNodeData discoveredNodeData) { - if (preCommissionedVideoPlayers != null) { - long currentUnixTimeMS = System.currentTimeMillis(); - for (VideoPlayer videoPlayer : preCommissionedVideoPlayers) { - if (videoPlayer.isSameAs(discoveredNodeData)) { - Log.d( - TAG, - "Matching Video Player with the following information found for DiscoveredNodeData" - + videoPlayer); - Log.d(TAG, "Updating discovery timestamp for VideoPlayer to " + currentUnixTimeMS); - videoPlayer.setLastDiscoveredMs(currentUnixTimeMS); - discoveredNodeData.setConnectableVideoPlayer(videoPlayer); - return; - } - } - } - Log.d( - TAG, - "No matching VideoPlayers found from the cache for new DiscoveredNodeData: " - + discoveredNodeData); - } -} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TvCastingApp.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TvCastingApp.java deleted file mode 100644 index 9dd0fa500d9e2b..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/TvCastingApp.java +++ /dev/null @@ -1,608 +0,0 @@ -/* - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package com.chip.casting; - -import android.content.Context; -import android.net.nsd.NsdManager; -import android.net.wifi.WifiManager; -import android.util.Log; -import chip.appserver.ChipAppServer; -import chip.platform.AndroidBleManager; -import chip.platform.AndroidChipPlatform; -import chip.platform.ChipMdnsCallbackImpl; -import chip.platform.DiagnosticDataProviderImpl; -import chip.platform.NsdManagerServiceBrowser; -import chip.platform.NsdManagerServiceResolver; -import chip.platform.PreferencesKeyValueStoreManager; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import java.util.function.Predicate; - -public class TvCastingApp { - private static final String TAG = TvCastingApp.class.getSimpleName(); - private static final String DISCOVERY_TARGET_SERVICE_TYPE = "_matterd._udp."; - private static final List DISCOVERY_TARGET_DEVICE_TYPE_FILTER = - Arrays.asList(35L); // Video player = 35; - - // delay before which we assume undiscovered cached players may be in STR mode - private static final long CHIP_DEVICE_CONFIG_STR_DISCOVERY_DELAY_SEC = 5; - - private static TvCastingApp sInstance; - private Context applicationContext; - private ChipAppServer chipAppServer; - private NsdManagerServiceResolver.NsdManagerResolverAvailState nsdManagerResolverAvailState; - private boolean discoveryStarted = false; - private Object discoveryLock = new Object(); - - private List discoveredPlayers; - private ScheduledFuture reportSleepingVideoPlayerCommissionersFuture; - - private WifiManager.MulticastLock multicastLock; - private NsdManager nsdManager; - private NsdDiscoveryListener nsdDiscoveryListener; - - private TvCastingApp() {} - - public static TvCastingApp getInstance() { - if (sInstance == null) { - sInstance = new TvCastingApp(); - } - return sInstance; - } - - public boolean initApp(Context applicationContext, AppParameters appParameters) { - if (applicationContext == null - || appParameters == null - || appParameters.getConfigurationManager() == null) { - return false; - } - - this.applicationContext = applicationContext; - nsdManagerResolverAvailState = new NsdManagerServiceResolver.NsdManagerResolverAvailState(); - NsdManagerServiceResolver nsdManagerServiceResolver = - new NsdManagerServiceResolver(applicationContext, nsdManagerResolverAvailState); - - AndroidChipPlatform chipPlatform = - new AndroidChipPlatform( - new AndroidBleManager(), - new PreferencesKeyValueStoreManager(applicationContext), - appParameters.getConfigurationManager(), - nsdManagerServiceResolver, - new NsdManagerServiceBrowser(applicationContext), - new ChipMdnsCallbackImpl(), - new DiagnosticDataProviderImpl(applicationContext)); - - boolean ret = - chipPlatform.updateCommissionableDataProviderData( - appParameters.getSpake2pVerifierBase64(), - appParameters.getSpake2pSaltBase64(), - appParameters.getSpake2pIterationCount(), - appParameters.getSetupPasscode(), - appParameters.getDiscriminator()); - if (!ret) { - Log.e( - TAG, - "TvCastingApp.initApp failed to updateCommissionableDataProviderData on chipPlatform"); - return ret; - } - - ret = preInitJni(appParameters); - if (!ret) { - Log.e(TAG, "TvCastingApp.initApp failed in preInitJni"); - return ret; - } - - chipAppServer = new ChipAppServer(); - ret = chipAppServer.startApp(); - if (!ret) { - Log.e(TAG, "TvCastingApp.initApp failed in start chipAppServer"); - return ret; - } - - return initJni(appParameters); - } - - public native void setDACProvider(DACProvider provider); - - private native boolean preInitJni(AppParameters appParameters); - - private native boolean initJni(AppParameters appParameters); - - public void discoverVideoPlayerCommissioners( - SuccessCallback discoverySuccessCallback, - FailureCallback discoveryFailureCallback) { - synchronized (discoveryLock) { - Log.d(TAG, "TvCastingApp.discoverVideoPlayerCommissioners called"); - - if (this.discoveryStarted) { - Log.d(TAG, "Discovery already started, stopping before starting again"); - stopVideoPlayerDiscovery(); - } - - List preCommissionedVideoPlayers = readCachedVideoPlayers(); - - WifiManager wifiManager = - (WifiManager) applicationContext.getSystemService(Context.WIFI_SERVICE); - multicastLock = wifiManager.createMulticastLock("multicastLock"); - multicastLock.setReferenceCounted(true); - multicastLock.acquire(); - - nsdManager = (NsdManager) applicationContext.getSystemService(Context.NSD_SERVICE); - discoveredPlayers = new ArrayList<>(); - nsdDiscoveryListener = - new NsdDiscoveryListener( - nsdManager, - DISCOVERY_TARGET_SERVICE_TYPE, - DISCOVERY_TARGET_DEVICE_TYPE_FILTER, - preCommissionedVideoPlayers, - new SuccessCallback() { - @Override - public void handle(DiscoveredNodeData commissioner) { - Log.d(TAG, "Discovered commissioner added " + commissioner); - discoveredPlayers.add(commissioner); - discoverySuccessCallback.handle(commissioner); - } - }, - discoveryFailureCallback, - nsdManagerResolverAvailState); - - nsdManager.discoverServices( - DISCOVERY_TARGET_SERVICE_TYPE, NsdManager.PROTOCOL_DNS_SD, nsdDiscoveryListener); - Log.d(TAG, "TvCastingApp.discoverVideoPlayerCommissioners started"); - - /** - * Surface players (as DiscoveredNodeData objects on discoverySuccessCallback) that we - * previously connected to and received their WakeOnLAN MACAddress, but could not discover - * over DNS-SD this time in CHIP_DEVICE_CONFIG_STR_DISCOVERY_DELAY_SEC. This API will also - * ensure that the reported players were previously discoverable within - * CHIP_DEVICE_CONFIG_STR_CACHE_LAST_DISCOVERED_HOURS. - * - *

The DiscoveredNodeData object for such players will have the IsAsleep attribute set to - * true, which can optionally be used for any special UX treatment when displaying them. - * - *

Surfacing such players as discovered will allow displaying them to the user, who may - * want to cast to them. In such a case, the VerifyOrEstablishConnection API will turn them on - * over WakeOnLan. - */ - this.reportSleepingVideoPlayerCommissionersFuture = - Executors.newScheduledThreadPool(1) - .schedule( - () -> { - Log.d( - TAG, - "Scheduling reportSleepingCommissioners with commissioner count " - + (preCommissionedVideoPlayers != null - ? preCommissionedVideoPlayers.size() - : 0)); - reportSleepingVideoPlayerCommissioners( - preCommissionedVideoPlayers, discoverySuccessCallback); - }, - CHIP_DEVICE_CONFIG_STR_DISCOVERY_DELAY_SEC * 1000, - TimeUnit.MILLISECONDS); - - this.discoveryStarted = true; - } - } - - private void reportSleepingVideoPlayerCommissioners( - List cachedVideoPlayers, - SuccessCallback discoverySuccessCallback) { - Log.d( - TAG, - "TvCastingApp.reportSleepingVideoPlayerCommissioners called with commissioner count " - + (cachedVideoPlayers != null ? cachedVideoPlayers.size() : 0)); - if (cachedVideoPlayers == null) { - Log.d(TAG, "No cached video players available."); - return; - } - - for (VideoPlayer player : cachedVideoPlayers) { - Log.d(TAG, "Cached Video Player: " + player); - // do NOT surface this cached Player if we don't have its MACAddress - if (player.getMACAddress() == null) { - Log.d( - TAG, - "TvCastingApp.reportSleepingVideoPlayerCommissioners Skipping Player with hostName" - + player.getHostName() - + " but no MACAddress"); - continue; - } - - // do NOT surface this cached Player if it has not been discoverable recently (in - // CHIP_DEVICE_CONFIG_STR_CACHE_LAST_DISCOVERED_HOURS) - if (!WasRecentlyDiscoverable(player)) { - Log.d( - TAG, - "TvCastingApp.reportSleepingVideoPlayerCommissioners Skipping Player with hostName" - + player.getHostName() - + " that has not been discovered recently"); - continue; - } - - // do NOT surface this cached Player if it was just discovered right now (in this discovery - // call) - boolean justDiscovered = - discoveredPlayers - .stream() - .anyMatch( - new Predicate() { - @Override - public boolean test(DiscoveredNodeData discoveredNodeData) { - return player.getHostName().equals(discoveredNodeData.getHostName()); - } - }); - if (justDiscovered) { - Log.d( - TAG, - "TvCastingApp.reportSleepingVideoPlayerCommissioners Skipping Player with hostName" - + player.getHostName() - + " that was just discovered"); - continue; - } - - // DO surface this cached Player (as asleep) - Log.d(TAG, "Reporting sleeping player with hostName " + player.getHostName()); - player.setIsAsleep(true); - discoverySuccessCallback.handle(new DiscoveredNodeData(player)); - } - } - - private native boolean WasRecentlyDiscoverable(VideoPlayer player); - - public void stopVideoPlayerDiscovery() { - synchronized (discoveryLock) { - Log.d(TAG, "TvCastingApp trying to stop video player discovery"); - if (this.discoveryStarted - && nsdManager != null - && multicastLock != null - && nsdDiscoveryListener != null) { - Log.d(TAG, "TvCastingApp stopping Video Player commissioner discovery"); - try { - nsdManager.stopServiceDiscovery(nsdDiscoveryListener); - } catch (IllegalArgumentException e) { - Log.w( - TAG, - "TvCastingApp received exception on calling nsdManager.stopServiceDiscovery() " - + e.getMessage()); - } - - if (multicastLock.isHeld()) { - multicastLock.release(); - } - - if (reportSleepingVideoPlayerCommissionersFuture != null) { - reportSleepingVideoPlayerCommissionersFuture.cancel(false); - } - this.discoveryStarted = false; - } - } - } - - void resetDiscoveryState() { - synchronized (discoveryLock) { - Log.d(TAG, "TvCastingApp resetting discovery state"); - this.discoveryStarted = false; - this.nsdDiscoveryListener = null; - if (multicastLock != null && multicastLock.isHeld()) { - multicastLock.release(); - } - } - } - - public native boolean openBasicCommissioningWindow( - int duration, - CommissioningCallbacks commissioningCallbacks, - SuccessCallback onConnectionSuccess, - FailureCallback onConnectionFailure, - SuccessCallback onNewOrUpdatedEndpointCallback); - - public native boolean sendCommissioningRequest(DiscoveredNodeData commissioner); - - /** @Deprecated Use sendCommissioningRequest(DiscoveredNodeData) instead */ - private native boolean sendUserDirectedCommissioningRequest(String address, int port); - - public native List readCachedVideoPlayers(); - - public native boolean verifyOrEstablishConnection( - VideoPlayer targetVideoPlayer, - SuccessCallback onConnectionSuccess, - FailureCallback onConnectionFailure, - SuccessCallback onNewOrUpdatedEndpointCallback); - - public native void shutdownAllSubscriptions(); - - public native void disconnect(); - - public native List getActiveTargetVideoPlayers(); - - public native boolean purgeCache(); - - /* - * CONTENT LAUNCHER CLUSTER - * - * TODO: Add API to subscribe to AcceptHeader - */ - public native boolean contentLauncherLaunchURL( - ContentApp contentApp, String contentUrl, String contentDisplayStr, Object launchURLHandler); - - public native boolean contentLauncher_launchContent( - ContentApp contentApp, - ContentLauncherTypes.ContentSearch search, - boolean autoPlay, - String data, - Object responseHandler); - - public native boolean contentLauncher_subscribeToSupportedStreamingProtocols( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - /* - * LEVEL CONTROL CLUSTER - */ - public native boolean levelControl_step( - ContentApp contentApp, - byte stepMode, - byte stepSize, - short transitionTime, - byte optionMask, - byte optionOverridem, - Object responseHandler); - - public native boolean levelControl_moveToLevel( - ContentApp contentApp, - byte level, - short transitionTime, - byte optionMask, - byte optionOverridem, - Object responseHandler); - - public native boolean levelControl_subscribeToCurrentLevel( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean levelControl_subscribeToMinLevel( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean levelControl_subscribeToMaxLevel( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - /* - * MEDIA PLAYBACK CLUSTER - */ - public native boolean mediaPlayback_play(ContentApp contentApp, Object responseHandler); - - public native boolean mediaPlayback_pause(ContentApp contentApp, Object responseHandler); - - public native boolean mediaPlayback_stopPlayback(ContentApp contentApp, Object responseHandler); - - public native boolean mediaPlayback_next(ContentApp contentApp, Object responseHandler); - - public native boolean mediaPlayback_previous(ContentApp contentApp, Object responseHandler); - - public native boolean mediaPlayback_rewind(ContentApp contentApp, Object responseHandler); - - public native boolean mediaPlayback_fastForward(ContentApp contentApp, Object responseHandler); - - public native boolean mediaPlayback_startOver(ContentApp contentApp, Object responseHandler); - - public native boolean mediaPlayback_seek( - ContentApp contentApp, long position, Object responseHandler); - - public native boolean mediaPlayback_skipForward( - ContentApp contentApp, long deltaPositionMilliseconds, Object responseHandler); - - public native boolean mediaPlayback_skipBackward( - ContentApp contentApp, long deltaPositionMilliseconds, Object responseHandler); - - public native boolean mediaPlayback_subscribeToCurrentState( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean mediaPlayback_subscribeToDuration( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean mediaPlayback_subscribeToSampledPosition( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean mediaPlayback_subscribeToPlaybackSpeed( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean mediaPlayback_subscribeToSeekRangeEnd( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean mediaPlayback_subscribeToSeekRangeStart( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - /* - * APPLICATION LAUNCHER CLUSTER - */ - public native boolean applicationLauncher_launchApp( - ContentApp contentApp, - short catalogVendorId, - String applicationId, - byte[] data, - Object responseHandler); - - public native boolean applicationLauncher_stopApp( - ContentApp contentApp, short catalogVendorId, String applicationId, Object responseHandler); - - public native boolean applicationLauncher_hideApp( - ContentApp contentApp, short catalogVendorId, String applicationId, Object responseHandler); - - /* - * TARGET NAVIGATOR CLUSTER - */ - public native boolean targetNavigator_navigateTarget( - ContentApp contentApp, byte target, String data, Object responseHandler); - - public native boolean targetNavigator_subscribeToCurrentTarget( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean targetNavigator_subscribeToTargetList( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - /* - * KEYPAD INPUT CLUSTER - */ - public native boolean keypadInput_sendKey( - ContentApp contentApp, byte keyCode, Object responseHandler); - - /** - * APPLICATION BASIC - * - *

TODO: Add APIs to subscribe to & read Application, Status and AllowedVendorList - */ - public native boolean applicationBasic_subscribeToVendorName( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean applicationBasic_subscribeToVendorID( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean applicationBasic_subscribeToApplicationName( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean applicationBasic_subscribeToProductID( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean applicationBasic_subscribeToApplicationVersion( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler, - int minInterval, - int maxInterval, - SubscriptionEstablishedCallback subscriptionEstablishedHandler); - - public native boolean applicationBasic_readVendorName( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler); - - public native boolean applicationBasic_readVendorID( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler); - - public native boolean applicationBasic_readApplicationName( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler); - - public native boolean applicationBasic_readProductID( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler); - - public native boolean applicationBasic_readApplicationVersion( - ContentApp contentApp, - SuccessCallback readSuccessHandler, - FailureCallback readFailureHandler); - - public native boolean onOff_on(ContentApp contentApp, Object responseHandler); - - public native boolean onOff_off(ContentApp contentApp, Object responseHandler); - - public native boolean onOff_toggle(ContentApp contentApp, Object responseHandler); - - public native boolean messages_presentMessages( - ContentApp contentApp, String messageText, Object responseHandler); - - static { - System.loadLibrary("TvCastingApp"); - } -} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/DataProvider.java b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/DataProvider.java index 854cf76ce8aca8..63e8da3d31b609 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/DataProvider.java +++ b/examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/support/DataProvider.java @@ -20,7 +20,7 @@ import android.util.Log; public interface DataProvider { - public static final String TAG = DataProvider.class.getSimpleName(); + String TAG = DataProvider.class.getSimpleName(); default T _get() { T val = null; @@ -32,5 +32,5 @@ default T _get() { return val; } - public abstract T get(); + T get(); } diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/Constants.h b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/Constants.h deleted file mode 100644 index 735cabf2375f51..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/Constants.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -#pragma once - -enum MediaCommandName -{ - ContentLauncher_LaunchURL, - ContentLauncher_LaunchContent, - LevelControl_Step, - LevelControl_MoveToLevel, - OnOff_On, - OnOff_Off, - OnOff_Toggle, - MediaPlayback_Play, - MediaPlayback_Pause, - MediaPlayback_StopPlayback, - MediaPlayback_Next, - MediaPlayback_Previous, - MediaPlayback_Rewind, - MediaPlayback_FastForward, - MediaPlayback_StartOver, - MediaPlayback_Seek, - MediaPlayback_SkipForward, - MediaPlayback_SkipBackward, - Messages_PresentMessagesRequest, - ApplicationLauncher_LaunchApp, - ApplicationLauncher_StopApp, - ApplicationLauncher_HideApp, - TargetNavigator_NavigateTarget, - KeypadInput_SendKey, - - MEDIA_COMMAND_COUNT -}; - -enum MediaAttributeName -{ - ContentLauncher_SupportedStreamingProtocols, - ContentLauncher_AcceptHeader, - LevelControl_CurrentLevel, - LevelControl_MinLevel, - LevelControl_MaxLevel, - MediaPlayback_CurrentState, - MediaPlayback_StartTime, - MediaPlayback_Duration, - MediaPlayback_SampledPosition, - MediaPlayback_PlaybackSpeed, - MediaPlayback_SeekRangeEnd, - MediaPlayback_SeekRangeStart, - ApplicationLauncher_CurrentApp, - TargetNavigator_TargetList, - TargetNavigator_CurrentTarget, - ApplicationBasic_VendorName, - ApplicationBasic_VendorID, - ApplicationBasic_ApplicationName, - ApplicationBasic_ProductID, - ApplicationBasic_ApplicationVersion, - - MEDIA_ATTRIBUTE_COUNT -}; diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.cpp deleted file mode 100644 index c8a38942e60234..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.cpp +++ /dev/null @@ -1,410 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "ConversionUtils.h" - -#include -#include -#include -#include -#include -#include -#include - -CHIP_ERROR convertJAppParametersToCppAppParams(jobject appParameters, AppParams & outAppParams) -{ - ChipLogProgress(AppServer, "convertJAppParametersToCppAppParams called"); - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - VerifyOrReturnError(appParameters != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - - jclass jAppParametersClass; - ReturnErrorOnFailure( - chip::JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/AppParameters", jAppParametersClass)); - - jmethodID getRotatingDeviceIdUniqueIdMethod = env->GetMethodID(jAppParametersClass, "getRotatingDeviceIdUniqueId", "()[B"); - if (getRotatingDeviceIdUniqueIdMethod == nullptr) - { - ChipLogError(Zcl, "Failed to access AppParameters 'getRotatingDeviceIdUniqueId' method"); - env->ExceptionClear(); - } - - jobject jRotatingDeviceIdUniqueId = (jobject) env->CallObjectMethod(appParameters, getRotatingDeviceIdUniqueIdMethod); - if (env->ExceptionCheck()) - { - ChipLogError(Zcl, "Java exception in AppParameters::getRotatingDeviceIdUniqueId"); - env->ExceptionDescribe(); - env->ExceptionClear(); - return CHIP_ERROR_INCORRECT_STATE; - } - - if (jRotatingDeviceIdUniqueId != nullptr) - { - chip::JniByteArray * jniRotatingDeviceIdUniqueIdByteArray = - new chip::JniByteArray(env, static_cast(jRotatingDeviceIdUniqueId)); - outAppParams.SetRotatingDeviceIdUniqueId(MakeOptional(jniRotatingDeviceIdUniqueIdByteArray->byteSpan())); - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR convertJContentAppToTargetEndpointInfo(jobject contentApp, TargetEndpointInfo & outTargetEndpointInfo) -{ - ChipLogProgress(AppServer, "convertJContentAppToTargetEndpointInfo called"); - VerifyOrReturnError(contentApp != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass jContentAppClass; - ReturnErrorOnFailure(chip::JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/ContentApp", jContentAppClass)); - - jfieldID jEndpointIdField = env->GetFieldID(jContentAppClass, "endpointId", "S"); - jshort jEndpointId = env->GetShortField(contentApp, jEndpointIdField); - outTargetEndpointInfo.Initialize(static_cast(jEndpointId)); - - jfieldID jclusterIdsField = env->GetFieldID(jContentAppClass, "clusterIds", "Ljava/util/List;"); - jobject jClusterIds = env->GetObjectField(contentApp, jclusterIdsField); - if (jClusterIds == nullptr) - { - return CHIP_NO_ERROR; - } - - jobject jIterator = env->CallObjectMethod( - jClusterIds, env->GetMethodID(env->GetObjectClass(jClusterIds), "iterator", "()Ljava/util/Iterator;")); - jmethodID jNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "next", "()Ljava/lang/Object;"); - jmethodID jHasNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "hasNext", "()Z"); - - while (env->CallBooleanMethod(jIterator, jHasNextMid)) - { - jobject jClusterId = env->CallObjectMethod(jIterator, jNextMid); - jclass jIntegerClass = env->FindClass("java/lang/Integer"); - jmethodID jIntValueMid = env->GetMethodID(jIntegerClass, "intValue", "()I"); - outTargetEndpointInfo.AddCluster(static_cast(env->CallIntMethod(jClusterId, jIntValueMid))); - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR convertTargetEndpointInfoToJContentApp(TargetEndpointInfo * targetEndpointInfo, jobject & outContentApp) -{ - ChipLogProgress(AppServer, "convertTargetEndpointInfoToJContentApp called"); - if (targetEndpointInfo != nullptr && targetEndpointInfo->IsInitialized()) - { - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass jContentAppClass; - ReturnErrorOnFailure( - chip::JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/ContentApp", jContentAppClass)); - jmethodID jContentAppConstructor = env->GetMethodID(jContentAppClass, "", "(SLjava/util/List;)V"); - chip::ClusterId * clusters = targetEndpointInfo->GetClusters(); - jobject jClustersArrayList = nullptr; - if (clusters != nullptr) - { - chip::JniReferences::GetInstance().CreateArrayList(jClustersArrayList); - for (size_t i = 0; i < kMaxNumberOfClustersPerEndpoint && clusters[i] != chip::kInvalidClusterId; i++) - { - jobject jCluster = nullptr; - jint jniclusterId = static_cast(clusters[i]); - chip::JniReferences::GetInstance().CreateBoxedObject("java/lang/Integer", "(I)V", jniclusterId, jCluster); - chip::JniReferences::GetInstance().AddToList(jClustersArrayList, jCluster); - } - } - outContentApp = - env->NewObject(jContentAppClass, jContentAppConstructor, targetEndpointInfo->GetEndpointId(), jClustersArrayList); - } - return CHIP_NO_ERROR; -} - -CHIP_ERROR convertJVideoPlayerToTargetVideoPlayerInfo(jobject videoPlayer, TargetVideoPlayerInfo & outTargetVideoPlayerInfo) -{ - ChipLogProgress(AppServer, "convertJVideoPlayerToTargetVideoPlayerInfo called"); - VerifyOrReturnError(videoPlayer != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass jVideoPlayerClass; - ReturnErrorOnFailure( - chip::JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/VideoPlayer", jVideoPlayerClass)); - - jfieldID jNodeIdField = env->GetFieldID(jVideoPlayerClass, "nodeId", "J"); - chip::NodeId nodeId = static_cast(env->GetLongField(videoPlayer, jNodeIdField)); - - jfieldID jFabricIndexField = env->GetFieldID(jVideoPlayerClass, "fabricIndex", "B"); - chip::FabricIndex fabricIndex = static_cast(env->GetByteField(videoPlayer, jFabricIndexField)); - - jfieldID jVendorIdField = env->GetFieldID(jVideoPlayerClass, "vendorId", "I"); - uint16_t vendorId = static_cast(env->GetIntField(videoPlayer, jVendorIdField)); - - jfieldID jProductIdField = env->GetFieldID(jVideoPlayerClass, "productId", "I"); - uint16_t productId = static_cast(env->GetIntField(videoPlayer, jProductIdField)); - - jfieldID jDeviceType = env->GetFieldID(jVideoPlayerClass, "deviceType", "I"); - uint16_t deviceType = static_cast(env->GetIntField(videoPlayer, jDeviceType)); - - jfieldID getDeviceNameField = env->GetFieldID(jVideoPlayerClass, "deviceName", "Ljava/lang/String;"); - jstring jDeviceName = static_cast(env->GetObjectField(videoPlayer, getDeviceNameField)); - const char * deviceName = env->GetStringUTFChars(jDeviceName, 0); - - jfieldID getHostNameField = env->GetFieldID(jVideoPlayerClass, "hostName", "Ljava/lang/String;"); - jstring jHostName = static_cast(env->GetObjectField(videoPlayer, getHostNameField)); - const char * hostName = env->GetStringUTFChars(jHostName, 0); - - jfieldID jPort = env->GetFieldID(jVideoPlayerClass, "port", "I"); - uint16_t port = static_cast(env->GetIntField(videoPlayer, jPort)); - - jfieldID getInstanceNameField = env->GetFieldID(jVideoPlayerClass, "instanceName", "Ljava/lang/String;"); - jstring jInstanceName = static_cast(env->GetObjectField(videoPlayer, getInstanceNameField)); - const char * instanceName = {}; - if (jInstanceName != nullptr) - { - instanceName = env->GetStringUTFChars(jInstanceName, 0); - } - - jfieldID jLastDiscoveredMs = env->GetFieldID(jVideoPlayerClass, "lastDiscoveredMs", "J"); - long lastDiscoveredMs = static_cast(env->GetLongField(videoPlayer, jLastDiscoveredMs)); - - jfieldID getMACAddressField = env->GetFieldID(jVideoPlayerClass, "MACAddress", "Ljava/lang/String;"); - jstring jMACAddress = static_cast(env->GetObjectField(videoPlayer, getMACAddressField)); - const char * MACAddress = jMACAddress == nullptr ? nullptr : env->GetStringUTFChars(jMACAddress, 0); - - jfieldID jIsAsleep = env->GetFieldID(jVideoPlayerClass, "isAsleep", "Z"); - bool isAsleep = static_cast(env->GetBooleanField(videoPlayer, jIsAsleep)); - - outTargetVideoPlayerInfo.Initialize(nodeId, fabricIndex, nullptr, nullptr, vendorId, productId, deviceType, deviceName, - hostName, 0, nullptr, port, instanceName, chip::System::Clock::Timestamp(lastDiscoveredMs)); - - if (MACAddress != nullptr) - { - chip::CharSpan MACAddressSpan(MACAddress, 2 * 2 * chip::DeviceLayer::ConfigurationManager::kPrimaryMACAddressLength); - outTargetVideoPlayerInfo.SetMACAddress(MACAddressSpan); - } - - outTargetVideoPlayerInfo.SetIsAsleep(isAsleep); - - jfieldID jContentAppsField = env->GetFieldID(jVideoPlayerClass, "contentApps", "Ljava/util/List;"); - jobject jContentApps = env->GetObjectField(videoPlayer, jContentAppsField); - if (jContentApps == nullptr) - { - return CHIP_NO_ERROR; - } - - jobject jIterator = env->CallObjectMethod( - jContentApps, env->GetMethodID(env->GetObjectClass(jContentApps), "iterator", "()Ljava/util/Iterator;")); - jmethodID jNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "next", "()Ljava/lang/Object;"); - jmethodID jHasNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "hasNext", "()Z"); - - while (env->CallBooleanMethod(jIterator, jHasNextMid)) - { - jobject jContentApp = env->CallObjectMethod(jIterator, jNextMid); - - jclass jContentAppClass; - ReturnErrorOnFailure( - chip::JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/ContentApp", jContentAppClass)); - jfieldID jEndpointIdField = env->GetFieldID(jContentAppClass, "endpointId", "S"); - chip::EndpointId endpointId = static_cast(env->GetShortField(jContentApp, jEndpointIdField)); - TargetEndpointInfo * endpoint = outTargetVideoPlayerInfo.GetOrAddEndpoint(endpointId); - - ReturnErrorOnFailure(convertJContentAppToTargetEndpointInfo(jContentApp, *endpoint)); - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR convertTargetVideoPlayerInfoToJVideoPlayer(TargetVideoPlayerInfo * targetVideoPlayerInfo, jobject & outVideoPlayer) -{ - ChipLogProgress(AppServer, "convertTargetVideoPlayerInfoToJVideoPlayer called"); - if (targetVideoPlayerInfo != nullptr && targetVideoPlayerInfo->IsInitialized()) - { - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass jVideoPlayerClass; - ReturnErrorOnFailure( - chip::JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/VideoPlayer", jVideoPlayerClass)); - jmethodID jVideoPlayerConstructor = env->GetMethodID(jVideoPlayerClass, "", - "(JBLjava/lang/String;IIILjava/util/List;ILjava/util/List;Ljava/lang/" - "String;Ljava/lang/String;IJLjava/lang/String;ZZ)V"); - - jobject jContentAppList = nullptr; - TargetEndpointInfo * endpoints = targetVideoPlayerInfo->GetEndpoints(); - if (endpoints != nullptr) - { - chip::JniReferences::GetInstance().CreateArrayList(jContentAppList); - for (size_t i = 0; i < kMaxNumberOfEndpoints && endpoints[i].IsInitialized(); i++) - { - jobject contentApp = nullptr; - ReturnErrorOnFailure(convertTargetEndpointInfoToJContentApp(&endpoints[i], contentApp)); - chip::JniReferences::GetInstance().AddToList(jContentAppList, contentApp); - } - } - - jstring deviceName = - targetVideoPlayerInfo->GetDeviceName() == nullptr ? nullptr : env->NewStringUTF(targetVideoPlayerInfo->GetDeviceName()); - - jstring hostName = - targetVideoPlayerInfo->GetHostName() == nullptr ? nullptr : env->NewStringUTF(targetVideoPlayerInfo->GetHostName()); - - jstring instanceName = targetVideoPlayerInfo->GetInstanceName() == nullptr - ? nullptr - : env->NewStringUTF(targetVideoPlayerInfo->GetInstanceName()); - - jstring MACAddress = nullptr; - if (targetVideoPlayerInfo->GetMACAddress() != nullptr && targetVideoPlayerInfo->GetMACAddress()->data() != nullptr) - { - char MACAddressWithNil[2 * chip::DeviceLayer::ConfigurationManager::kPrimaryMACAddressLength + 1]; - memcpy(MACAddressWithNil, targetVideoPlayerInfo->GetMACAddress()->data(), - targetVideoPlayerInfo->GetMACAddress()->size()); - MACAddressWithNil[targetVideoPlayerInfo->GetMACAddress()->size()] = '\0'; - MACAddress = env->NewStringUTF(MACAddressWithNil); - } - - jobject jIPAddressList = nullptr; - const chip::Inet::IPAddress * ipAddresses = targetVideoPlayerInfo->GetIpAddresses(); - if (ipAddresses != nullptr) - { - chip::JniReferences::GetInstance().CreateArrayList(jIPAddressList); - for (size_t i = 0; i < targetVideoPlayerInfo->GetNumIPs() && i < chip::Dnssd::CommonResolutionData::kMaxIPAddresses; - i++) - { - char addrCString[chip::Inet::IPAddress::kMaxStringLength]; - ipAddresses[i].ToString(addrCString, chip::Inet::IPAddress::kMaxStringLength); - jstring jIPAddressStr = env->NewStringUTF(addrCString); - - jclass jIPAddressClass; - ReturnErrorOnFailure( - chip::JniReferences::GetInstance().GetLocalClassRef(env, "java/net/InetAddress", jIPAddressClass)); - jmethodID jGetByNameMid = - env->GetStaticMethodID(jIPAddressClass, "getByName", "(Ljava/lang/String;)Ljava/net/InetAddress;"); - jobject jIPAddress = env->CallStaticObjectMethod(jIPAddressClass, jGetByNameMid, jIPAddressStr); - - chip::JniReferences::GetInstance().AddToList(jIPAddressList, jIPAddress); - } - } - - outVideoPlayer = env->NewObject( - jVideoPlayerClass, jVideoPlayerConstructor, targetVideoPlayerInfo->GetNodeId(), targetVideoPlayerInfo->GetFabricIndex(), - deviceName, targetVideoPlayerInfo->GetVendorId(), targetVideoPlayerInfo->GetProductId(), - targetVideoPlayerInfo->GetDeviceType(), jContentAppList, targetVideoPlayerInfo->GetNumIPs(), jIPAddressList, hostName, - instanceName, targetVideoPlayerInfo->GetPort(), targetVideoPlayerInfo->GetLastDiscovered().count(), MACAddress, - targetVideoPlayerInfo->IsAsleep(), targetVideoPlayerInfo->GetOperationalDeviceProxy() != nullptr); - } - return CHIP_NO_ERROR; -} - -CHIP_ERROR convertJDiscoveredNodeDataToCppDiscoveredNodeData(jobject jDiscoveredNodeData, - chip::Dnssd::CommissionNodeData & outCppDiscoveredNodeData) -{ - ChipLogProgress(AppServer, "convertJDiscoveredNodeDataToCppDiscoveredNodeData called"); - VerifyOrReturnError(jDiscoveredNodeData != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass jDiscoveredNodeDataClass; - ReturnErrorOnFailure( - chip::JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/DiscoveredNodeData", jDiscoveredNodeDataClass)); - - jfieldID getHostNameField = env->GetFieldID(jDiscoveredNodeDataClass, "hostName", "Ljava/lang/String;"); - jstring jHostName = static_cast(env->GetObjectField(jDiscoveredNodeData, getHostNameField)); - if (jHostName != nullptr) - { - chip::Platform::CopyString(outCppDiscoveredNodeData.hostName, chip::Dnssd::kHostNameMaxLength + 1, - env->GetStringUTFChars(jHostName, 0)); - } - - jfieldID getInstanceNameField = env->GetFieldID(jDiscoveredNodeDataClass, "instanceName", "Ljava/lang/String;"); - jstring jInstanceName = static_cast(env->GetObjectField(jDiscoveredNodeData, getInstanceNameField)); - if (jInstanceName != nullptr) - { - chip::Platform::CopyString(outCppDiscoveredNodeData.instanceName, chip::Dnssd::Commission::kInstanceNameMaxLength + 1, - env->GetStringUTFChars(jInstanceName, 0)); - } - - jfieldID jLongDiscriminatorField = env->GetFieldID(jDiscoveredNodeDataClass, "longDiscriminator", "J"); - outCppDiscoveredNodeData.vendorId = static_cast(env->GetLongField(jDiscoveredNodeData, jLongDiscriminatorField)); - - jfieldID jVendorIdField = env->GetFieldID(jDiscoveredNodeDataClass, "vendorId", "J"); - outCppDiscoveredNodeData.vendorId = static_cast(env->GetLongField(jDiscoveredNodeData, jVendorIdField)); - - jfieldID jProductIdField = env->GetFieldID(jDiscoveredNodeDataClass, "productId", "J"); - outCppDiscoveredNodeData.productId = static_cast(env->GetLongField(jDiscoveredNodeData, jProductIdField)); - - jfieldID jCommissioningModeField = env->GetFieldID(jDiscoveredNodeDataClass, "commissioningMode", "B"); - outCppDiscoveredNodeData.commissioningMode = - static_cast(env->GetByteField(jDiscoveredNodeData, jCommissioningModeField)); - - jfieldID jDeviceTypeField = env->GetFieldID(jDiscoveredNodeDataClass, "deviceType", "J"); - outCppDiscoveredNodeData.deviceType = static_cast(env->GetLongField(jDiscoveredNodeData, jDeviceTypeField)); - - jfieldID getDeviceNameField = env->GetFieldID(jDiscoveredNodeDataClass, "deviceName", "Ljava/lang/String;"); - jstring jDeviceName = static_cast(env->GetObjectField(jDiscoveredNodeData, getDeviceNameField)); - if (jDeviceName != nullptr) - { - chip::Platform::CopyString(outCppDiscoveredNodeData.deviceName, chip::Dnssd::kMaxDeviceNameLen + 1, - env->GetStringUTFChars(jDeviceName, 0)); - } - - // TODO: map rotating ID - jfieldID jRotatingIdLenField = env->GetFieldID(jDiscoveredNodeDataClass, "rotatingIdLen", "I"); - outCppDiscoveredNodeData.rotatingIdLen = static_cast(env->GetIntField(jDiscoveredNodeData, jRotatingIdLenField)); - - jfieldID jPairingHintField = env->GetFieldID(jDiscoveredNodeDataClass, "pairingHint", "S"); - outCppDiscoveredNodeData.pairingHint = static_cast(env->GetShortField(jDiscoveredNodeData, jPairingHintField)); - - jfieldID getPairingInstructionField = env->GetFieldID(jDiscoveredNodeDataClass, "pairingInstruction", "Ljava/lang/String;"); - jstring jPairingInstruction = static_cast(env->GetObjectField(jDiscoveredNodeData, getPairingInstructionField)); - if (jPairingInstruction != nullptr) - { - chip::Platform::CopyString(outCppDiscoveredNodeData.pairingInstruction, chip::Dnssd::kMaxPairingInstructionLen + 1, - env->GetStringUTFChars(jPairingInstruction, 0)); - } - - jfieldID jPortField = env->GetFieldID(jDiscoveredNodeDataClass, "port", "I"); - outCppDiscoveredNodeData.port = static_cast(env->GetIntField(jDiscoveredNodeData, jPortField)); - - jfieldID jNumIpsField = env->GetFieldID(jDiscoveredNodeDataClass, "numIPs", "I"); - outCppDiscoveredNodeData.numIPs = static_cast(env->GetIntField(jDiscoveredNodeData, jNumIpsField)); - - jfieldID jIPAddressesField = env->GetFieldID(jDiscoveredNodeDataClass, "ipAddresses", "Ljava/util/List;"); - jobject jIPAddresses = env->GetObjectField(jDiscoveredNodeData, jIPAddressesField); - if (jIPAddresses == nullptr && outCppDiscoveredNodeData.numIPs > 0) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } - - jobject jIterator = env->CallObjectMethod( - jIPAddresses, env->GetMethodID(env->GetObjectClass(jIPAddresses), "iterator", "()Ljava/util/Iterator;")); - jmethodID jNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "next", "()Ljava/lang/Object;"); - jmethodID jHasNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "hasNext", "()Z"); - - size_t ipAddressCount = 0; - while (env->CallBooleanMethod(jIterator, jHasNextMid)) - { - jobject jIPAddress = env->CallObjectMethod(jIterator, jNextMid); - jclass jIPAddressClass; - ReturnErrorOnFailure(chip::JniReferences::GetInstance().GetLocalClassRef(env, "java/net/InetAddress", jIPAddressClass)); - jmethodID jGetHostAddressMid = env->GetMethodID(jIPAddressClass, "getHostAddress", "()Ljava/lang/String;"); - jstring jIPAddressStr = static_cast(env->CallObjectMethod(jIPAddress, jGetHostAddressMid)); - - chip::Inet::IPAddress addressInet; - chip::JniUtfString addressJniString(env, jIPAddressStr); - VerifyOrReturnError(chip::Inet::IPAddress::FromString(addressJniString.c_str(), addressInet), CHIP_ERROR_INVALID_ARGUMENT); - outCppDiscoveredNodeData.ipAddress[ipAddressCount] = addressInet; - - if (ipAddressCount == 0) - { - outCppDiscoveredNodeData.interfaceId = chip::Inet::InterfaceId::FromIPAddress(addressInet); - } - ipAddressCount++; - } - - return CHIP_NO_ERROR; -} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.h b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.h deleted file mode 100644 index 28f5a1abd28c5a..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/ConversionUtils.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#pragma once - -#include "AppParams.h" -#include "TargetEndpointInfo.h" -#include "TargetVideoPlayerInfo.h" - -#include - -CHIP_ERROR convertJAppParametersToCppAppParams(jobject appParameters, AppParams & outAppParams); - -CHIP_ERROR convertJContentAppToTargetEndpointInfo(jobject contentApp, TargetEndpointInfo & outTargetEndpointInfo); - -CHIP_ERROR convertTargetEndpointInfoToJContentApp(TargetEndpointInfo * targetEndpointInfo, jobject & outContentApp); - -CHIP_ERROR convertJVideoPlayerToTargetVideoPlayerInfo(jobject videoPlayer, TargetVideoPlayerInfo & targetVideoPlayerInfo); - -CHIP_ERROR convertTargetVideoPlayerInfoToJVideoPlayer(TargetVideoPlayerInfo * targetVideoPlayerInfo, jobject & outVideoPlayer); - -CHIP_ERROR convertJDiscoveredNodeDataToCppDiscoveredNodeData(jobject jDiscoveredNodeData, - chip::Dnssd::CommissionNodeData & cppDiscoveredNodeData); diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp deleted file mode 100644 index ca62ba5f37ee22..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp +++ /dev/null @@ -1,419 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "MatterCallbackHandler-JNI.h" - -#include - -using namespace chip; - -CHIP_ERROR CallbackBaseJNI::SetUp(JNIEnv * env, jobject inHandler) -{ - ChipLogProgress(AppServer, "CallbackBaseJNI::SetUp called"); - CHIP_ERROR err = CHIP_NO_ERROR; - - VerifyOrExit(mObject.Init(inHandler) == CHIP_NO_ERROR, ChipLogError(AppServer, "Failed to Init mObject")); - - mClazz = env->GetObjectClass(mObject.ObjectRef()); - VerifyOrExit(mClazz != nullptr, ChipLogError(AppServer, "Failed to get handler Java class")); - - mSuperClazz = env->GetSuperclass(mClazz); - VerifyOrExit(mSuperClazz != nullptr, ChipLogError(AppServer, "Failed to get handler's parent's Java class")); - - mMethod = env->GetMethodID(mSuperClazz, "handleInternal", mMethodSignature); - if (mMethod == nullptr) - { - ChipLogError(AppServer, "Failed to access 'handleInternal' method with signature %s", mMethodSignature); - env->ExceptionClear(); - } - -exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "CallbackBaseJNI::SetUp error: %s", err.AsString()); - return err; - } - - return err; -} - -void FailureHandlerJNI::Handle(CHIP_ERROR callbackErr) -{ - ChipLogProgress(AppServer, "Handle(CHIP_ERROR) called"); - - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - UtfString jniCallbackErrString(env, callbackErr.AsString()); - - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit(mObject.HasValidObjectRef(), err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(mMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - env->CallVoidMethod(mObject.ObjectRef(), mMethod, static_cast(callbackErr.AsInteger()), jniCallbackErrString.jniValue()); -exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "Handle(CHIP_ERROR) status error: %s", err.AsString()); - } -} - -void SubscriptionEstablishedHandlerJNI::Handle() -{ - ChipLogProgress(AppServer, "SubscriptionEstablishedHandlerJNI::Handle called"); - - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit(mObject.HasValidObjectRef(), err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(mMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - - env->CallVoidMethod(mObject.ObjectRef(), mMethod); -exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "SubscriptionEstablishedHandlerJNI::Handle status error: %s", err.AsString()); - } -} - -jobject ConvertToLongJObject(uint64_t responseData) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass responseTypeClass = env->FindClass("java/lang/Long"); - if (responseTypeClass == nullptr) - { - ChipLogError(AppServer, "ConvertToJObject: Class for Response Type not found!"); - return nullptr; - } - - jmethodID constructor = env->GetMethodID(responseTypeClass, "", "(J)V"); - return env->NewObject(responseTypeClass, constructor, responseData); -} - -jobject ConvertToFloatJObject(float responseData) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass responseTypeClass = env->FindClass("java/lang/Float"); - if (responseTypeClass == nullptr) - { - ChipLogError(AppServer, "ConvertToJObject: Class for Response Type not found!"); - return nullptr; - } - - jmethodID constructor = env->GetMethodID(responseTypeClass, "", "(F)V"); - return env->NewObject(responseTypeClass, constructor, responseData); -} - -jobject ConvertToShortJObject(uint16_t responseData) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass responseTypeClass = env->FindClass("java/lang/Short"); - if (responseTypeClass == nullptr) - { - ChipLogError(AppServer, "ConvertToJObject: Class for Response Type not found!"); - return nullptr; - } - - jmethodID constructor = env->GetMethodID(responseTypeClass, "", "(S)V"); - return env->NewObject(responseTypeClass, constructor, responseData); -} - -jobject ConvertToByteJObject(uint8_t responseData) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass responseTypeClass = env->FindClass("java/lang/Byte"); - if (responseTypeClass == nullptr) - { - ChipLogError(AppServer, "ConvertToJObject: Class for Response Type not found!"); - return nullptr; - } - - jmethodID constructor = env->GetMethodID(responseTypeClass, "", "(B)V"); - return env->NewObject(responseTypeClass, constructor, responseData); -} - -jstring ConvertToJString(chip::CharSpan responseData) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - - return env->NewStringUTF(std::string(responseData.data(), responseData.size()).c_str()); -} - -jobject ConvertToIntegerJObject(uint32_t responseData) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - - jclass responseTypeClass = env->FindClass("java/lang/Integer"); - if (responseTypeClass == nullptr) - { - ChipLogError(AppServer, "ConvertToJObject: Class for Response Type not found!"); - return nullptr; - } - - jmethodID constructor = env->GetMethodID(responseTypeClass, "", "(I)V"); - return env->NewObject(responseTypeClass, constructor, responseData); -} - -// COMMISSIONING AND CONNECTION -jobject OnConnectionSuccessHandlerJNI::ConvertToJObject(TargetVideoPlayerInfo * targetVideoPlayerInfo) -{ - ChipLogProgress(AppServer, "OnConnectionSuccessHandlerJNI::ConvertToJObject called"); - jobject videoPlayer = nullptr; - CHIP_ERROR err = convertTargetVideoPlayerInfoToJVideoPlayer(targetVideoPlayerInfo, videoPlayer); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "OnConnectionSuccessHandlerJNI::ConvertToJObject failed with %" CHIP_ERROR_FORMAT, err.Format()); - } - return videoPlayer; -} - -jobject OnNewOrUpdatedEndpointHandlerJNI::ConvertToJObject(TargetEndpointInfo * targetEndpointInfo) -{ - ChipLogProgress(AppServer, "OnNewOrUpdatedEndpointHandlerJNI::ConvertToJObject called"); - jobject contentApp = nullptr; - CHIP_ERROR err = convertTargetEndpointInfoToJContentApp(targetEndpointInfo, contentApp); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "OnNewOrUpdatedEndpointHandlerJNI::ConvertToJObject failed with %" CHIP_ERROR_FORMAT, err.Format()); - } - return contentApp; -} - -// MEDIA PLAYBACK -jobject CurrentStateSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::MediaPlayback::Attributes::CurrentState::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "CurrentStateSuccessHandlerJNI::ConvertToJObject called"); - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - VerifyOrReturnValue(env != nullptr, nullptr); - JniLocalReferenceScope scope(env); - - jclass enumClass = nullptr; - CHIP_ERROR err = - JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/MediaPlaybackTypes$PlaybackStateEnum", enumClass); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "ConvertToJObject: Class for Response Type not found!"); - return nullptr; - } - - jfieldID enumType = nullptr; - switch (responseData) - { - case chip::app::Clusters::MediaPlayback::PlaybackStateEnum::kPlaying: - enumType = env->GetStaticFieldID(enumClass, "Playing", "Lcom/chip/casting/MediaPlaybackTypes$PlaybackStateEnum;"); - break; - case chip::app::Clusters::MediaPlayback::PlaybackStateEnum::kPaused: - enumType = env->GetStaticFieldID(enumClass, "Paused", "Lcom/chip/casting/MediaPlaybackTypes$PlaybackStateEnum;"); - break; - case chip::app::Clusters::MediaPlayback::PlaybackStateEnum::kNotPlaying: - enumType = env->GetStaticFieldID(enumClass, "NotPlaying", "Lcom/chip/casting/MediaPlaybackTypes$PlaybackStateEnum;"); - break; - case chip::app::Clusters::MediaPlayback::PlaybackStateEnum::kBuffering: - enumType = env->GetStaticFieldID(enumClass, "Buffering", "Lcom/chip/casting/MediaPlaybackTypes$PlaybackStateEnum;"); - break; - default: - enumType = env->GetStaticFieldID(enumClass, "Unknown", "Lcom/chip/casting/MediaPlaybackTypes$PlaybackStateEnum;"); - break; - } - - if (enumType != nullptr) - { - return env->GetStaticObjectField(enumClass, enumType); - } - return nullptr; -} - -jobject DurationSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "DurationSuccessHandlerJNI::ConvertToJObject called"); - return responseData.IsNull() ? nullptr : ConvertToLongJObject(responseData.Value()); -} - -jobject SampledPositionSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::MediaPlayback::Attributes::SampledPosition::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "SampledPositionSuccessHandlerJNI::ConvertToJObject called"); - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - VerifyOrReturnValue(env != nullptr, nullptr); - JniLocalReferenceScope scope(env); - - jobject jSampledPosition = nullptr; - if (!responseData.IsNull()) - { - const chip::app::Clusters::MediaPlayback::Structs::PlaybackPositionStruct::DecodableType & playbackPosition = - responseData.Value(); - - jclass responseTypeClass = nullptr; - CHIP_ERROR err = JniReferences::GetInstance().GetLocalClassRef( - env, "com/chip/casting/MediaPlaybackTypes$PlaybackPositionStruct", responseTypeClass); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "ConvertToJObject: Class for Response Type not found!"); - return nullptr; - } - - if (playbackPosition.position.IsNull()) - { - jmethodID constructor = env->GetMethodID(responseTypeClass, "", "(Ljava/lang/Long;)V"); - jSampledPosition = env->NewObject(responseTypeClass, constructor, playbackPosition.updatedAt); - } - else - { - jmethodID constructor = env->GetMethodID(responseTypeClass, "", "(Ljava/lang/Long;java/lang/Long;)V"); - jSampledPosition = - env->NewObject(responseTypeClass, constructor, playbackPosition.updatedAt, playbackPosition.position.Value()); - } - } - - return jSampledPosition; -} - -jobject PlaybackSpeedSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "PlaybackSpeedSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToFloatJObject(responseData); -} - -jobject SeekRangeEndSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "SeekRangeEndSuccessHandlerJNI::ConvertToJObject called"); - return responseData.IsNull() ? nullptr : ConvertToLongJObject(responseData.Value()); -} - -jobject SeekRangeStartSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "SeekRangeStartSuccessHandlerJNI::ConvertToJObject called"); - return responseData.IsNull() ? nullptr : ConvertToLongJObject(responseData.Value()); -} - -// TARGET NAVIGATOR -jobject CurrentTargetSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::TargetNavigator::Attributes::CurrentTarget::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "CurrentTargetSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToByteJObject(responseData); -} - -jobject TargetListSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::TargetNavigator::Attributes::TargetList::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "TargetListSuccessHandlerJNI::ConvertToJObject called"); - - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - VerifyOrReturnValue(env != nullptr, nullptr); - JniLocalReferenceScope scope(env); - - jobject jArrayList; - chip::JniReferences::GetInstance().CreateArrayList(jArrayList); - auto iter = responseData.begin(); - while (iter.Next()) - { - const chip::app::Clusters::TargetNavigator::Structs::TargetInfoStruct::DecodableType & targetInfo = iter.GetValue(); - - jclass responseTypeClass = nullptr; - CHIP_ERROR err = JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/TargetNavigatorTypes$TargetInfo", - responseTypeClass); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "ConvertToJObject: Class for Response Type not found!"); - return nullptr; - } - - jmethodID constructor = env->GetMethodID(responseTypeClass, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); - chip::UtfString targetInfoName(env, targetInfo.name); - jobject jTargetInfo = env->NewObject(responseTypeClass, constructor, ConvertToIntegerJObject(targetInfo.identifier), - targetInfoName.jniValue()); - - chip::JniReferences::GetInstance().AddToList(jArrayList, jTargetInfo); - } - return jArrayList; -} - -// LEVEL CONTROL -jobject CurrentLevelSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::LevelControl::Attributes::CurrentLevel::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "CurrentLevelSuccessHandlerJNI::ConvertToJObject called"); - return responseData.IsNull() ? nullptr : ConvertToByteJObject(responseData.Value()); -} - -jobject MinLevelSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::LevelControl::Attributes::MinLevel::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "MinLevelSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToByteJObject(responseData); -} - -jobject MaxLevelSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::LevelControl::Attributes::MaxLevel::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "MaxLevelSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToByteJObject(responseData); -} - -// CONTENT LAUNCHER -jobject SupportedStreamingProtocolsSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "SupportedStreamingProtocolsSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToIntegerJObject(responseData.Raw()); -} - -// APPLICATION BASIC -jobject VendorNameSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "VendorNameSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToJString(responseData); -} - -jobject VendorIDSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::ApplicationBasic::Attributes::VendorID::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "VendorIDSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToIntegerJObject(responseData); -} - -jobject ApplicationNameSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "ApplicationNameSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToJString(responseData); -} - -jobject ProductIDSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::ApplicationBasic::Attributes::ProductID::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "ProductIDSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToIntegerJObject(responseData); -} - -jobject ApplicationVersionSuccessHandlerJNI::ConvertToJObject( - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo::DecodableArgType responseData) -{ - ChipLogProgress(AppServer, "ApplicationVersionSuccessHandlerJNI::ConvertToJObject called"); - return ConvertToJString(responseData); -} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.h b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.h deleted file mode 100644 index 152dac59737532..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.h +++ /dev/null @@ -1,293 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include "ConversionUtils.h" -#include "TargetEndpointInfo.h" -#include "TargetVideoPlayerInfo.h" - -#include -#include -#include -#include -#include - -#include - -class CallbackBaseJNI -{ -public: - CallbackBaseJNI(const char * methodSignature) { mMethodSignature = methodSignature; } - CHIP_ERROR SetUp(JNIEnv * env, jobject inHandler); - -protected: - chip::JniGlobalReference mObject; - jclass mClazz = nullptr; - jclass mSuperClazz = nullptr; - jmethodID mMethod = nullptr; - const char * mMethodSignature = nullptr; -}; - -class FailureHandlerJNI : public CallbackBaseJNI -{ -public: - FailureHandlerJNI() : CallbackBaseJNI("(ILjava/lang/String;)V") {} - void Handle(CHIP_ERROR err); -}; - -class MatterCallbackHandlerJNI : public FailureHandlerJNI -{ -}; - -class SubscriptionEstablishedHandlerJNI : public CallbackBaseJNI -{ -public: - SubscriptionEstablishedHandlerJNI() : CallbackBaseJNI("()V") {} - void Handle(); -}; - -// helper functions for conversions -jobject ConvertToLongJObject(uint64_t responseData); -jobject ConvertToFloatJObject(float responseData); -jobject ConvertToShortJObject(uint8_t responseData); -jobject ConvertToByteJObject(uint8_t responseData); -jobject ConvertToIntegerJObject(uint32_t responseData); -jstring ConvertToJString(chip::CharSpan responseData); - -template -class SuccessHandlerJNI : public CallbackBaseJNI -{ -public: - SuccessHandlerJNI(const char * methodSignature) : CallbackBaseJNI(methodSignature) {} - - virtual ~SuccessHandlerJNI() = 0; - - virtual jobject ConvertToJObject(T responseData) = 0; - - void Handle(T responseData) - { - ChipLogProgress(AppServer, "SuccessHandlerJNI::Handle called"); - - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject jResponseData = ConvertToJObject(responseData); - - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit(mObject.HasValidObjectRef(), err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(mMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - env->CallVoidMethod(mObject.ObjectRef(), mMethod, jResponseData); - exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "SuccessHandlerJNI::Handle status error: %s", err.AsString()); - } - } -}; - -template -SuccessHandlerJNI::~SuccessHandlerJNI(){}; - -// COMMISSIONING AND CONNECTION -class SessionEstablishmentStartedHandlerJNI : public SuccessHandlerJNI -{ -public: - SessionEstablishmentStartedHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Object;)V") {} - jobject ConvertToJObject(void * responseData) - { - // return nullptr because the Java callback extends SuccessCallback and its handle() expects a Void param. - // It expects a Void becauase no value is passed as part of this callback. - return nullptr; - } -}; - -class SessionEstablishedHandlerJNI : public SuccessHandlerJNI -{ -public: - SessionEstablishedHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Object;)V") {} - jobject ConvertToJObject(void * responseData) - { - // return nullptr because the Java callback extends SuccessCallback and its handle() expects a Void param. - // It expects a Void becauase no value is passed as part of this callback. - return nullptr; - } -}; - -class OnConnectionSuccessHandlerJNI : public SuccessHandlerJNI -{ -public: - OnConnectionSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Object;)V") {} - jobject ConvertToJObject(TargetVideoPlayerInfo * responseData); -}; - -class OnNewOrUpdatedEndpointHandlerJNI : public SuccessHandlerJNI -{ -public: - OnNewOrUpdatedEndpointHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Object;)V") {} - jobject ConvertToJObject(TargetEndpointInfo * responseData); -}; - -// MEDIA PLAYBACK -class CurrentStateSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - CurrentStateSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Object;)V") {} - jobject ConvertToJObject(chip::app::Clusters::MediaPlayback::Attributes::CurrentState::TypeInfo::DecodableArgType responseData); -}; - -class DurationSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - DurationSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Long;)V") {} - jobject ConvertToJObject(chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo::DecodableArgType responseData); -}; - -class SampledPositionSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - SampledPositionSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Object;)V") {} - jobject - ConvertToJObject(chip::app::Clusters::MediaPlayback::Attributes::SampledPosition::TypeInfo::DecodableArgType responseData); -}; - -class PlaybackSpeedSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - PlaybackSpeedSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Float;)V") {} - jobject - ConvertToJObject(chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::TypeInfo::DecodableArgType responseData); -}; - -class SeekRangeEndSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - SeekRangeEndSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Long;)V") {} - jobject ConvertToJObject(chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo::DecodableArgType responseData); -}; - -class SeekRangeStartSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - SeekRangeStartSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Long;)V") {} - jobject - ConvertToJObject(chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::TypeInfo::DecodableArgType responseData); -}; - -// TARGET NAVIGATOR -class CurrentTargetSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - CurrentTargetSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Byte;)V") {} - jobject - ConvertToJObject(chip::app::Clusters::TargetNavigator::Attributes::CurrentTarget::TypeInfo::DecodableArgType responseData); -}; - -class TargetListSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - TargetListSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Object;)V") {} - jobject ConvertToJObject(chip::app::Clusters::TargetNavigator::Attributes::TargetList::TypeInfo::DecodableArgType responseData); -}; - -// LEVEL CONTROL -class CurrentLevelSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - CurrentLevelSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Byte;)V") {} - jobject ConvertToJObject(chip::app::Clusters::LevelControl::Attributes::CurrentLevel::TypeInfo::DecodableArgType responseData); -}; - -class MinLevelSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - MinLevelSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Byte;)V") {} - jobject ConvertToJObject(chip::app::Clusters::LevelControl::Attributes::MinLevel::TypeInfo::DecodableArgType responseData); -}; - -class MaxLevelSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - MaxLevelSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Byte;)V") {} - jobject ConvertToJObject(chip::app::Clusters::LevelControl::Attributes::MaxLevel::TypeInfo::DecodableArgType responseData); -}; - -// CONTENT LAUNCHER -class SupportedStreamingProtocolsSuccessHandlerJNI - : public SuccessHandlerJNI< - chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo::DecodableArgType> -{ -public: - SupportedStreamingProtocolsSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Integer;)V") {} - jobject ConvertToJObject( - chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo::DecodableArgType responseData); -}; - -// APPLICATION BASIC -class VendorNameSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - VendorNameSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/String;)V") {} - jobject - ConvertToJObject(chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo::DecodableArgType responseData); -}; - -class VendorIDSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - VendorIDSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Integer;)V") {} - jobject ConvertToJObject(chip::app::Clusters::ApplicationBasic::Attributes::VendorID::TypeInfo::DecodableArgType responseData); -}; - -class ApplicationNameSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - ApplicationNameSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/String;)V") {} - jobject - ConvertToJObject(chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo::DecodableArgType responseData); -}; - -class ProductIDSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - ProductIDSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/Integer;)V") {} - jobject ConvertToJObject(chip::app::Clusters::ApplicationBasic::Attributes::ProductID::TypeInfo::DecodableArgType responseData); -}; - -class ApplicationVersionSuccessHandlerJNI - : public SuccessHandlerJNI -{ -public: - ApplicationVersionSuccessHandlerJNI() : SuccessHandlerJNI("(Ljava/lang/String;)V") {} - jobject ConvertToJObject( - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo::DecodableArgType responseData); -}; diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/TvCastingApp-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/TvCastingApp-JNI.cpp deleted file mode 100644 index f2e0d5b79fc53c..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/TvCastingApp-JNI.cpp +++ /dev/null @@ -1,2129 +0,0 @@ -/* - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include "TvCastingApp-JNI.h" -#include "CastingServer.h" -#include "Constants.h" -#include "ConversionUtils.h" -#include "JNIDACProvider.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace chip; - -#define JNI_METHOD(RETURN, METHOD_NAME) extern "C" JNIEXPORT RETURN JNICALL Java_com_chip_casting_TvCastingApp_##METHOD_NAME - -TvCastingAppJNI TvCastingAppJNI::sInstance; - -jint JNI_OnLoad(JavaVM * jvm, void * reserved) -{ - return AndroidAppServerJNI_OnLoad(jvm, reserved); -} - -void JNI_OnUnload(JavaVM * jvm, void * reserved) -{ - return AndroidAppServerJNI_OnUnload(jvm, reserved); -} - -JNI_METHOD(jboolean, preInitJni)(JNIEnv *, jobject, jobject jAppParameters) -{ - chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "JNI_METHOD preInitJni called"); - - CHIP_ERROR err = CHIP_NO_ERROR; - if (jAppParameters == nullptr) - { - err = CastingServer::GetInstance()->PreInit(); - } - else - { - AppParams appParams; - err = convertJAppParametersToCppAppParams(jAppParameters, appParams); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion of AppParameters from jobject to Cpp type failed: %" CHIP_ERROR_FORMAT, - err.Format())); - err = CastingServer::GetInstance()->PreInit(&appParams); - } - VerifyOrExit( - err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Call to CastingServer::GetInstance()->PreInit() failed: %" CHIP_ERROR_FORMAT, err.Format())); -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, initJni)(JNIEnv *, jobject, jobject jAppParameters) -{ - chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "JNI_METHOD initJni called"); - - CHIP_ERROR err = CHIP_NO_ERROR; - if (jAppParameters == nullptr) - { - err = CastingServer::GetInstance()->Init(); - } - else - { - AppParams appParams; - err = convertJAppParametersToCppAppParams(jAppParameters, appParams); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion of AppParameters from jobject to Cpp type failed: %" CHIP_ERROR_FORMAT, - err.Format())); - err = CastingServer::GetInstance()->Init(&appParams); - } - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Call to CastingServer::GetInstance()->Init() failed: %" CHIP_ERROR_FORMAT, err.Format())); -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(void, setDACProvider)(JNIEnv *, jobject, jobject provider) -{ - chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "JNI_METHOD setDACProvider called"); - - JNIDACProvider * p = new JNIDACProvider(provider); - chip::Credentials::SetDeviceAttestationCredentialsProvider(p); -} - -JNI_METHOD(jboolean, openBasicCommissioningWindow) -(JNIEnv * env, jobject, jint duration, jobject jCommissioningCallbacks, jobject jOnConnectionSuccessHandler, - jobject jOnConnectionFailureHandler, jobject jOnNewOrUpdatedEndpointHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD openBasicCommissioningWindow called with duration %d", duration); - - CHIP_ERROR err = CHIP_NO_ERROR; - - CommissioningCallbacks commissioningCallbacks; - jclass jCommissioningCallbacksClass; - chip::JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/CommissioningCallbacks", - jCommissioningCallbacksClass); - - jfieldID jCommissioningCompleteField = - env->GetFieldID(jCommissioningCallbacksClass, "commissioningComplete", "Ljava/lang/Object;"); - jobject jCommissioningComplete = env->GetObjectField(jCommissioningCallbacks, jCommissioningCompleteField); - if (jCommissioningComplete != nullptr) - { - err = TvCastingAppJNIMgr().getCommissioningCompleteHandler().SetUp(env, jCommissioningComplete); - VerifyOrReturnValue(err == CHIP_NO_ERROR, false, - ChipLogError(AppServer, "MatterCallbackHandlerJNI::SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - commissioningCallbacks.commissioningComplete = [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getCommissioningCompleteHandler().Handle(err); - }; - } - - jfieldID jSessionEstablishmentStartedField = - env->GetFieldID(jCommissioningCallbacksClass, "sessionEstablishmentStarted", "Lcom/chip/casting/SuccessCallback;"); - jobject jSessionEstablishmentStarted = env->GetObjectField(jCommissioningCallbacks, jSessionEstablishmentStartedField); - if (jSessionEstablishmentStarted != nullptr) - { - err = TvCastingAppJNIMgr().getSessionEstablishmentStartedHandler().SetUp(env, jSessionEstablishmentStarted); - VerifyOrReturnValue( - err == CHIP_NO_ERROR, false, - ChipLogError(AppServer, "SessionEstablishmentStartedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - commissioningCallbacks.sessionEstablishmentStarted = []() { - TvCastingAppJNIMgr().getSessionEstablishmentStartedHandler().Handle(nullptr); - }; - } - - jfieldID jSessionEstablishedField = - env->GetFieldID(jCommissioningCallbacksClass, "sessionEstablished", "Lcom/chip/casting/SuccessCallback;"); - jobject jSessionEstablished = env->GetObjectField(jCommissioningCallbacks, jSessionEstablishedField); - if (jSessionEstablished != nullptr) - { - err = TvCastingAppJNIMgr().getSessionEstablishedHandler().SetUp(env, jSessionEstablished); - VerifyOrReturnValue(err == CHIP_NO_ERROR, false, - ChipLogError(AppServer, "SessionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - commissioningCallbacks.sessionEstablished = []() { TvCastingAppJNIMgr().getSessionEstablishedHandler().Handle(nullptr); }; - } - - jfieldID jSessionEstablishmentErrorField = - env->GetFieldID(jCommissioningCallbacksClass, "sessionEstablishmentError", "Lcom/chip/casting/FailureCallback;"); - jobject jSessionEstablishmentError = env->GetObjectField(jCommissioningCallbacks, jSessionEstablishmentErrorField); - if (jSessionEstablishmentError != nullptr) - { - err = TvCastingAppJNIMgr().getSessionEstablishmentErrorHandler().SetUp(env, jSessionEstablishmentError); - VerifyOrReturnValue(err == CHIP_NO_ERROR, false); - commissioningCallbacks.sessionEstablishmentError = [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getSessionEstablishmentErrorHandler().Handle(err); - }; - } - - jfieldID jSessionEstablishmentStoppedField = - env->GetFieldID(jCommissioningCallbacksClass, "sessionEstablishmentStopped", "Lcom/chip/casting/FailureCallback;"); - jobject jSessionEstablishmentStopped = env->GetObjectField(jCommissioningCallbacks, jSessionEstablishmentStoppedField); - if (jSessionEstablishmentStopped != nullptr) - { - err = TvCastingAppJNIMgr().getSessionEstablishmentStoppedHandler().SetUp(env, jSessionEstablishmentStopped); - VerifyOrReturnValue( - err == CHIP_NO_ERROR, false, - ChipLogError(AppServer, "SessionEstablishmentStoppedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - commissioningCallbacks.sessionEstablishmentStopped = []() { - TvCastingAppJNIMgr().getSessionEstablishmentStoppedHandler().Handle(CHIP_NO_ERROR); - }; - } - - err = TvCastingAppJNIMgr().getOnConnectionSuccessHandler(false).SetUp(env, jOnConnectionSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "OnConnectionSuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getOnConnectionFailureHandler(false).SetUp(env, jOnConnectionFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "OnConnectionFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getOnNewOrUpdatedEndpointHandler(false).SetUp(env, jOnNewOrUpdatedEndpointHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "OnNewOrUpdatedEndpointHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->OpenBasicCommissioningWindow( - commissioningCallbacks, - [](TargetVideoPlayerInfo * videoPlayer) { TvCastingAppJNIMgr().getOnConnectionSuccessHandler(false).Handle(videoPlayer); }, - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getOnConnectionFailureHandler(false).Handle(err); }, - [](TargetEndpointInfo * endpoint) { TvCastingAppJNIMgr().getOnNewOrUpdatedEndpointHandler(false).Handle(endpoint); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer::OpenBasicCommissioningWindow failed: %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jobject, readCachedVideoPlayers)(JNIEnv * env, jobject) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD readCachedVideoPlayers called"); - - jobject jVideoPlayerList = nullptr; - TargetVideoPlayerInfo * targetVideoPlayerInfoList = CastingServer::GetInstance()->ReadCachedTargetVideoPlayerInfos(); - if (targetVideoPlayerInfoList != nullptr) - { - chip::JniReferences::GetInstance().CreateArrayList(jVideoPlayerList); - for (size_t i = 0; targetVideoPlayerInfoList[i].IsInitialized(); i++) - { - jobject jVideoPlayer = nullptr; - CHIP_ERROR err = convertTargetVideoPlayerInfoToJVideoPlayer(&targetVideoPlayerInfoList[i], jVideoPlayer); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, - "Conversion from TargetVideoPlayerInfo * to jobject VideoPlayer failed: %" CHIP_ERROR_FORMAT, - err.Format()); - continue; - } - chip::JniReferences::GetInstance().AddToList(jVideoPlayerList, jVideoPlayer); - } - } - - return jVideoPlayerList; -} - -JNI_METHOD(jboolean, verifyOrEstablishConnection) -(JNIEnv * env, jobject, jobject videoPlayer, jobject jOnConnectionSuccessHandler, jobject jOnConnectionFailureHandler, - jobject jOnNewOrUpdatedEndpointHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD verifyOrEstablishConnection called"); - - TargetVideoPlayerInfo targetVideoPlayerInfo; - CHIP_ERROR err = convertJVideoPlayerToTargetVideoPlayerInfo(videoPlayer, targetVideoPlayerInfo); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, - "Conversion from jobject VideoPlayer to TargetVideoPlayerInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getOnConnectionSuccessHandler(true).SetUp(env, jOnConnectionSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "OnConnectionSuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getOnConnectionFailureHandler(true).SetUp(env, jOnConnectionFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "OnConnectionFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getOnNewOrUpdatedEndpointHandler(true).SetUp(env, jOnNewOrUpdatedEndpointHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "OnNewOrUpdatedEndpointHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->VerifyOrEstablishConnection( - targetVideoPlayerInfo, - [](TargetVideoPlayerInfo * videoPlayer) { TvCastingAppJNIMgr().getOnConnectionSuccessHandler(true).Handle(videoPlayer); }, - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getOnConnectionFailureHandler(true).Handle(err); }, - [](TargetEndpointInfo * endpoint) { TvCastingAppJNIMgr().getOnNewOrUpdatedEndpointHandler(true).Handle(endpoint); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer::verifyOrEstablishConnection failed: %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, WasRecentlyDiscoverable) -(JNIEnv * env, jobject, jobject videoPlayer) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD WasRecentlyDiscoverable called"); - - TargetVideoPlayerInfo targetVideoPlayerInfo; - CHIP_ERROR err = convertJVideoPlayerToTargetVideoPlayerInfo(videoPlayer, targetVideoPlayerInfo); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, - "Conversion from jobject VideoPlayer to TargetVideoPlayerInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - return targetVideoPlayerInfo.WasRecentlyDiscoverable(); - -exit: - return false; // default to false -} - -JNI_METHOD(void, shutdownAllSubscriptions)(JNIEnv * env, jobject) -{ - chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "JNI_METHOD shutdownAllSubscriptions called"); - - CastingServer::GetInstance()->ShutdownAllSubscriptions(); -} - -JNI_METHOD(void, disconnect)(JNIEnv * env, jobject) -{ - chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "JNI_METHOD disconnect called"); - CastingServer::GetInstance()->Disconnect(); -} - -JNI_METHOD(jobject, getActiveTargetVideoPlayers)(JNIEnv * env, jobject) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD getActiveTargetVideoPlayers called"); - - jobject jVideoPlayerList = nullptr; - TargetVideoPlayerInfo * targetVideoPlayerInfo = CastingServer::GetInstance()->GetActiveTargetVideoPlayer(); - if (targetVideoPlayerInfo != nullptr) - { - chip::JniReferences::GetInstance().CreateArrayList(jVideoPlayerList); - jobject jVideoPlayer = nullptr; - CHIP_ERROR err = convertTargetVideoPlayerInfoToJVideoPlayer(targetVideoPlayerInfo, jVideoPlayer); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "Conversion from TargetVideoPlayerInfo * to jobject VideoPlayer failed: %" CHIP_ERROR_FORMAT, - err.Format()); - } - else - { - chip::JniReferences::GetInstance().AddToList(jVideoPlayerList, jVideoPlayer); - } - } - return jVideoPlayerList; -} - -JNI_METHOD(jboolean, sendUserDirectedCommissioningRequest)(JNIEnv * env, jobject, jstring addressJStr, jint port) -{ - chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "JNI_METHOD sendUserDirectedCommissioningRequest called with port %d", port); - Inet::IPAddress addressInet; - JniUtfString addressJniString(env, addressJStr); - if (Inet::IPAddress::FromString(addressJniString.c_str(), addressInet) == false) - { - ChipLogError(AppServer, "Failed to parse IP address"); - return false; - } - - chip::Inet::InterfaceId interfaceId = chip::Inet::InterfaceId::FromIPAddress(addressInet); - chip::Transport::PeerAddress peerAddress = - chip::Transport::PeerAddress::UDP(addressInet, static_cast(port), interfaceId); - CHIP_ERROR err = CastingServer::GetInstance()->SendUserDirectedCommissioningRequest(peerAddress); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "TVCastingApp-JNI::sendUserDirectedCommissioningRequest failed: %" CHIP_ERROR_FORMAT, err.Format()); - return false; - } - return true; -} - -JNI_METHOD(jboolean, sendCommissioningRequest)(JNIEnv * env, jobject, jobject jDiscoveredNodeData) -{ - chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "JNI_METHOD sendCommissioningRequest called"); - - chip::Dnssd::CommissionNodeData commissioner; - CHIP_ERROR err = convertJDiscoveredNodeDataToCppDiscoveredNodeData(jDiscoveredNodeData, commissioner); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, - "Conversion from jobject DiscoveredNodeData to Cpp DiscoveredNodeData failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = CastingServer::GetInstance()->SendUserDirectedCommissioningRequest(&commissioner); - -exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "TVCastingApp-JNI::sendCommissioningRequest failed: %" CHIP_ERROR_FORMAT, err.Format()); - return false; - } - return true; -} - -JNI_METHOD(jboolean, purgeCache)(JNIEnv * env, jobject) -{ - chip::DeviceLayer::StackLock lock; - ChipLogProgress(AppServer, "JNI_METHOD purgeCache called"); - - CHIP_ERROR err = CastingServer::GetInstance()->PurgeCache(); - if (err != CHIP_NO_ERROR) - { - ChipLogError(AppServer, "TVCastingApp-JNI::purgeCache failed: %" CHIP_ERROR_FORMAT, err.Format()); - return false; - } - return true; -} - -JNI_METHOD(jboolean, contentLauncherLaunchURL) -(JNIEnv * env, jobject, jobject contentApp, jstring contentUrl, jstring contentDisplayStr, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD contentLauncherLaunchURL called"); - const char * nativeContentUrl = env->GetStringUTFChars(contentUrl, 0); - const char * nativeContentDisplayStr = env->GetStringUTFChars(contentDisplayStr, 0); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(ContentLauncher_LaunchURL).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI::SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ContentLauncherLaunchURL( - &endpoint, nativeContentUrl, nativeContentDisplayStr, - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(ContentLauncher_LaunchURL).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer::ContentLauncherLaunchURL failed %" CHIP_ERROR_FORMAT, err.Format())); - - env->ReleaseStringUTFChars(contentUrl, nativeContentUrl); - env->ReleaseStringUTFChars(contentDisplayStr, nativeContentDisplayStr); - -exit: - return (err == CHIP_NO_ERROR); -} - -CHIP_ERROR CreateParameter(JNIEnv * env, jobject jParameter, - chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type & parameter) -{ - jclass jParameterClass = env->GetObjectClass(jParameter); - - jfieldID jTypeField = env->GetFieldID(jParameterClass, "type", "Ljava/lang/Integer;"); - jobject jTypeObj = env->GetObjectField(jParameter, jTypeField); - jclass jIntegerClass = env->FindClass("java/lang/Integer"); - jmethodID jIntValueMid = env->GetMethodID(jIntegerClass, "intValue", "()I"); - parameter.type = static_cast(env->CallIntMethod(jTypeObj, jIntValueMid)); - - jfieldID jValueField = env->GetFieldID(jParameterClass, "value", "Ljava/lang/String;"); - jstring jValueObj = (jstring) env->GetObjectField(jParameter, jValueField); - const char * nativeValue = env->GetStringUTFChars(jValueObj, 0); - parameter.value = CharSpan::fromCharString(nativeValue); - return CHIP_NO_ERROR; -} - -CHIP_ERROR CreateContentSearch(JNIEnv * env, jobject jSearch, - chip::app::Clusters::ContentLauncher::Structs::ContentSearchStruct::Type & search, - ListFreer & listFreer) -{ - jclass jContentSearchClass; - ReturnErrorOnFailure(JniReferences::GetInstance().GetLocalClassRef(env, "com/chip/casting/ContentLauncherTypes$ContentSearch", - jContentSearchClass)); - - jfieldID jParameterListField = env->GetFieldID(jContentSearchClass, "parameterList", "Ljava/util/ArrayList;"); - jobject jParameterList = env->GetObjectField(jSearch, jParameterListField); - ReturnErrorOnFailure(jParameterList != nullptr ? CHIP_NO_ERROR : CHIP_ERROR_INVALID_ARGUMENT); - - jclass jArrayListClass = env->FindClass("java/util/ArrayList"); - jmethodID sizeMid = env->GetMethodID(jArrayListClass, "size", "()I"); - size_t parameterListSize = static_cast(env->CallIntMethod(jParameterList, sizeMid)); - - jobject jIterator = env->CallObjectMethod( - jParameterList, env->GetMethodID(env->GetObjectClass(jParameterList), "iterator", "()Ljava/util/Iterator;")); - jmethodID jNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "next", "()Ljava/lang/Object;"); - jmethodID jHasNextMid = env->GetMethodID(env->GetObjectClass(jIterator), "hasNext", "()Z"); - - auto * parameterListHolder = - new ListHolder(parameterListSize); - listFreer.add(parameterListHolder); - int parameterIndex = 0; - while (env->CallBooleanMethod(jIterator, jHasNextMid)) - { - jobject jParameter = env->CallObjectMethod(jIterator, jNextMid); - chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type parameter; - ReturnErrorOnFailure(CreateParameter(env, jParameter, parameter)); - parameterListHolder->mList[parameterIndex].type = parameter.type; - parameterListHolder->mList[parameterIndex].value = parameter.value; - parameterListHolder->mList[parameterIndex].externalIDList = parameter.externalIDList; - parameterIndex++; - } - search.parameterList = chip::app::DataModel::List( - parameterListHolder->mList, parameterListSize); - - return CHIP_NO_ERROR; -} - -JNI_METHOD(jboolean, contentLauncher_1launchContent) -(JNIEnv * env, jobject, jobject contentApp, jobject jSearch, jboolean jAutoplay, jstring jData, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD contentLauncher_1launchContent called"); - - // prepare arguments - bool autoplay = static_cast(jAutoplay); - - const char * nativeData = env->GetStringUTFChars(jData, 0); - chip::Optional data = MakeOptional(CharSpan::fromCharString(nativeData)); - - ListFreer listFreer; - chip::app::Clusters::ContentLauncher::Structs::ContentSearchStruct::Type search; - CHIP_ERROR err = CreateContentSearch(env, jSearch, search, listFreer); - - TargetEndpointInfo endpoint; - err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, - "contentLauncher_1launchContent::Could not create ContentSearch object %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(ContentLauncher_LaunchContent).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI::SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ContentLauncher_LaunchContent(&endpoint, search, autoplay, data, [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(ContentLauncher_LaunchContent).Handle(err); - }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer::ContentLauncher_LaunchContent failed %" CHIP_ERROR_FORMAT, err.Format())); - - env->ReleaseStringUTFChars(jData, nativeData); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, contentLauncher_1subscribeToSupportedStreamingProtocols) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD ContentLauncher_subscribeToSupportedStreamingProtocols called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getSupportedStreamingProtocolsSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionReadFailureHandler(ContentLauncher_SupportedStreamingProtocols) - .SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(ContentLauncher_SupportedStreamingProtocols) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ContentLauncher_SubscribeToSupportedStreamingProtocols( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getSupportedStreamingProtocolsSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ContentLauncher_SupportedStreamingProtocols).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(ContentLauncher_SupportedStreamingProtocols).Handle(); - }); - - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, - "CastingServer.ContentLauncher_SubscribeToSupportedStreamingProtocols failed %" CHIP_ERROR_FORMAT, - err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, levelControl_1step) -(JNIEnv * env, jobject, jobject contentApp, jbyte stepMode, jbyte stepSize, jshort transitionTime, jbyte optionMask, - jbyte optionOverride, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD levelControl_step called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(LevelControl_Step).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->LevelControl_Step( - &endpoint, static_cast(stepMode), static_cast(stepSize), - static_cast(transitionTime), static_cast(optionMask), static_cast(optionOverride), - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(LevelControl_Step).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.LevelControl_Step failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, levelControl_1moveToLevel) -(JNIEnv * env, jobject, jobject contentApp, jbyte level, jshort transitionTime, jbyte optionMask, jbyte optionOverride, - jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD levelControl_moveToLevel called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(LevelControl_MoveToLevel).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->LevelControl_MoveToLevel( - &endpoint, static_cast(level), static_cast(transitionTime), static_cast(optionMask), - static_cast(optionOverride), - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(LevelControl_MoveToLevel).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.LevelControl_MoveToLevel failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, levelControl_1subscribeToCurrentLevel) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD levelControl_subscribeToCurrentLevel called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getCurrentLevelSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(LevelControl_CurrentLevel).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(LevelControl_CurrentLevel) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->LevelControl_SubscribeToCurrentLevel( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::LevelControl::Attributes::CurrentLevel::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getCurrentLevelSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(LevelControl_CurrentLevel).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(LevelControl_CurrentLevel).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.LevelControl_SubscribeToCurrentLevel failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, levelControl_1subscribeToMinLevel) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD levelControl_subscribeToMinLevel called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMinLevelSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(LevelControl_MinLevel).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(LevelControl_MinLevel).SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->LevelControl_SubscribeToMinLevel( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::LevelControl::Attributes::MinLevel::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getMinLevelSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(LevelControl_MinLevel).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(LevelControl_MinLevel).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.LevelControl_SubscribeToMinLevel failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, levelControl_1subscribeToMaxLevel) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD levelControl_subscribeToMaxLevel called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMaxLevelSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(LevelControl_MaxLevel).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(LevelControl_MaxLevel).SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->LevelControl_SubscribeToMaxLevel( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::LevelControl::Attributes::MaxLevel::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getMaxLevelSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(LevelControl_MaxLevel).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(LevelControl_MaxLevel).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.LevelControl_SubscribeToMaxLevel failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, onOff_1on) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD onOff_on called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(OnOff_On).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->OnOff_On( - &endpoint, [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(OnOff_On).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "CastingServer.OnOff_On failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, onOff_1off) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD onOff_off called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(OnOff_Off).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->OnOff_Off( - &endpoint, [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(OnOff_Off).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "CastingServer.OnOff_Off failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, onOff_1toggle) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD onOff_toggle called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(OnOff_Toggle).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->OnOff_Toggle( - &endpoint, [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(OnOff_Toggle).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.OnOff_Toggle failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, messages_1presentMessages) -(JNIEnv * env, jobject, jobject contentApp, jstring messageText, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD messages_presentMessages called"); - const char * nativeMessageText = env->GetStringUTFChars(messageText, 0); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(Messages_PresentMessagesRequest).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->Messages_PresentMessagesRequest(&endpoint, nativeMessageText, [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(Messages_PresentMessagesRequest).Handle(err); - }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.Messages_PresentMessagesRequest failed %" CHIP_ERROR_FORMAT, err.Format())); - - env->ReleaseStringUTFChars(messageText, nativeMessageText); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1play) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_play called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Play).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_Play( - &endpoint, [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Play).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.MediaPlayback_Play failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1pause) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_pause called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Pause).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_Pause( - &endpoint, [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Pause).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.MediaPlayback_Pause failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1stopPlayback) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_stopPlayback called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_StopPlayback).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_StopPlayback(&endpoint, [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_StopPlayback).Handle(err); - }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.MediaPlayback_StopPlayback failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1next) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_next called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Next).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_Next( - &endpoint, [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Next).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.MediaPlayback_Next failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1seek) -(JNIEnv * env, jobject, jobject contentApp, jlong position, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_seek called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Seek).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_Seek(&endpoint, static_cast(position), [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Seek).Handle(err); - }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.MediaPlayback_Seek failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1skipForward) -(JNIEnv * env, jobject, jobject contentApp, jlong deltaPositionMilliseconds, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_skipForward called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_SkipForward).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_SkipForward( - &endpoint, static_cast(deltaPositionMilliseconds), - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_SkipForward).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.MediaPlayback_SkipForward failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1skipBackward) -(JNIEnv * env, jobject, jobject contentApp, jlong deltaPositionMilliseconds, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_skipBackward called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_SkipBackward).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_SkipBackward( - &endpoint, static_cast(deltaPositionMilliseconds), - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_SkipBackward).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.MediaPlayback_SkipBackward failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1previous) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - return TvCastingAppJNIMgr().runCastingServerCommand( - env, contentApp, jResponseHandler, "MediaPlayback_Previous", MediaPlayback_Previous, - [](TargetEndpointInfo endpoint) -> CHIP_ERROR { - return CastingServer::GetInstance()->MediaPlayback_Previous(&endpoint, [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Previous).Handle(err); - }); - }); -} - -JNI_METHOD(jboolean, mediaPlayback_1rewind) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - return TvCastingAppJNIMgr().runCastingServerCommand( - env, contentApp, jResponseHandler, "MediaPlayback_Rewind", MediaPlayback_Rewind, - [](TargetEndpointInfo endpoint) -> CHIP_ERROR { - return CastingServer::GetInstance()->MediaPlayback_Rewind(&endpoint, [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_Rewind).Handle(err); - }); - }); -} - -JNI_METHOD(jboolean, mediaPlayback_1fastForward) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - return TvCastingAppJNIMgr().runCastingServerCommand( - env, contentApp, jResponseHandler, "MediaPlayback_FastForward", MediaPlayback_FastForward, - [](TargetEndpointInfo endpoint) -> CHIP_ERROR { - return CastingServer::GetInstance()->MediaPlayback_FastForward(&endpoint, [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_FastForward).Handle(err); - }); - }); -} - -JNI_METHOD(jboolean, mediaPlayback_1startOver) -(JNIEnv * env, jobject, jobject contentApp, jobject jResponseHandler) -{ - return TvCastingAppJNIMgr().runCastingServerCommand( - env, contentApp, jResponseHandler, "MediaPlayback_StartOver", MediaPlayback_StartOver, - [](TargetEndpointInfo endpoint) -> CHIP_ERROR { - return CastingServer::GetInstance()->MediaPlayback_StartOver(&endpoint, [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(MediaPlayback_StartOver).Handle(err); - }); - }); -} - -jboolean TvCastingAppJNI::runCastingServerCommand(JNIEnv * env, jobject contentApp, jobject jResponseHandler, - const char * commandName, MediaCommandName command, - const std::function & commandRunner) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD %s called", commandName); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(command).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = commandRunner(endpoint); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.%s failed %" CHIP_ERROR_FORMAT, commandName, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1subscribeToCurrentState) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_subscribeToCurrentState called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getCurrentStateSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_CurrentState).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(MediaPlayback_CurrentState) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_SubscribeToCurrentState( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::MediaPlayback::Attributes::CurrentState::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getCurrentStateSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_CurrentState).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(MediaPlayback_CurrentState).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.MediaPlayback_SubscribeToCurrentState failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1subscribeToDuration) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_1subscribeToDuration called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getDurationSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_Duration).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(MediaPlayback_Duration).SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_SubscribeToDuration( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getDurationSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_Duration).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(MediaPlayback_Duration).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.mediaPlayback_subscribeToDuration failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1subscribeToSampledPosition) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_1subscribeToSampledPosition called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getSampledPositionSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_SampledPosition).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(MediaPlayback_SampledPosition) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_SubscribeToSampledPosition( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::MediaPlayback::Attributes::SampledPosition::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getSampledPositionSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_SampledPosition).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(MediaPlayback_SampledPosition).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.mediaPlayback_subscribeToSampledPosition failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1subscribeToPlaybackSpeed) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_1subscribeToPlaybackSpeed called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getPlaybackSpeedSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_PlaybackSpeed).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(MediaPlayback_PlaybackSpeed) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_SubscribeToPlaybackSpeed( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getPlaybackSpeedSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_PlaybackSpeed).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(MediaPlayback_PlaybackSpeed).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.mediaPlayback_subscribeToPlaybackSpeed failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1subscribeToSeekRangeEnd) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_1subscribeToSeekRangeEnd called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getSeekRangeEndSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_SeekRangeEnd).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(MediaPlayback_SeekRangeEnd) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_SubscribeToSeekRangeEnd( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getSeekRangeEndSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_SeekRangeEnd).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(MediaPlayback_SeekRangeEnd).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.mediaPlayback_subscribeToSeekRangeEnd failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, mediaPlayback_1subscribeToSeekRangeStart) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD mediaPlayback_1subscribeToSeekRangeStart called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getSeekRangeStartSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_SeekRangeStart).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(MediaPlayback_SeekRangeStart) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->MediaPlayback_SubscribeToSeekRangeStart( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getSeekRangeStartSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(MediaPlayback_SeekRangeStart).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(MediaPlayback_SeekRangeStart).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.mediaPlayback_subscribeToSeekRangeStart failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationLauncher_1launchApp) -(JNIEnv * env, jobject, jobject contentApp, jshort catalogVendorId, jstring applicationId, jbyteArray data, - jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationLauncher_launchApp called"); - - chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application; - application.catalogVendorID = static_cast(catalogVendorId); - const char * nativeApplicationId = env->GetStringUTFChars(applicationId, 0); - application.applicationID = CharSpan::fromCharString(nativeApplicationId); - JniByteArray dataByteArray(env, data); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(ApplicationLauncher_LaunchApp).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationLauncher_LaunchApp( - &endpoint, application, chip::MakeOptional(dataByteArray.byteSpan()), - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(ApplicationLauncher_LaunchApp).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.ApplicationLauncher_LaunchApp failed %" CHIP_ERROR_FORMAT, err.Format())); - - env->ReleaseStringUTFChars(applicationId, nativeApplicationId); -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationLauncher_1stopApp) -(JNIEnv * env, jobject, jobject contentApp, jshort catalogVendorId, jstring applicationId, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationLauncher_stopApp called"); - - chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application; - application.catalogVendorID = static_cast(catalogVendorId); - const char * nativeApplicationId = env->GetStringUTFChars(applicationId, 0); - application.applicationID = CharSpan::fromCharString(nativeApplicationId); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(ApplicationLauncher_StopApp).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationLauncher_StopApp(&endpoint, application, [&](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(ApplicationLauncher_StopApp).Handle(err); - }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.ApplicationLauncher_StopApp failed %" CHIP_ERROR_FORMAT, err.Format())); - - env->ReleaseStringUTFChars(applicationId, nativeApplicationId); -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationLauncher_1hideApp) -(JNIEnv * env, jobject, jobject contentApp, jshort catalogVendorId, jstring applicationId, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationLauncher_hideApp called"); - - chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application; - application.catalogVendorID = static_cast(catalogVendorId); - const char * nativeApplicationId = env->GetStringUTFChars(applicationId, 0); - application.applicationID = CharSpan::fromCharString(nativeApplicationId); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(ApplicationLauncher_HideApp).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationLauncher_HideApp(&endpoint, application, [](CHIP_ERROR err) { - TvCastingAppJNIMgr().getMediaCommandResponseHandler(ApplicationLauncher_HideApp).Handle(err); - }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.ApplicationLauncher_HideApp failed %" CHIP_ERROR_FORMAT, err.Format())); - - env->ReleaseStringUTFChars(applicationId, nativeApplicationId); -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, targetNavigator_1navigateTarget) -(JNIEnv * env, jobject, jobject contentApp, jbyte target, jstring data, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD targetNavigator_navigateTarget called"); - - const char * nativeData = (data != nullptr ? env->GetStringUTFChars(data, 0) : nullptr); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(TargetNavigator_NavigateTarget).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->TargetNavigator_NavigateTarget( - &endpoint, static_cast(target), - (nativeData != nullptr ? chip::MakeOptional(CharSpan::fromCharString(nativeData)) : chip::NullOptional), - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(TargetNavigator_NavigateTarget).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.TargetNavigator_NavigateTarget failed %" CHIP_ERROR_FORMAT, err.Format())); - - if (nativeData != nullptr) - { - env->ReleaseStringUTFChars(data, nativeData); - } -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, targetNavigator_1subscribeToCurrentTarget) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD targetNavigator_1subscribeToCurrentTarget called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getCurrentTargetSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(TargetNavigator_CurrentTarget).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(TargetNavigator_CurrentTarget) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->TargetNavigator_SubscribeToCurrentTarget( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::TargetNavigator::Attributes::CurrentTarget::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getCurrentTargetSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(TargetNavigator_CurrentTarget).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(TargetNavigator_CurrentTarget).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.targetNavigator_subscribeToCurrentTarget failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, targetNavigator_1subscribeToTargetList) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD targetNavigator_1subscribeToTargetList called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getTargetListSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(TargetNavigator_TargetList).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(TargetNavigator_TargetList) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->TargetNavigator_SubscribeToTargetList( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::TargetNavigator::Attributes::TargetList::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getTargetListSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(TargetNavigator_TargetList).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(TargetNavigator_TargetList).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.targetNavigator_subscribeToTargetList failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, keypadInput_1sendKey) -(JNIEnv * env, jobject, jobject contentApp, jbyte keyCode, jobject jResponseHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD keypadInput_sendKey called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getMediaCommandResponseHandler(KeypadInput_SendKey).SetUp(env, jResponseHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "MatterCallbackHandlerJNI.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->KeypadInput_SendKey( - &endpoint, static_cast(keyCode), - [](CHIP_ERROR err) { TvCastingAppJNIMgr().getMediaCommandResponseHandler(KeypadInput_SendKey).Handle(err); }); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.KeypadInput_SendKey failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -// APPLICATION BASIC -JNI_METHOD(jboolean, applicationBasic_1subscribeToVendorName) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1subscribeToVendorName called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getVendorNameSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_VendorName).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(ApplicationBasic_VendorName) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToVendorName( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getVendorNameSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_VendorName).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(ApplicationBasic_VendorName).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_subscribeToVendorName failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1subscribeToVendorID) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1subscribeToVendorID called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getVendorIDSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_VendorID).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(ApplicationBasic_VendorID) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToVendorID( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::ApplicationBasic::Attributes::VendorID::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getVendorIDSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_VendorID).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(ApplicationBasic_VendorID).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_subscribeToVendorID failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1subscribeToApplicationName) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1subscribeToApplicationName called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getApplicationNameSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_ApplicationName).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(ApplicationBasic_ApplicationName) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToApplicationName( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getApplicationNameSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_ApplicationName).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(ApplicationBasic_ApplicationName).Handle(); - }); - - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_subscribeToApplicationName failed %" CHIP_ERROR_FORMAT, - err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1subscribeToProductID) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1subscribeToProductID called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getProductIDSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_ProductID).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(ApplicationBasic_ProductID) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToProductID( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::ApplicationBasic::Attributes::ProductID::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getProductIDSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_ProductID).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(ApplicationBasic_ProductID).Handle(); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_subscribeToProductID failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1subscribeToApplicationVersion) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler, jint minInterval, - jint maxInterval, jobject jSubscriptionEstablishedHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1subscribeToApplicationVersion called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getApplicationVersionSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_ApplicationVersion).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr() - .getSubscriptionEstablishedHandler(ApplicationBasic_ApplicationVersion) - .SetUp(env, jSubscriptionEstablishedHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "SubscriptionEstablishedHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToApplicationVersion( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getApplicationVersionSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getSubscriptionReadFailureHandler(ApplicationBasic_ApplicationVersion).Handle(err); - }, - static_cast(minInterval), static_cast(maxInterval), - [](void * context, chip::SubscriptionId) { - TvCastingAppJNIMgr().getSubscriptionEstablishedHandler(ApplicationBasic_ApplicationVersion).Handle(); - }); - - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_subscribeToApplicationVersion failed %" CHIP_ERROR_FORMAT, - err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1readVendorName) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1readVendorName called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getReadVendorNameSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_VendorName).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "ReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_ReadVendorName( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getReadVendorNameSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_VendorName).Handle(err); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_1readVendorName failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1readVendorID) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1readVendorID called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getReadVendorIDSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_VendorID).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "ReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_ReadVendorID( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::ApplicationBasic::Attributes::VendorID::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getReadVendorIDSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_VendorID).Handle(err); }); - - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_ReadVendorID failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1readApplicationName) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1readApplicationName called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getReadApplicationNameSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_ApplicationName).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "ReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_ReadApplicationName( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getReadApplicationNameSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_ApplicationName).Handle(err); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_ReadApplicationName failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1readProductID) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1readProductID called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getReadProductIDSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_ProductID).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "ReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_ReadProductID( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::ApplicationBasic::Attributes::ProductID::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getReadProductIDSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_ProductID).Handle(err); }); - - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_ReadProductID failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} - -JNI_METHOD(jboolean, applicationBasic_1readApplicationVersion) -(JNIEnv * env, jobject, jobject contentApp, jobject jReadSuccessHandler, jobject jReadFailureHandler) -{ - chip::DeviceLayer::StackLock lock; - - ChipLogProgress(AppServer, "JNI_METHOD applicationBasic_1readApplicationVersion called"); - - TargetEndpointInfo endpoint; - CHIP_ERROR err = convertJContentAppToTargetEndpointInfo(contentApp, endpoint); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(AppServer, "Conversion from jobject contentApp to TargetEndpointInfo * failed: %" CHIP_ERROR_FORMAT, - err.Format())); - - err = TvCastingAppJNIMgr().getReadApplicationVersionSuccessHandler().SetUp(env, jReadSuccessHandler); - VerifyOrExit(CHIP_NO_ERROR == err, ChipLogError(AppServer, "SuccessHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_ApplicationVersion).SetUp(env, jReadFailureHandler); - VerifyOrExit(CHIP_NO_ERROR == err, - ChipLogError(AppServer, "ReadFailureHandler.SetUp failed %" CHIP_ERROR_FORMAT, err.Format())); - - err = CastingServer::GetInstance()->ApplicationBasic_ReadApplicationVersion( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo::DecodableArgType responseData) { - TvCastingAppJNIMgr().getReadApplicationVersionSuccessHandler().Handle(responseData); - }, - [](void * context, CHIP_ERROR err) { - TvCastingAppJNIMgr().getReadFailureHandler(ApplicationBasic_ApplicationVersion).Handle(err); - }); - - VerifyOrExit( - CHIP_NO_ERROR == err, - ChipLogError(AppServer, "CastingServer.applicationBasic_ReadApplicationVersion failed %" CHIP_ERROR_FORMAT, err.Format())); - -exit: - return (err == CHIP_NO_ERROR); -} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/TvCastingApp-JNI.h b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/TvCastingApp-JNI.h deleted file mode 100644 index 863e2691c44a52..00000000000000 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/TvCastingApp-JNI.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#include "Constants.h" -#include "MatterCallbackHandler-JNI.h" - -class TvCastingAppJNI -{ -public: - MatterCallbackHandlerJNI & getCommissioningCompleteHandler() { return mCommissioningCompleteHandler; } - - SessionEstablishmentStartedHandlerJNI & getSessionEstablishmentStartedHandler() { return mSessionEstablishmentStartedHandler; } - - SessionEstablishedHandlerJNI & getSessionEstablishedHandler() { return mSessionEstablishedHandler; } - - FailureHandlerJNI & getSessionEstablishmentErrorHandler() { return mSessionEstablishmentErrorHandler; } - - FailureHandlerJNI & getSessionEstablishmentStoppedHandler() { return mSessionEstablishmentStoppedHandler; } - - OnConnectionSuccessHandlerJNI & getOnConnectionSuccessHandler(bool preCommissioned) - { - return preCommissioned ? mPreCommissionedOnConnectionSuccessHandler : mCommissioningOnConnectionSuccessHandler; - } - - FailureHandlerJNI & getOnConnectionFailureHandler(bool preCommissioned) - { - return preCommissioned ? mPreCommissionedOnConnectionFailureHandler : mCommissioningOnConnectionFailureHandler; - } - OnNewOrUpdatedEndpointHandlerJNI & getOnNewOrUpdatedEndpointHandler(bool preCommissioned) - { - return preCommissioned ? mPreCommissionedOnNewOrUpdatedEndpointHandler : mCommissioningOnNewOrUpdatedEndpointHandler; - } - - MatterCallbackHandlerJNI & getMediaCommandResponseHandler(enum MediaCommandName name) - { - return mMediaCommandResponseHandler[name]; - } - - FailureHandlerJNI & getReadFailureHandler(enum MediaAttributeName name) { return mReadFailureHandler[name]; } - - FailureHandlerJNI & getSubscriptionReadFailureHandler(enum MediaAttributeName name) - { - return mSubscriptionReadFailureHandler[name]; - } - - SubscriptionEstablishedHandlerJNI & getSubscriptionEstablishedHandler(enum MediaAttributeName name) - { - return mSubscriptionEstablishedHandler[name]; - } - - CurrentStateSuccessHandlerJNI & getCurrentStateSuccessHandler() { return mCurrentStateSuccessHandlerJNI; } - DurationSuccessHandlerJNI & getDurationSuccessHandler() { return mDurationSuccessHandlerJNI; } - SampledPositionSuccessHandlerJNI & getSampledPositionSuccessHandler() { return mSampledPositionSuccessHandlerJNI; } - PlaybackSpeedSuccessHandlerJNI & getPlaybackSpeedSuccessHandler() { return mPlaybackSpeedSuccessHandlerJNI; } - SeekRangeEndSuccessHandlerJNI & getSeekRangeEndSuccessHandler() { return mSeekRangeEndSuccessHandlerJNI; } - SeekRangeStartSuccessHandlerJNI & getSeekRangeStartSuccessHandler() { return mSeekRangeStartSuccessHandlerJNI; } - - CurrentTargetSuccessHandlerJNI & getCurrentTargetSuccessHandler() { return mCurrentTargetSuccessHandlerJNI; } - TargetListSuccessHandlerJNI & getTargetListSuccessHandler() { return mTargetListSuccessHandlerJNI; } - - CurrentLevelSuccessHandlerJNI & getCurrentLevelSuccessHandler() { return mCurrentLevelSuccessHandlerJNI; } - MinLevelSuccessHandlerJNI & getMinLevelSuccessHandler() { return mMinLevelSuccessHandlerJNI; } - MaxLevelSuccessHandlerJNI & getMaxLevelSuccessHandler() { return mMaxLevelSuccessHandlerJNI; } - - SupportedStreamingProtocolsSuccessHandlerJNI & getSupportedStreamingProtocolsSuccessHandler() - { - return mSupportedStreamingProtocolsSuccessHandlerJNI; - } - - VendorNameSuccessHandlerJNI & getVendorNameSuccessHandler() { return mVendorNameSuccessHandlerJNI; } - VendorIDSuccessHandlerJNI & getVendorIDSuccessHandler() { return mVendorIDSuccessHandlerJNI; } - ApplicationNameSuccessHandlerJNI & getApplicationNameSuccessHandler() { return mApplicationNameSuccessHandlerJNI; } - ProductIDSuccessHandlerJNI & getProductIDSuccessHandler() { return mProductIDSuccessHandlerJNI; } - ApplicationVersionSuccessHandlerJNI & getApplicationVersionSuccessHandler() { return mApplicationVersionSuccessHandlerJNI; } - - VendorNameSuccessHandlerJNI & getReadVendorNameSuccessHandler() { return mReadVendorNameSuccessHandlerJNI; } - VendorIDSuccessHandlerJNI & getReadVendorIDSuccessHandler() { return mReadVendorIDSuccessHandlerJNI; } - ApplicationNameSuccessHandlerJNI & getReadApplicationNameSuccessHandler() { return mReadApplicationNameSuccessHandlerJNI; } - ProductIDSuccessHandlerJNI & getReadProductIDSuccessHandler() { return mReadProductIDSuccessHandlerJNI; } - ApplicationVersionSuccessHandlerJNI & getReadApplicationVersionSuccessHandler() - { - return mReadApplicationVersionSuccessHandlerJNI; - } - - jboolean runCastingServerCommand(JNIEnv * env, jobject contentApp, jobject jResponseHandler, const char * commandName, - MediaCommandName command, const std::function & commandRunner); - -private: - friend TvCastingAppJNI & TvCastingAppJNIMgr(); - - static TvCastingAppJNI sInstance; - - MatterCallbackHandlerJNI mCommissioningCompleteHandler; - SessionEstablishmentStartedHandlerJNI mSessionEstablishmentStartedHandler; - SessionEstablishedHandlerJNI mSessionEstablishedHandler; - FailureHandlerJNI mSessionEstablishmentErrorHandler; - FailureHandlerJNI mSessionEstablishmentStoppedHandler; - OnConnectionSuccessHandlerJNI mCommissioningOnConnectionSuccessHandler; - FailureHandlerJNI mCommissioningOnConnectionFailureHandler; - OnNewOrUpdatedEndpointHandlerJNI mCommissioningOnNewOrUpdatedEndpointHandler; - - OnConnectionSuccessHandlerJNI mPreCommissionedOnConnectionSuccessHandler; - FailureHandlerJNI mPreCommissionedOnConnectionFailureHandler; - OnNewOrUpdatedEndpointHandlerJNI mPreCommissionedOnNewOrUpdatedEndpointHandler; - - MatterCallbackHandlerJNI mMediaCommandResponseHandler[MEDIA_COMMAND_COUNT]; - FailureHandlerJNI mSubscriptionReadFailureHandler[MEDIA_ATTRIBUTE_COUNT]; - SubscriptionEstablishedHandlerJNI mSubscriptionEstablishedHandler[MEDIA_ATTRIBUTE_COUNT]; - FailureHandlerJNI mReadFailureHandler[MEDIA_ATTRIBUTE_COUNT]; - - CurrentStateSuccessHandlerJNI mCurrentStateSuccessHandlerJNI; - DurationSuccessHandlerJNI mDurationSuccessHandlerJNI; - SampledPositionSuccessHandlerJNI mSampledPositionSuccessHandlerJNI; - PlaybackSpeedSuccessHandlerJNI mPlaybackSpeedSuccessHandlerJNI; - SeekRangeEndSuccessHandlerJNI mSeekRangeEndSuccessHandlerJNI; - SeekRangeStartSuccessHandlerJNI mSeekRangeStartSuccessHandlerJNI; - - CurrentTargetSuccessHandlerJNI mCurrentTargetSuccessHandlerJNI; - TargetListSuccessHandlerJNI mTargetListSuccessHandlerJNI; - - CurrentLevelSuccessHandlerJNI mCurrentLevelSuccessHandlerJNI; - MinLevelSuccessHandlerJNI mMinLevelSuccessHandlerJNI; - MaxLevelSuccessHandlerJNI mMaxLevelSuccessHandlerJNI; - - SupportedStreamingProtocolsSuccessHandlerJNI mSupportedStreamingProtocolsSuccessHandlerJNI; - - VendorNameSuccessHandlerJNI mVendorNameSuccessHandlerJNI; - VendorIDSuccessHandlerJNI mVendorIDSuccessHandlerJNI; - ApplicationNameSuccessHandlerJNI mApplicationNameSuccessHandlerJNI; - ProductIDSuccessHandlerJNI mProductIDSuccessHandlerJNI; - ApplicationVersionSuccessHandlerJNI mApplicationVersionSuccessHandlerJNI; - - VendorNameSuccessHandlerJNI mReadVendorNameSuccessHandlerJNI; - VendorIDSuccessHandlerJNI mReadVendorIDSuccessHandlerJNI; - ApplicationNameSuccessHandlerJNI mReadApplicationNameSuccessHandlerJNI; - ProductIDSuccessHandlerJNI mReadProductIDSuccessHandlerJNI; - ApplicationVersionSuccessHandlerJNI mReadApplicationVersionSuccessHandlerJNI; -}; - -inline class TvCastingAppJNI & TvCastingAppJNIMgr() -{ - return TvCastingAppJNI::sInstance; -} diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp index ce8e8c0e1b77a6..2242619df27431 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingApp-JNI.cpp @@ -18,8 +18,8 @@ #include "CastingApp-JNI.h" -#include "../JNIDACProvider.h" #include "../support/Converters-JNI.h" +#include "../support/JNIDACProvider.h" #include "../support/RotatingDeviceIdUniqueIdProvider-JNI.h" // from tv-casting-common @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -37,6 +38,16 @@ using namespace chip; #define JNI_METHOD(RETURN, METHOD_NAME) extern "C" JNIEXPORT RETURN JNICALL Java_com_matter_casting_core_CastingApp_##METHOD_NAME +jint JNI_OnLoad(JavaVM * jvm, void * reserved) +{ + return AndroidAppServerJNI_OnLoad(jvm, reserved); +} + +void JNI_OnUnload(JavaVM * jvm, void * reserved) +{ + return AndroidAppServerJNI_OnUnload(jvm, reserved); +} + namespace matter { namespace casting { namespace core { @@ -73,7 +84,7 @@ JNI_METHOD(jobject, finishInitialization)(JNIEnv *, jobject, jobject jAppParamet VerifyOrReturnValue(jDACProvider != nullptr, support::convertMatterErrorFromCppToJava(CHIP_ERROR_INCORRECT_STATE)); // set the DACProvider - JNIDACProvider * dacProvider = new JNIDACProvider(jDACProvider); + support::JNIDACProvider * dacProvider = new support::JNIDACProvider(jDACProvider); chip::Credentials::SetDeviceAttestationCredentialsProvider(dacProvider); return support::convertMatterErrorFromCppToJava(CHIP_NO_ERROR); diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayerDiscovery-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayerDiscovery-JNI.cpp index 26526dfdac8f07..0dd0a351b7a679 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayerDiscovery-JNI.cpp +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/CastingPlayerDiscovery-JNI.cpp @@ -18,7 +18,6 @@ #include "CastingPlayerDiscovery-JNI.h" -#include "../JNIDACProvider.h" #include "../support/Converters-JNI.h" #include "../support/RotatingDeviceIdUniqueIdProvider-JNI.h" #include "core/CastingApp.h" // from tv-casting-common diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterCastingPlayer-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterCastingPlayer-JNI.cpp index b718682a17124b..5219dbca3a88af 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterCastingPlayer-JNI.cpp +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterCastingPlayer-JNI.cpp @@ -18,7 +18,6 @@ #include "MatterCastingPlayer-JNI.h" -#include "../JNIDACProvider.h" #include "../support/Converters-JNI.h" #include "../support/RotatingDeviceIdUniqueIdProvider-JNI.h" #include "core/CastingApp.h" // from tv-casting-common diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterEndpoint-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterEndpoint-JNI.cpp index e0c41ebc92d260..685be549856981 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterEndpoint-JNI.cpp +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/core/MatterEndpoint-JNI.cpp @@ -18,7 +18,6 @@ #include "MatterEndpoint-JNI.h" -#include "../JNIDACProvider.h" #include "../support/MatterCallback-JNI.h" #include "../support/RotatingDeviceIdUniqueIdProvider-JNI.h" #include "clusters/Clusters.h" // from tv-casting-common diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/JNIDACProvider.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/JNIDACProvider.cpp similarity index 98% rename from examples/tv-casting-app/android/App/app/src/main/jni/cpp/JNIDACProvider.cpp rename to examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/JNIDACProvider.cpp index 363a629db2c9e5..1fbbfd1402dda8 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/JNIDACProvider.cpp +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/JNIDACProvider.cpp @@ -29,6 +29,10 @@ using namespace chip; +namespace matter { +namespace casting { +namespace support { + JNIDACProvider::JNIDACProvider(jobject provider) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -174,3 +178,7 @@ CHIP_ERROR JNIDACProvider::SignWithDeviceAttestationKey(const ByteSpan & message return chip::Crypto::EcdsaAsn1SignatureToRaw(32, ByteSpan(asn1_signature_buffer.data(), asn1_signature_buffer.size()), out_signature_buffer); } + +}; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/JNIDACProvider.h b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/JNIDACProvider.h similarity index 94% rename from examples/tv-casting-app/android/App/app/src/main/jni/cpp/JNIDACProvider.h rename to examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/JNIDACProvider.h index d8d774f41f3061..bb7902f600848c 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/JNIDACProvider.h +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/JNIDACProvider.h @@ -21,6 +21,10 @@ #include #include +namespace matter { +namespace casting { +namespace support { + class JNIDACProvider : public chip::Credentials::DeviceAttestationCredentialsProvider { public: @@ -42,3 +46,7 @@ class JNIDACProvider : public chip::Credentials::DeviceAttestationCredentialsPro jmethodID mGetProductAttestationIntermediateCertMethod = nullptr; jmethodID mSignWithDeviceAttestationKeyMethod = nullptr; }; + +}; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/android/App/app/src/main/res/layout/activity_main.xml b/examples/tv-casting-app/android/App/app/src/main/res/layout/activity_main.xml index ff56873cb23c22..8e3724ec39dd48 100644 --- a/examples/tv-casting-app/android/App/app/src/main/res/layout/activity_main.xml +++ b/examples/tv-casting-app/android/App/app/src/main/res/layout/activity_main.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".chip.casting.app.MainActivity"> + tools:context=".matter.casting.MainActivity"> ShutdownAllSubscriptions(); return CHIP_NO_ERROR; From 4aac314416bc579e1d3aa89128fed7ccbe96974f Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 22 Aug 2024 00:16:07 -0400 Subject: [PATCH 50/52] Remove subscription establishment bits from the MTRDevice base class. (#35139) _setupSubscriptionWithReason was only called from _reattemptSubscriptionNowIfNeededWithReason. _reattemptSubscriptionNowIfNeededWithReason was only called from: * _handleUnsolicitedMessageFromPublisher, which is only called in callbacks set up by _setupSubscriptionWithReason. * _triggerResubscribeWithReason, which only calls it when _reattemptingSubscription is YES. But that's only set to YES in _doHandleSubscriptionReset, see next item. * _doHandleSubscriptionReset, called from: * _handleSubscriptionReset: only called from callbacks set up by _setupSubscriptionWithReason. * _resetSubscriptionWithReasonString: called from unitTestResetSubscription and us detecting persisted data corruption in _clusterDataForPath. But we don't actually have persisted data in the MTRDevice base class anymore, so that's not reachable. So _setupSubscriptionWithReason is not reachable and can be removed. And unitTestResetSubscription can be made a no-op on the base MTRDevice. And we can remove the _resetSubscriptionWithReasonString call in _clusterDataForPath. Once those are done, the following become unreachable: * _handleSubscriptionReset * _handleSubscriptionError * Writing a nonzero value to _unitTestAttributesReportedSinceLastCheck * _markDeviceAsUnreachableIfNeverSubscribed * _handleResubscriptionNeededWithDelay * _handleSubscriptionEstablished * _handleUnsolicitedMessageFromPublisher * _createDataVersionFilterListFromDictionary * _setupConnectivityMonitoring * _resetSubscriptionWithReasonString Once those have been removed, the following become unreachable: * HadSubscriptionEstablishedOnce * _stopConnectivityMonitoring * _doHandleSubscriptionError * _doHandleSubscriptionReset Once those have been removed, the following become unreachable: * _setLastSubscriptionAttemptWait * Setting _lastSubscriptionFailureTime to non-nil * _clearSubscriptionPoolWork * _scheduleSubscriptionPoolWork * Use of _initialSubscribeStart * _storePersistedDeviceData * Use of _connectivityMonitor * Use of _lastSubscriptionFailureTimeForDescription * Any code depending on reattemptingSubscription being YES. * Use of _lastSubscriptionAttemptWait * Use of _lastSubscriptionAttemptWaitForDescription Once those have been removed, _reattemptSubscriptionNowIfNeededWithReason is unreachable and can be removed. At this point _currentReadClient and _currentSubscriptionCallback are always nil, so all code conditioned on those can be removed. Once that's done, _triggerResubscribeWithReason is a no-op, so it and all calls to it can be removed. Since _lastSubscriptionFailureTime is always nil, all code guarded on it not being nil can be removed, so _readThroughSkipped becomes a no-op and _lastSubscriptionFailureTime can be removed. At this point, the following are not reachable: * NeedToStartSubscriptionSetup * _changeInternalState Once those are removed, _internalDeviceStateForDescription is unused, and _internalDeviceState is always MTRInternalDeviceStateUnsubscribed. So HaveSubscriptionEstablishedRightNow() always returns NO and can be removed. At this point SubscriptionCallback is unused and can also be removed. --- src/darwin/Framework/CHIP/MTRDevice.mm | 1044 +----------------------- 1 file changed, 4 insertions(+), 1040 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index f17e6d5c90f6eb..d4027f7725ddeb 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -22,7 +22,6 @@ #import "MTRAttributeSpecifiedCheck.h" #import "MTRBaseClusters.h" #import "MTRBaseDevice_Internal.h" -#import "MTRBaseSubscriptionCallback.h" #import "MTRCluster.h" #import "MTRClusterConstants.h" #import "MTRCommandTimedCheck.h" @@ -43,16 +42,8 @@ #import "zap-generated/MTRCommandPayloads_Internal.h" #import "lib/core/CHIPError.h" -#import "lib/core/DataModelTypes.h" -#import -#import - -#import -#import -#import -#import + #import -#import typedef void (^MTRDeviceAttributeReportHandler)(NSArray * _Nonnull); @@ -113,68 +104,13 @@ - (void)_deviceInternalStateChanged:(MTRDevice *)device; /* END DRAGONS */ -#pragma mark - SubscriptionCallback class declaration using namespace chip; using namespace chip::app; using namespace chip::Protocols::InteractionModel; using namespace chip::Tracing::DarwinFramework; -typedef void (^FirstReportHandler)(void); - -namespace { - -class SubscriptionCallback final : public MTRBaseSubscriptionCallback { -public: - SubscriptionCallback(DataReportCallback attributeReportCallback, DataReportCallback eventReportCallback, - ErrorCallback errorCallback, MTRDeviceResubscriptionScheduledHandler resubscriptionCallback, - SubscriptionEstablishedHandler subscriptionEstablishedHandler, OnDoneHandler onDoneHandler, - UnsolicitedMessageFromPublisherHandler unsolicitedMessageFromPublisherHandler, ReportBeginHandler reportBeginHandler, - ReportEndHandler reportEndHandler) - : MTRBaseSubscriptionCallback(attributeReportCallback, eventReportCallback, errorCallback, resubscriptionCallback, - subscriptionEstablishedHandler, onDoneHandler, unsolicitedMessageFromPublisherHandler, reportBeginHandler, - reportEndHandler) - { - } - - // Used to reset Resubscription backoff on events that indicate likely availability of device to come back online - void ResetResubscriptionBackoff() { mResubscriptionNumRetries = 0; } - -private: - void OnEventData(const EventHeader & aEventHeader, TLV::TLVReader * apData, const StatusIB * apStatus) override; - - void OnAttributeData(const ConcreteDataAttributePath & aPath, TLV::TLVReader * apData, const StatusIB & aStatus) override; - - CHIP_ERROR OnResubscriptionNeeded(chip::app::ReadClient * apReadClient, CHIP_ERROR aTerminationCause) override; - - // Copied from ReadClient and customized for MTRDevice resubscription time reset - uint32_t ComputeTimeTillNextSubscription(); - uint32_t mResubscriptionNumRetries = 0; -}; - -} // anonymous namespace - #pragma mark - MTRDevice -// Utility methods for working with MTRInternalDeviceState, located near the -// enum so it's easier to notice that they need to stay in sync. -namespace { -bool HadSubscriptionEstablishedOnce(MTRInternalDeviceState state) -{ - return state >= MTRInternalDeviceStateInitialSubscriptionEstablished; -} - -bool NeedToStartSubscriptionSetup(MTRInternalDeviceState state) -{ - return state <= MTRInternalDeviceStateUnsubscribed; -} - -bool HaveSubscriptionEstablishedRightNow(MTRInternalDeviceState state) -{ - return state == MTRInternalDeviceStateInitialSubscriptionEstablished || state == MTRInternalDeviceStateLaterSubscriptionEstablished; -} - -} // anonymous namespace - typedef NS_ENUM(NSUInteger, MTRDeviceExpectedValueFieldIndex) { MTRDeviceExpectedValueFieldExpirationTimeIndex = 0, MTRDeviceExpectedValueFieldValueIndex = 1, @@ -338,13 +274,6 @@ @interface MTRDevice () #define MTRDEVICE_SUBSCRIPTION_ATTEMPT_MAX_WAIT_SECONDS (3600) @property (nonatomic) uint32_t lastSubscriptionAttemptWait; -/** - * If reattemptingSubscription is true, that means that we have failed to get a - * CASE session for the publisher and are now waiting to try again. In this - * state we never have subscriptionActive true or a non-null currentReadClient. - */ -@property (nonatomic) BOOL reattemptingSubscription; - // Expected value cache is attributePath => NSArray of [NSDate of expiration time, NSDictionary of value, expected value ID] // - See MTRDeviceExpectedValueFieldIndex for the definitions of indices into this array. // See MTRDeviceResponseHandler definition for value dictionary details. @@ -362,14 +291,6 @@ @interface MTRDevice () @property (nonatomic) NSMutableDictionary * temporaryMetaDataCache; -/** - * If currentReadClient is non-null, that means that we successfully - * called SendAutoResubscribeRequest on the ReadClient and have not yet gotten - * an OnDone for that ReadClient. - */ -@property (nonatomic) ReadClient * currentReadClient; -@property (nonatomic) SubscriptionCallback * currentSubscriptionCallback; // valid when and only when currentReadClient is valid - @end // Declaring selector so compiler won't complain about testing and calling it in _handleReportEnd @@ -389,10 +310,6 @@ - (BOOL)unitTestSuppressTimeBasedReachabilityChanges:(MTRDevice *)device; #endif @implementation MTRDevice { -#ifdef DEBUG - NSUInteger _unitTestAttributesReportedSinceLastCheck; -#endif - // _deviceCachePrimed is true if we have the data that comes from an initial // subscription priming report (whether it came from storage or from our // subscription). @@ -410,26 +327,10 @@ @implementation MTRDevice { // right now (because they have been evicted). NSMutableSet * _persistedClusters; - // When we last failed to subscribe to the device (either via - // _setupSubscriptionWithReason or via the auto-resubscribe behavior - // of the ReadClient). Nil if we have had no such failures. - NSDate * _Nullable _lastSubscriptionFailureTime; - MTRDeviceConnectivityMonitor * _connectivityMonitor; - // This boolean keeps track of any device configuration changes received in an attribute report. // If this is true when the report ends, we notify the delegate. BOOL _deviceConfigurationChanged; - // The completion block is set when the subscription / resubscription work is enqueued, and called / cleared when any of the following happen: - // 1. Subscription establishes - // 2. OnResubscriptionNeeded is called - // 3. Subscription reset (including when getSessionForNode fails) - MTRAsyncWorkCompletionBlock _subscriptionPoolWorkCompletionBlock; - - // Tracking of initial subscribe latency. When _initialSubscribeStart is - // nil, we are not tracking the latency. - NSDate * _Nullable _initialSubscribeStart; - // Storage behavior configuration and variables to keep track of the logic // _clusterDataPersistenceFirstScheduledTime is used to track the start time of the delay between // report and persistence. @@ -459,14 +360,8 @@ @implementation MTRDevice { // _allNetworkFeatures is a bitwise or of the feature maps of all network commissioning clusters // present on the device, or nil if there aren't any. NSNumber * _Nullable _allNetworkFeatures; - // Copy of _internalDeviceState that is safe to use in description. - MTRInternalDeviceState _internalDeviceStateForDescription; - // Copy of _lastSubscriptionAttemptWait that is safe to use in description. - uint32_t _lastSubscriptionAttemptWaitForDescription; // Most recent entry in _mostRecentReportTimes, if any. NSDate * _Nullable _mostRecentReportTimeForDescription; - // Copy of _lastSubscriptionFailureTime that is safe to use in description. - NSDate * _Nullable _lastSubscriptionFailureTimeForDescription; } - (instancetype)initForSubclassesWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller @@ -496,7 +391,6 @@ - (instancetype)initWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceControlle _asyncWorkQueue = [[MTRAsyncWorkQueue alloc] initWithContext:self]; _state = MTRDeviceStateUnknown; _internalDeviceState = MTRInternalDeviceStateUnsubscribed; - _internalDeviceStateForDescription = MTRInternalDeviceStateUnsubscribed; if (controller.controllerDataStore) { _persistedClusterData = [[NSCache alloc] init]; } else { @@ -861,51 +755,6 @@ - (void)nodeMayBeAdvertisingOperational assertChipStackLockedByCurrentThread(); MTR_LOG("%@ saw new operational advertisement", self); - - [self _triggerResubscribeWithReason:@"operational advertisement seen" - nodeLikelyReachable:YES]; -} - -// Trigger a resubscribe as needed. nodeLikelyReachable should be YES if we -// have reason to suspect the node is now reachable, NO if we have no idea -// whether it might be. -- (void)_triggerResubscribeWithReason:(NSString *)reason nodeLikelyReachable:(BOOL)nodeLikelyReachable -{ - MTR_LOG("%@ _triggerResubscribeWithReason called with reason %@", self, reason); - assertChipStackLockedByCurrentThread(); - - // We might want to trigger a resubscribe on our existing ReadClient. Do - // that outside the scope of our lock, so we're not calling arbitrary code - // we don't control with the lock held. This is safe, because we are - // running on he Matter queue and the ReadClient can't get destroyed while - // we are on that queue. - ReadClient * readClientToResubscribe = nullptr; - SubscriptionCallback * subscriptionCallback = nullptr; - - os_unfair_lock_lock(&self->_lock); - - // Don't change state to MTRDeviceStateReachable, since the device might not - // in fact be reachable yet; we won't know until we have managed to - // establish a CASE session. And at that point, our subscription will - // trigger the state change as needed. - if (self.reattemptingSubscription) { - [self _reattemptSubscriptionNowIfNeededWithReason:reason]; - } else { - readClientToResubscribe = self->_currentReadClient; - subscriptionCallback = self->_currentSubscriptionCallback; - } - os_unfair_lock_unlock(&self->_lock); - - if (readClientToResubscribe) { - if (nodeLikelyReachable) { - // If we have reason to suspect the node is now reachable, reset the - // backoff timer, so that if this attempt fails we'll try again - // quickly; it's possible we'll just catch the node at a bad time - // here (e.g. still booting up), but should try again reasonably quickly. - subscriptionCallback->ResetResubscriptionBackoff(); - } - readClientToResubscribe->TriggerResubscribeIfScheduled(reason.UTF8String); - } } // Return YES if we are in a state where, apart from communication issues with @@ -941,41 +790,6 @@ - (BOOL)_subscriptionAbleToReport // Notification that read-through was skipped for an attribute read. - (void)_readThroughSkipped { - std::lock_guard lock(_lock); - if (_state == MTRDeviceStateReachable) { - // We're getting reports from the device, so there's nothing else to be - // done here. We could skip this check, because our "try to - // resubscribe" code would be a no-op in this case, but then we'd have - // an extra dispatch in the common case of read-while-subscribed, which - // is not great for peformance. - return; - } - - if (_lastSubscriptionFailureTime == nil) { - // No need to try to do anything here, because we have never failed a - // subscription attempt (so we might be in the middle of one now, and no - // need to prod things along). - return; - } - - if ([[NSDate now] timeIntervalSinceDate:_lastSubscriptionFailureTime] < MTRDEVICE_MIN_RESUBSCRIBE_DUE_TO_READ_INTERVAL_SECONDS) { - // Not enough time has passed since we last tried. Don't create extra - // network traffic. - // - // TODO: Do we need to worry about this being too spammy in the log if - // we keep getting reads while not subscribed? We could add another - // backoff timer or counter for the log line... - MTR_LOG_DEBUG("%@ skipping resubscribe from skipped read-through: not enough time has passed since %@", self, _lastSubscriptionFailureTime); - return; - } - - // Do the remaining work on the Matter queue, because we may want to touch - // ReadClient in there. If the dispatch fails, that's fine; it means our - // controller has shut down, so nothing to be done. - [_deviceController asyncDispatchToMatterQueue:^{ - [self _triggerResubscribeWithReason:@"read-through skipped while not subscribed" nodeLikelyReachable:NO]; - } - errorHandler:nil]; } - (BOOL)_delegateExists @@ -1090,29 +904,6 @@ - (void)_changeState:(MTRDeviceState)state } } -- (void)_changeInternalState:(MTRInternalDeviceState)state -{ - os_unfair_lock_assert_owner(&self->_lock); - MTRInternalDeviceState lastState = _internalDeviceState; - _internalDeviceState = state; - { - std::lock_guard lock(_descriptionLock); - _internalDeviceStateForDescription = _internalDeviceState; - } - if (lastState != state) { - MTR_LOG("%@ internal state change %lu => %lu", self, static_cast(lastState), static_cast(state)); - - /* BEGIN DRAGONS: This is a huge hack for a specific use case, do not rename, remove or modify behavior here */ - // TODO: This should only be called for thread devices - [self _callDelegatesWithBlock:^(id delegate) { - if ([delegate respondsToSelector:@selector(_deviceInternalStateChanged:)]) { - [delegate _deviceInternalStateChanged:self]; - } - }]; - /* END DRAGONS */ - } -} - #ifdef DEBUG - (MTRInternalDeviceState)_getInternalState { @@ -1121,71 +912,6 @@ - (MTRInternalDeviceState)_getInternalState } #endif -// First Time Sync happens 2 minutes after reachability (this can be changed in the future) -#define MTR_DEVICE_TIME_UPDATE_INITIAL_WAIT_TIME_SEC (60 * 2) -- (void)_handleSubscriptionEstablished -{ - os_unfair_lock_lock(&self->_lock); - - // If subscription had reset since this handler was scheduled, do not execute "established" logic below - if (!HaveSubscriptionEstablishedRightNow(_internalDeviceState)) { - MTR_LOG("%@ _handleSubscriptionEstablished run with internal state %lu - skipping subscription establishment logic", self, static_cast(_internalDeviceState)); - return; - } - - // We have completed the subscription work - remove from the subscription pool. - [self _clearSubscriptionPoolWork]; - - // No need to monitor connectivity after subscription establishment - [self _stopConnectivityMonitoring]; - - // reset subscription attempt wait time when subscription succeeds - [self _setLastSubscriptionAttemptWait:0]; - - auto initialSubscribeStart = _initialSubscribeStart; - // We no longer need to track subscribe latency for this device. - _initialSubscribeStart = nil; - - if (initialSubscribeStart != nil) { - // We want time interval from initialSubscribeStart to now, not the other - // way around. - NSTimeInterval subscriptionLatency = -[initialSubscribeStart timeIntervalSinceNow]; - if (_estimatedSubscriptionLatency == nil) { - _estimatedSubscriptionLatency = @(subscriptionLatency); - } else { - NSTimeInterval newSubscriptionLatencyEstimate = MTRDEVICE_SUBSCRIPTION_LATENCY_NEW_VALUE_WEIGHT * subscriptionLatency + (1 - MTRDEVICE_SUBSCRIPTION_LATENCY_NEW_VALUE_WEIGHT) * _estimatedSubscriptionLatency.doubleValue; - _estimatedSubscriptionLatency = @(newSubscriptionLatencyEstimate); - } - [self _storePersistedDeviceData]; - } - - os_unfair_lock_unlock(&self->_lock); - - os_unfair_lock_lock(&self->_timeSyncLock); - - if (!self.timeUpdateScheduled) { - [self _scheduleNextUpdate:MTR_DEVICE_TIME_UPDATE_INITIAL_WAIT_TIME_SEC]; - } - - os_unfair_lock_unlock(&self->_timeSyncLock); -} - -- (void)_handleSubscriptionError:(NSError *)error -{ - std::lock_guard lock(_lock); - [self _doHandleSubscriptionError:error]; -} - -- (void)_doHandleSubscriptionError:(NSError *)error -{ - os_unfair_lock_assert_owner(&_lock); - - [self _changeInternalState:MTRInternalDeviceStateUnsubscribed]; - _unreportedEvents = nil; - - [self _changeState:MTRDeviceStateUnreachable]; -} - - (BOOL)deviceUsesThread { std::lock_guard lock(_lock); @@ -1229,253 +955,6 @@ - (BOOL)_deviceUsesThread return (networkCommissioningClusterFeatureMapValue & MTRNetworkCommissioningFeatureThreadNetworkInterface) != 0 ? YES : NO; } -- (void)_clearSubscriptionPoolWork -{ - os_unfair_lock_assert_owner(&self->_lock); - MTRAsyncWorkCompletionBlock completion = self->_subscriptionPoolWorkCompletionBlock; - if (completion) { -#ifdef DEBUG - [self _callDelegatesWithBlock:^(id testDelegate) { - if ([testDelegate respondsToSelector:@selector(unitTestSubscriptionPoolWorkComplete:)]) { - [testDelegate unitTestSubscriptionPoolWorkComplete:self]; - } - }]; -#endif - self->_subscriptionPoolWorkCompletionBlock = nil; - completion(MTRAsyncWorkComplete); - } -} - -- (void)_scheduleSubscriptionPoolWork:(dispatch_block_t)workBlock inNanoseconds:(int64_t)inNanoseconds description:(NSString *)description -{ - os_unfair_lock_assert_owner(&self->_lock); - - // Sanity check we are not scheduling for this device multiple times in the pool - if (_subscriptionPoolWorkCompletionBlock) { - MTR_LOG("%@ already scheduled in subscription pool for this device - ignoring: %@", self, description); - return; - } - - // Wait the required amount of time, then put it in the subscription pool to wait additionally for a spot, if needed - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, inNanoseconds), dispatch_get_main_queue(), ^{ - // In the case where a resubscription triggering event happened and already established, running the work block should result in a no-op - MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.queue]; - [workItem setReadyHandler:^(id _Nonnull context, NSInteger retryCount, MTRAsyncWorkCompletionBlock _Nonnull completion) { - MTR_LOG("%@ - work item is ready to attempt pooled subscription", self); - os_unfair_lock_lock(&self->_lock); -#ifdef DEBUG - [self _callDelegatesWithBlock:^(id testDelegate) { - if ([testDelegate respondsToSelector:@selector(unitTestSubscriptionPoolDequeue:)]) { - [testDelegate unitTestSubscriptionPoolDequeue:self]; - } - }]; -#endif - if (self->_subscriptionPoolWorkCompletionBlock) { - // This means a resubscription triggering event happened and is now in-progress - MTR_LOG("%@ timer fired but already running in subscription pool - ignoring: %@", self, description); - os_unfair_lock_unlock(&self->_lock); - - // call completion as complete to remove from queue - completion(MTRAsyncWorkComplete); - return; - } - - // Otherwise, save the completion block - self->_subscriptionPoolWorkCompletionBlock = completion; - os_unfair_lock_unlock(&self->_lock); - - workBlock(); - }]; - [self->_deviceController.concurrentSubscriptionPool enqueueWorkItem:workItem description:description]; - MTR_LOG("%@ - enqueued in the subscription pool", self); - }); -} - -- (void)_handleResubscriptionNeededWithDelay:(NSNumber *)resubscriptionDelayMs -{ - BOOL deviceUsesThread; - - os_unfair_lock_lock(&self->_lock); - - [self _changeState:MTRDeviceStateUnknown]; - [self _changeInternalState:MTRInternalDeviceStateResubscribing]; - - // If we are here, then the ReadClient either just detected a subscription - // drop or just tried again and failed. Either way, count it as "tried and - // failed to subscribe": in the latter case it's actually true, and in the - // former case we recently had a subscription and do not want to be forcing - // retries immediately. - _lastSubscriptionFailureTime = [NSDate now]; - { - std::lock_guard lock(_descriptionLock); - _lastSubscriptionFailureTimeForDescription = _lastSubscriptionFailureTime; - } - - deviceUsesThread = [self _deviceUsesThread]; - - // If a previous resubscription failed, remove the item from the subscription pool. - [self _clearSubscriptionPoolWork]; - - os_unfair_lock_unlock(&self->_lock); - - // Use the existing _triggerResubscribeWithReason mechanism, which does the right checks when - // this block is run -- if other triggering events had happened, this would become a no-op. - auto resubscriptionBlock = ^{ - [self->_deviceController asyncDispatchToMatterQueue:^{ - [self _triggerResubscribeWithReason:@"ResubscriptionNeeded timer fired" nodeLikelyReachable:NO]; - } errorHandler:^(NSError * _Nonnull error) { - // If controller is not running, clear work item from the subscription queue - MTR_LOG_ERROR("%@ could not dispatch to matter queue for resubscription - error %@", self, error); - std::lock_guard lock(self->_lock); - [self _clearSubscriptionPoolWork]; - }]; - }; - - int64_t resubscriptionDelayNs = static_cast(resubscriptionDelayMs.unsignedIntValue * NSEC_PER_MSEC); - if (deviceUsesThread) { - std::lock_guard lock(_lock); - // For Thread-enabled devices, schedule the _triggerResubscribeWithReason call to run in the subscription pool - [self _scheduleSubscriptionPoolWork:resubscriptionBlock inNanoseconds:resubscriptionDelayNs description:@"ReadClient resubscription"]; - } else { - // For non-Thread-enabled devices, just call the resubscription block after the specified time - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, resubscriptionDelayNs), self.queue, resubscriptionBlock); - } - - // Set up connectivity monitoring in case network routability changes for the positive, to accelerate resubscription - [self _setupConnectivityMonitoring]; -} - -- (void)_handleSubscriptionReset:(NSNumber * _Nullable)retryDelay -{ - std::lock_guard lock(_lock); - [self _doHandleSubscriptionReset:retryDelay]; -} - -- (void)_setLastSubscriptionAttemptWait:(uint32_t)lastSubscriptionAttemptWait -{ - os_unfair_lock_assert_owner(&_lock); - _lastSubscriptionAttemptWait = lastSubscriptionAttemptWait; - - std::lock_guard lock(_descriptionLock); - _lastSubscriptionAttemptWaitForDescription = lastSubscriptionAttemptWait; -} - -- (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay -{ - os_unfair_lock_assert_owner(&_lock); - - // If we are here, then either we failed to establish initial CASE, or we - // failed to send the initial SubscribeRequest message, or our ReadClient - // has given up completely. Those all count as "we have tried and failed to - // subscribe". - _lastSubscriptionFailureTime = [NSDate now]; - { - std::lock_guard lock(_descriptionLock); - _lastSubscriptionFailureTimeForDescription = _lastSubscriptionFailureTime; - } - - // if there is no delegate then also do not retry - if (![self _delegateExists]) { - // NOTE: Do not log anything here: we have been invalidated, and the - // Matter stack might already be torn down. - return; - } - - // don't schedule multiple retries - if (self.reattemptingSubscription) { - return; - } - - self.reattemptingSubscription = YES; - - NSTimeInterval secondsToWait; - if (_lastSubscriptionAttemptWait < MTRDEVICE_SUBSCRIPTION_ATTEMPT_MIN_WAIT_SECONDS) { - _lastSubscriptionAttemptWait = MTRDEVICE_SUBSCRIPTION_ATTEMPT_MIN_WAIT_SECONDS; - secondsToWait = _lastSubscriptionAttemptWait; - } else if (retryDelay != nil) { - // The device responded but is currently busy. Reset our backoff - // counter, so that we don't end up waiting for a long time if the next - // attempt fails for some reason, and retry after whatever time period - // the device told us to use. - [self _setLastSubscriptionAttemptWait:0]; - secondsToWait = retryDelay.doubleValue; - MTR_LOG("%@ resetting resubscribe attempt counter, and delaying by the server-provided delay: %f", - self, secondsToWait); - } else { - auto lastSubscriptionAttemptWait = _lastSubscriptionAttemptWait * 2; - if (lastSubscriptionAttemptWait > MTRDEVICE_SUBSCRIPTION_ATTEMPT_MAX_WAIT_SECONDS) { - lastSubscriptionAttemptWait = MTRDEVICE_SUBSCRIPTION_ATTEMPT_MAX_WAIT_SECONDS; - } - [self _setLastSubscriptionAttemptWait:lastSubscriptionAttemptWait]; - secondsToWait = lastSubscriptionAttemptWait; - } - - MTR_LOG("%@ scheduling to reattempt subscription in %f seconds", self, secondsToWait); - - // If we started subscription or session establishment but failed, remove item from the subscription pool so we can re-queue. - [self _clearSubscriptionPoolWork]; - - // Call _reattemptSubscriptionNowIfNeededWithReason when timer fires - if subscription is - // in a better state at that time this will be a no-op. - auto resubscriptionBlock = ^{ - std::lock_guard lock(self->_lock); - [self _reattemptSubscriptionNowIfNeededWithReason:@"got subscription reset"]; - }; - - int64_t resubscriptionDelayNs = static_cast(secondsToWait * NSEC_PER_SEC); - if ([self _deviceUsesThread]) { - // For Thread-enabled devices, schedule the _reattemptSubscriptionNowIfNeededWithReason call to run in the subscription pool - [self _scheduleSubscriptionPoolWork:resubscriptionBlock inNanoseconds:resubscriptionDelayNs description:@"MTRDevice resubscription"]; - } else { - // For non-Thread-enabled devices, just call the resubscription block after the specified time - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, resubscriptionDelayNs), self.queue, resubscriptionBlock); - } -} - -- (void)_reattemptSubscriptionNowIfNeededWithReason:(NSString *)reason -{ - os_unfair_lock_assert_owner(&self->_lock); - if (!self.reattemptingSubscription) { - return; - } - - MTR_LOG("%@ reattempting subscription with reason %@", self, reason); - self.reattemptingSubscription = NO; - [self _setupSubscriptionWithReason:reason]; -} - -- (void)_handleUnsolicitedMessageFromPublisher -{ - std::lock_guard lock(_lock); - - [self _changeState:MTRDeviceStateReachable]; - - [self _callDelegatesWithBlock:^(id delegate) { - if ([delegate respondsToSelector:@selector(deviceBecameActive:)]) { - [delegate deviceBecameActive:self]; - } - }]; - - // in case this is called during exponential back off of subscription - // reestablishment, this starts the attempt right away - // TODO: This doesn't really make sense. If we _don't_ have a live - // ReadClient how did we get this notification and if we _do_ have an active - // ReadClient, this call or _setupSubscriptionWithReason would be no-ops. - [self _reattemptSubscriptionNowIfNeededWithReason:@"got unsolicited message from publisher"]; -} - -- (void)_markDeviceAsUnreachableIfNeverSubscribed -{ - os_unfair_lock_assert_owner(&self->_lock); - - if (HadSubscriptionEstablishedOnce(_internalDeviceState)) { - return; - } - - MTR_LOG("%@ still not subscribed, marking the device as unreachable", self); - [self _changeState:MTRDeviceStateUnreachable]; -} - - (void)_handleReportBegin { std::lock_guard lock(_lock); @@ -1487,7 +966,7 @@ - (void)_handleReportBegin // If we currently don't have an established subscription, this must be a // priming report. - _receivingPrimingReport = !HaveSubscriptionEstablishedRightNow(_internalDeviceState); + _receivingPrimingReport = YES; } - (NSDictionary *)_clusterDataToPersistSnapshot @@ -2136,8 +1615,6 @@ - (nullable MTRDeviceClusterData *)_clusterDataForPath:(MTRClusterPath *)cluster // First make sure _persistedClusters is consistent with storage, so repeated calls don't immediately re-trigger this [self _reconcilePersistedClustersWithStorage]; - - [self _resetSubscriptionWithReasonString:[NSString stringWithFormat:@"Data store has no data for cluster %@", clusterPath]]; } return data; @@ -2243,352 +1720,16 @@ - (void)_removeCachedAttribute:(NSNumber *)attributeID fromCluster:(MTRClusterPa [clusterData removeValueForAttribute:attributeID]; } -- (void)_createDataVersionFilterListFromDictionary:(NSDictionary *)dataVersions dataVersionFilterList:(DataVersionFilter **)dataVersionFilterList count:(size_t *)count -{ - size_t dataVersionFilterSize = dataVersions.count; - - // Check if any filter list should be generated - if (dataVersionFilterSize == 0) { - *count = 0; - *dataVersionFilterList = nullptr; - return; - } - - DataVersionFilter * dataVersionFilterArray = new DataVersionFilter[dataVersionFilterSize]; - size_t i = 0; - for (MTRClusterPath * path in dataVersions) { - NSNumber * dataVersionNumber = dataVersions[path]; - dataVersionFilterArray[i++] = DataVersionFilter(static_cast(path.endpoint.unsignedShortValue), static_cast(path.cluster.unsignedLongValue), static_cast(dataVersionNumber.unsignedLongValue)); - } - - *dataVersionFilterList = dataVersionFilterArray; - *count = dataVersionFilterSize; -} - -- (void)_setupConnectivityMonitoring -{ -#if ENABLE_CONNECTIVITY_MONITORING - // Dispatch to own queue because we used to need to do that to get the compressedFabricID, but - // at this point that's not really needed anymore. - dispatch_async(self.queue, ^{ - // Get the required info before setting up the connectivity monitor - NSNumber * compressedFabricID = [self->_deviceController compressedFabricID]; - if (!compressedFabricID) { - MTR_LOG_ERROR("%@ could not get compressed fabricID", self); - return; - } - - // Now lock for _connectivityMonitor - std::lock_guard lock(self->_lock); - if (self->_connectivityMonitor) { - // already monitoring - return; - } - - self->_connectivityMonitor = [[MTRDeviceConnectivityMonitor alloc] initWithCompressedFabricID:compressedFabricID nodeID:self.nodeID]; - [self->_connectivityMonitor startMonitoringWithHandler:^{ - [self->_deviceController asyncDispatchToMatterQueue:^{ - [self _triggerResubscribeWithReason:@"device connectivity changed" nodeLikelyReachable:YES]; - } - errorHandler:nil]; - } queue:self.queue]; - }); -#endif -} - -- (void)_stopConnectivityMonitoring -{ - os_unfair_lock_assert_owner(&_lock); - - if (_connectivityMonitor) { - [_connectivityMonitor stopMonitoring]; - _connectivityMonitor = nil; - } -} - -- (void)_resetSubscriptionWithReasonString:(NSString *)reasonString -{ - os_unfair_lock_assert_owner(&self->_lock); - MTR_LOG_ERROR("%@ %@ - resetting subscription", self, reasonString); - - [_deviceController asyncDispatchToMatterQueue:^{ - MTR_LOG("%@ subscription reset disconnecting ReadClient and SubscriptionCallback", self); - - std::lock_guard lock(self->_lock); - self->_currentReadClient = nullptr; - if (self->_currentSubscriptionCallback) { - delete self->_currentSubscriptionCallback; - } - self->_currentSubscriptionCallback = nullptr; - - [self _doHandleSubscriptionError:nil]; - // Use nil reset delay so that this keeps existing backoff timing - [self _doHandleSubscriptionReset:nil]; - } - errorHandler:nil]; -} - #ifdef DEBUG - (void)unitTestResetSubscription { - std::lock_guard lock(self->_lock); - [self _resetSubscriptionWithReasonString:@"Unit test reset subscription"]; } #endif -// assume lock is held -- (void)_setupSubscriptionWithReason:(NSString *)reason -{ - // TODO: XPC: This is not really called anymore in this class. Should - // remove this function and anything only reachable from it. - os_unfair_lock_assert_owner(&self->_lock); - - if (![self _subscriptionsAllowed]) { - MTR_LOG("%@ _setupSubscription: Subscriptions not allowed. Do not set up subscription (reason: %@)", self, reason); - return; - } - -#ifdef DEBUG - __block NSNumber * delegateMin = nil; - Optional maxIntervalOverride; - [self _callFirstDelegateSynchronouslyWithBlock:^(id testDelegate) { - if ([testDelegate respondsToSelector:@selector(unitTestMaxIntervalOverrideForSubscription:)]) { - delegateMin = [testDelegate unitTestMaxIntervalOverrideForSubscription:self]; - } - }]; - if (delegateMin) { - maxIntervalOverride.Emplace(delegateMin.unsignedIntValue); - } -#endif - - // for now just subscribe once - if (!NeedToStartSubscriptionSetup(_internalDeviceState)) { - MTR_LOG("%@ setupSubscription: no need to subscribe due to internal state %lu (reason: %@)", self, static_cast(_internalDeviceState), reason); - return; - } - - [self _changeInternalState:MTRInternalDeviceStateSubscribing]; - - MTR_LOG("%@ setting up subscription with reason: %@", self, reason); - - __block bool markUnreachableAfterWait = true; -#ifdef DEBUG - [self _callFirstDelegateSynchronouslyWithBlock:^(id testDelegate) { - if ([testDelegate respondsToSelector:@selector(unitTestSuppressTimeBasedReachabilityChanges:)]) { - markUnreachableAfterWait = ![testDelegate unitTestSuppressTimeBasedReachabilityChanges:self]; - } - }]; -#endif - - if (markUnreachableAfterWait) { - // Set up a timer to mark as not reachable if it takes too long to set up a subscription - mtr_weakify(self); - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, static_cast(kSecondsToWaitBeforeMarkingUnreachableAfterSettingUpSubscription) * static_cast(NSEC_PER_SEC)), self.queue, ^{ - mtr_strongify(self); - if (self != nil) { - std::lock_guard lock(self->_lock); - [self _markDeviceAsUnreachableIfNeverSubscribed]; - } - }); - } - - // This marks begin of initial subscription to the device (before CASE is established). The end is only marked after successfully setting - // up the subscription since it is always retried as long as the MTRDevice is kept running. - MATTER_LOG_METRIC_BEGIN(kMetricMTRDeviceInitialSubscriptionSetup); - - // Call directlyGetSessionForNode because the subscription setup already goes through the subscription pool queue - [_deviceController - directlyGetSessionForNode:_nodeID.unsignedLongLongValue - completion:^(chip::Messaging::ExchangeManager * _Nullable exchangeManager, - const chip::Optional & session, NSError * _Nullable error, - NSNumber * _Nullable retryDelay) { - if (error != nil) { - MTR_LOG_ERROR("%@ getSessionForNode error %@", self, error); - dispatch_async(self.queue, ^{ - [self _handleSubscriptionError:error]; - [self _handleSubscriptionReset:retryDelay]; - }); - return; - } - - auto callback = std::make_unique( - ^(NSArray * value) { - MTR_LOG("%@ got attribute report %@", self, value); - dispatch_async(self.queue, ^{ - // OnAttributeData - [self _handleAttributeReport:value fromSubscription:YES]; -#ifdef DEBUG - self->_unitTestAttributesReportedSinceLastCheck += value.count; -#endif - }); - }, - ^(NSArray * value) { - MTR_LOG("%@ got event report %@", self, value); - dispatch_async(self.queue, ^{ - // OnEventReport - [self _handleEventReport:value]; - }); - }, - ^(NSError * error) { - MTR_LOG_ERROR("%@ got subscription error %@", self, error); - dispatch_async(self.queue, ^{ - // OnError - [self _handleSubscriptionError:error]; - }); - }, - ^(NSError * error, NSNumber * resubscriptionDelayMs) { - MTR_LOG_ERROR("%@ got resubscription error %@ delay %@", self, error, resubscriptionDelayMs); - dispatch_async(self.queue, ^{ - // OnResubscriptionNeeded - [self _handleResubscriptionNeededWithDelay:resubscriptionDelayMs]; - }); - }, - ^(void) { - MTR_LOG("%@ got subscription established", self); - std::lock_guard lock(self->_lock); - - // First synchronously change state - if (HadSubscriptionEstablishedOnce(self->_internalDeviceState)) { - [self _changeInternalState:MTRInternalDeviceStateLaterSubscriptionEstablished]; - } else { - MATTER_LOG_METRIC_END(kMetricMTRDeviceInitialSubscriptionSetup, CHIP_NO_ERROR); - [self _changeInternalState:MTRInternalDeviceStateInitialSubscriptionEstablished]; - } - - [self _changeState:MTRDeviceStateReachable]; - - // Then async work that shouldn't be performed on the matter queue - dispatch_async(self.queue, ^{ - // OnSubscriptionEstablished - [self _handleSubscriptionEstablished]; - }); - }, - ^(void) { - MTR_LOG("%@ got subscription done", self); - // Drop our pointer to the ReadClient immediately, since - // it's about to be destroyed and we don't want to be - // holding a dangling pointer. - std::lock_guard lock(self->_lock); - self->_currentReadClient = nullptr; - self->_currentSubscriptionCallback = nullptr; - - dispatch_async(self.queue, ^{ - // OnDone - [self _handleSubscriptionReset:nil]; - }); - }, - ^(void) { - MTR_LOG("%@ got unsolicited message from publisher", self); - dispatch_async(self.queue, ^{ - // OnUnsolicitedMessageFromPublisher - [self _handleUnsolicitedMessageFromPublisher]; - }); - }, - ^(void) { - MTR_LOG("%@ got report begin", self); - dispatch_async(self.queue, ^{ - [self _handleReportBegin]; - }); - }, - ^(void) { - MTR_LOG("%@ got report end", self); - dispatch_async(self.queue, ^{ - [self _handleReportEnd]; - }); - }); - - // Set up a cluster state cache. We just want this for the logic it has for - // tracking data versions and event numbers so we minimize the amount of data we - // request on resubscribes, so tell it not to store data. - auto clusterStateCache = std::make_unique(*callback.get(), - /* highestReceivedEventNumber = */ NullOptional, - /* cacheData = */ false); - auto readClient = std::make_unique(InteractionModelEngine::GetInstance(), exchangeManager, - clusterStateCache->GetBufferedCallback(), ReadClient::InteractionType::Subscribe); - - // Wildcard endpoint, cluster, attribute, event. - auto attributePath = std::make_unique(); - auto eventPath = std::make_unique(); - // We want to get event reports at the minInterval, not the maxInterval. - eventPath->mIsUrgentEvent = true; - ReadPrepareParams readParams(session.Value()); - - readParams.mMinIntervalFloorSeconds = 0; - // Select a max interval based on the device's claimed idle sleep interval. - auto idleSleepInterval = std::chrono::duration_cast( - session.Value()->GetRemoteMRPConfig().mIdleRetransTimeout); - - auto maxIntervalCeilingMin = System::Clock::Seconds32(MTR_DEVICE_SUBSCRIPTION_MAX_INTERVAL_MIN); - if (idleSleepInterval < maxIntervalCeilingMin) { - idleSleepInterval = maxIntervalCeilingMin; - } - - auto maxIntervalCeilingMax = System::Clock::Seconds32(MTR_DEVICE_SUBSCRIPTION_MAX_INTERVAL_MAX); - if (idleSleepInterval > maxIntervalCeilingMax) { - idleSleepInterval = maxIntervalCeilingMax; - } -#ifdef DEBUG - if (maxIntervalOverride.HasValue()) { - idleSleepInterval = maxIntervalOverride.Value(); - } -#endif - readParams.mMaxIntervalCeilingSeconds = static_cast(idleSleepInterval.count()); - - readParams.mpAttributePathParamsList = attributePath.get(); - readParams.mAttributePathParamsListSize = 1; - readParams.mpEventPathParamsList = eventPath.get(); - readParams.mEventPathParamsListSize = 1; - readParams.mKeepSubscriptions = true; - readParams.mIsFabricFiltered = false; - - // Subscribe with data version filter list from our cache. - size_t dataVersionFilterListSize = 0; - DataVersionFilter * dataVersionFilterList; - [self _createDataVersionFilterListFromDictionary:[self _getCachedDataVersions] dataVersionFilterList:&dataVersionFilterList count:&dataVersionFilterListSize]; - - readParams.mDataVersionFilterListSize = dataVersionFilterListSize; - readParams.mpDataVersionFilterList = dataVersionFilterList; - attributePath.release(); - eventPath.release(); - - // TODO: Change from local filter list generation to rehydrating ClusterStateCache to take advantage of existing filter list sorting algorithm - - // SendAutoResubscribeRequest cleans up the params, even on failure. - CHIP_ERROR err = readClient->SendAutoResubscribeRequest(std::move(readParams)); - if (err != CHIP_NO_ERROR) { - NSError * error = [MTRError errorForCHIPErrorCode:err logContext:self]; - MTR_LOG_ERROR("%@ SendAutoResubscribeRequest error %@", self, error); - dispatch_async(self.queue, ^{ - [self _handleSubscriptionError:error]; - [self _handleSubscriptionReset:nil]; - }); - - return; - } - - MTR_LOG("%@ Subscribe with data version list size %lu", self, static_cast(dataVersionFilterListSize)); - - // Callback and ClusterStateCache and ReadClient will be deleted - // when OnDone is called. - os_unfair_lock_lock(&self->_lock); - self->_currentReadClient = readClient.get(); - self->_currentSubscriptionCallback = callback.get(); - os_unfair_lock_unlock(&self->_lock); - callback->AdoptReadClient(std::move(readClient)); - callback->AdoptClusterStateCache(std::move(clusterStateCache)); - callback.release(); - }]; - - // Set up connectivity monitoring in case network becomes routable after any part of the subscription process goes into backoff retries. - [self _setupConnectivityMonitoring]; -} - #ifdef DEBUG - (NSUInteger)unitTestAttributesReportedSinceLastCheck { - NSUInteger attributesReportedSinceLastCheck = _unitTestAttributesReportedSinceLastCheck; - _unitTestAttributesReportedSinceLastCheck = 0; - return attributesReportedSinceLastCheck; + return 0; } - (NSUInteger)unitTestNonnullDelegateCount @@ -3472,13 +2613,6 @@ - (void)_pruneEndpointsIn:(MTRDeviceDataValueDictionary)previousPartsListValue } [self _removeClusters:clusterPathsToRemove doRemoveFromDataStore:NO]; [self.deviceController.controllerDataStore clearStoredClusterDataForNodeID:self.nodeID endpointID:endpoint]; - - [_deviceController asyncDispatchToMatterQueue:^{ - std::lock_guard lock(self->_lock); - if (self->_currentSubscriptionCallback) { - self->_currentSubscriptionCallback->ClearCachedAttributeState(static_cast(endpoint.unsignedLongLongValue)); - } - } errorHandler:nil]; } } @@ -3499,17 +2633,6 @@ - (void)_pruneClustersIn:(MTRDeviceDataValueDictionary)previousServerListValue } } [self _removeClusters:clusterPathsToRemove doRemoveFromDataStore:YES]; - - [_deviceController asyncDispatchToMatterQueue:^{ - std::lock_guard lock(self->_lock); - if (self->_currentSubscriptionCallback) { - for (NSNumber * cluster in toBeRemovedClusters) { - ConcreteClusterPath clusterPath(static_cast(endpointID.unsignedLongLongValue), - static_cast(cluster.unsignedLongLongValue)); - self->_currentSubscriptionCallback->ClearCachedAttributeState(clusterPath); - } - } - } errorHandler:nil]; } - (void)_pruneAttributesIn:(MTRDeviceDataValueDictionary)previousAttributeListValue @@ -3523,18 +2646,6 @@ - (void)_pruneAttributesIn:(MTRDeviceDataValueDictionary)previousAttributeListVa [toBeRemovedAttributes minusSet:attributesStillInCluster]; [self _removeAttributes:toBeRemovedAttributes fromCluster:clusterPath]; - - [_deviceController asyncDispatchToMatterQueue:^{ - std::lock_guard lock(self->_lock); - if (self->_currentSubscriptionCallback) { - for (NSNumber * attribute in toBeRemovedAttributes) { - ConcreteAttributePath attributePath(static_cast(clusterPath.endpoint.unsignedLongLongValue), - static_cast(clusterPath.cluster.unsignedLongLongValue), - static_cast(attribute.unsignedLongLongValue)); - self->_currentSubscriptionCallback->ClearCachedAttributeState(attributePath); - } - } - } errorHandler:nil]; } - (void)_pruneStoredDataForPath:(MTRAttributePath *)attributePath @@ -3769,25 +2880,6 @@ - (void)setPersistedDeviceData:(NSDictionary *)data } } -- (void)_storePersistedDeviceData -{ - os_unfair_lock_assert_owner(&self->_lock); - - auto datastore = _deviceController.controllerDataStore; - if (datastore == nil) { - // No way to store. - return; - } - - // For now the only data we have is our initial subscribe latency. - NSMutableDictionary * data = [NSMutableDictionary dictionary]; - if (_estimatedSubscriptionLatency != nil) { - data[sLastInitialSubscribeLatencyKey] = _estimatedSubscriptionLatency; - } - - [datastore storeDeviceData:[data copy] forNodeID:self.nodeID]; -} - #ifdef DEBUG - (MTRDeviceClusterData *)unitTestGetClusterDataForPath:(MTRClusterPath *)path { @@ -4215,20 +3307,11 @@ @implementation MTRDevice (MatterPrivateForInternalDragonsDoNotFeed) - (BOOL)_deviceHasActiveSubscription { - std::lock_guard lock(_lock); - - // TODO: This should always return YES for thread devices - return HaveSubscriptionEstablishedRightNow(_internalDeviceState); + return NO; } - (void)_deviceMayBeReachable { - MTR_LOG("%@ _deviceMayBeReachable called", self); - // TODO: This should only be allowed for thread devices - [_deviceController asyncDispatchToMatterQueue:^{ - [self _triggerResubscribeWithReason:@"SPI client indicated the device may now be reachable" - nodeLikelyReachable:YES]; - } errorHandler:nil]; } /* END DRAGONS */ @@ -4264,122 +3347,3 @@ - (void)invokeCommandWithEndpointID:(NSNumber *)endpointID } @end - -#pragma mark - SubscriptionCallback -namespace { -void SubscriptionCallback::OnEventData(const EventHeader & aEventHeader, TLV::TLVReader * apData, const StatusIB * apStatus) -{ - if (mEventReports == nil) { - // Never got a OnReportBegin? Not much to do other than tear things down. - ReportError(CHIP_ERROR_INCORRECT_STATE); - return; - } - - MTREventPath * eventPath = [[MTREventPath alloc] initWithPath:aEventHeader.mPath]; - if (apStatus != nullptr) { - [mEventReports addObject:@ { MTREventPathKey : eventPath, MTRErrorKey : [MTRError errorForIMStatus:*apStatus] }]; - } else if (apData == nullptr) { - [mEventReports addObject:@ { - MTREventPathKey : eventPath, - MTRErrorKey : [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT] - }]; - } else { - id value = MTRDecodeDataValueDictionaryFromCHIPTLV(apData); - if (value == nil) { - MTR_LOG_ERROR("Failed to decode event data for path %@", eventPath); - [mEventReports addObject:@ { - MTREventPathKey : eventPath, - MTRErrorKey : [MTRError errorForCHIPErrorCode:CHIP_ERROR_DECODE_FAILED], - }]; - } else { - [mEventReports addObject:[MTRBaseDevice eventReportForHeader:aEventHeader andData:value]]; - } - } - - QueueInterimReport(); -} - -void SubscriptionCallback::OnAttributeData( - const ConcreteDataAttributePath & aPath, TLV::TLVReader * apData, const StatusIB & aStatus) -{ - if (aPath.IsListItemOperation()) { - ReportError(CHIP_ERROR_INCORRECT_STATE); - return; - } - - if (mAttributeReports == nil) { - // Never got a OnReportBegin? Not much to do other than tear things down. - ReportError(CHIP_ERROR_INCORRECT_STATE); - return; - } - - MTRAttributePath * attributePath = [[MTRAttributePath alloc] initWithPath:aPath]; - if (aStatus.mStatus != Status::Success) { - [mAttributeReports addObject:@ { MTRAttributePathKey : attributePath, MTRErrorKey : [MTRError errorForIMStatus:aStatus] }]; - } else if (apData == nullptr) { - [mAttributeReports addObject:@ { - MTRAttributePathKey : attributePath, - MTRErrorKey : [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT] - }]; - } else { - NSNumber * dataVersionNumber = aPath.mDataVersion.HasValue() ? @(aPath.mDataVersion.Value()) : nil; - NSDictionary * value = MTRDecodeDataValueDictionaryFromCHIPTLV(apData, dataVersionNumber); - if (value == nil) { - MTR_LOG_ERROR("Failed to decode attribute data for path %@", attributePath); - [mAttributeReports addObject:@ { - MTRAttributePathKey : attributePath, - MTRErrorKey : [MTRError errorForCHIPErrorCode:CHIP_ERROR_DECODE_FAILED], - }]; - } else { - [mAttributeReports addObject:@ { MTRAttributePathKey : attributePath, MTRDataKey : value }]; - } - } - - QueueInterimReport(); -} - -uint32_t SubscriptionCallback::ComputeTimeTillNextSubscription() -{ - uint32_t maxWaitTimeInMsec = 0; - uint32_t waitTimeInMsec = 0; - uint32_t minWaitTimeInMsec = 0; - - if (mResubscriptionNumRetries <= CHIP_RESUBSCRIBE_MAX_FIBONACCI_STEP_INDEX) { - maxWaitTimeInMsec = GetFibonacciForIndex(mResubscriptionNumRetries) * CHIP_RESUBSCRIBE_WAIT_TIME_MULTIPLIER_MS; - } else { - maxWaitTimeInMsec = CHIP_RESUBSCRIBE_MAX_RETRY_WAIT_INTERVAL_MS; - } - - if (maxWaitTimeInMsec != 0) { - minWaitTimeInMsec = (CHIP_RESUBSCRIBE_MIN_WAIT_TIME_INTERVAL_PERCENT_PER_STEP * maxWaitTimeInMsec) / 100; - waitTimeInMsec = minWaitTimeInMsec + (Crypto::GetRandU32() % (maxWaitTimeInMsec - minWaitTimeInMsec)); - } - - return waitTimeInMsec; -} - -CHIP_ERROR SubscriptionCallback::OnResubscriptionNeeded(ReadClient * apReadClient, CHIP_ERROR aTerminationCause) -{ - // No need to check ReadClient internal state is Idle because ReadClient only calls OnResubscriptionNeeded after calling ClearActiveSubscriptionState(), which sets the state to Idle. - - // This part is copied from ReadClient's DefaultResubscribePolicy: - auto timeTillNextResubscriptionMs = ComputeTimeTillNextSubscription(); - ChipLogProgress(DataManagement, - "Will try to resubscribe to %02x:" ChipLogFormatX64 " at retry index %" PRIu32 " after %" PRIu32 - "ms due to error %" CHIP_ERROR_FORMAT, - apReadClient->GetFabricIndex(), ChipLogValueX64(apReadClient->GetPeerNodeId()), mResubscriptionNumRetries, timeTillNextResubscriptionMs, - aTerminationCause.Format()); - - // Schedule a maximum time resubscription, to be triggered with TriggerResubscribeIfScheduled after a separate timer. - // This way the aReestablishCASE value is saved, and the sanity checks in ScheduleResubscription are observed and returned. - ReturnErrorOnFailure(apReadClient->ScheduleResubscription(UINT32_MAX, NullOptional, aTerminationCause == CHIP_ERROR_TIMEOUT)); - - // Not as good a place to increment as when resubscription timer fires, but as is, this should be as good, because OnResubscriptionNeeded is only called from ReadClient's Close() while Idle, and nothing should cause this to happen - mResubscriptionNumRetries++; - - auto error = [MTRError errorForCHIPErrorCode:aTerminationCause]; - CallResubscriptionScheduledHandler(error, @(timeTillNextResubscriptionMs)); - - return CHIP_NO_ERROR; -} -} // anonymous namespace From 72ee6eb2973c3b5aecb17e7b92dc90780ec6bf11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Tomkiel?= Date: Thu, 22 Aug 2024 08:51:25 +0200 Subject: [PATCH 51/52] Enhance chip-tool's formatting for some IDs (#35088) * Added logging functions * Modify ZAP template file generation * Updated files for CommandId support * Updated manual tests for the new formatting * Fixed variable name shadowing * Fixed typo * Added logging functions to fabric admin * Restyled by whitespace * Restyled by clang-format * Fixed linking * Fixed typo * Fixed CommandId logging * Updated ZAP generated files * Restyled by clang-format --------- Co-authored-by: Restyled.io --- examples/chip-tool/BUILD.gn | 1 + .../commands/clusters/DataModelLogger.h | 95 + .../logging/DataModelLogger-src.zapt | 12 + .../templates/logging/EntryToText-src.zapt | 84 + .../templates/logging/EntryToText.zapt | 13 + examples/chip-tool/templates/templates.json | 10 + .../commands/clusters/DataModelLogger.h | 95 + .../tv-casting-app/tv-casting-common/BUILD.gn | 1 + .../suites/certification/Test_TC_DEM_1_1.yaml | 54 +- .../certification/Test_TC_DESC_2_1.yaml | 178 +- .../suites/certification/Test_TC_IDM_2_2.yaml | 424 +- .../certification/Test_TC_WAKEONLAN_4_1.yaml | 8 +- .../cluster/logging/DataModelLogger.cpp | 773 +- .../cluster/logging/EntryToText.cpp | 6700 +++++++++++++++++ .../cluster/logging/EntryToText.h | 30 + 15 files changed, 7765 insertions(+), 713 deletions(-) create mode 100644 examples/chip-tool/templates/logging/EntryToText-src.zapt create mode 100644 examples/chip-tool/templates/logging/EntryToText.zapt create mode 100644 zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp create mode 100644 zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.h diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn index 94e1eebbde7508..acacbc70e8bfad 100644 --- a/examples/chip-tool/BUILD.gn +++ b/examples/chip-tool/BUILD.gn @@ -53,6 +53,7 @@ static_library("chip-tool-utils") { "${chip_root}/src/controller/ExamplePersistentStorage.h", "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp", "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp", + "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp", "commands/clusters/ModelCommand.cpp", "commands/clusters/ModelCommand.h", "commands/common/BDXDiagnosticLogsServerDelegate.cpp", diff --git a/examples/chip-tool/commands/clusters/DataModelLogger.h b/examples/chip-tool/commands/clusters/DataModelLogger.h index 1d9d1e1ccd6955..7186b833ff5153 100644 --- a/examples/chip-tool/commands/clusters/DataModelLogger.h +++ b/examples/chip-tool/commands/clusters/DataModelLogger.h @@ -28,6 +28,7 @@ #include #include #include +#include class DataModelLogger { @@ -157,6 +158,100 @@ class DataModelLogger return CHIP_NO_ERROR; } + static CHIP_ERROR LogClusterId(const char * label, size_t indent, + const chip::app::DataModel::DecodableList & value) + { + size_t count = 0; + ReturnErrorOnFailure(value.ComputeSize(&count)); + DataModelLogger::LogString(label, indent, std::to_string(count) + " entries"); + + auto iter = value.begin(); + size_t i = 0; + while (iter.Next()) + { + ++i; + std::string index = std::string("[") + std::to_string(i) + "]"; + std::string item = std::to_string(iter.GetValue()) + " (" + ClusterIdToText(iter.GetValue()) + ")"; + DataModelLogger::LogString(index, indent + 1, item); + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "List truncated due to invalid value"); + } + return iter.GetStatus(); + } + + static CHIP_ERROR LogAttributeId(const char * label, size_t indent, + const chip::app::DataModel::DecodableList & value, chip::ClusterId cluster) + { + size_t count = 0; + ReturnErrorOnFailure(value.ComputeSize(&count)); + DataModelLogger::LogString(label, indent, std::to_string(count) + " entries"); + + auto iter = value.begin(); + size_t i = 0; + while (iter.Next()) + { + ++i; + std::string index = std::string("[") + std::to_string(i) + "]"; + std::string item = std::to_string(iter.GetValue()) + " (" + AttributeIdToText(cluster, iter.GetValue()) + ")"; + DataModelLogger::LogString(index, indent + 1, item); + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "List truncated due to invalid value"); + } + return iter.GetStatus(); + } + + static CHIP_ERROR LogAcceptedCommandId(const char * label, size_t indent, + const chip::app::DataModel::DecodableList & value, + chip::ClusterId cluster) + { + size_t count = 0; + ReturnErrorOnFailure(value.ComputeSize(&count)); + DataModelLogger::LogString(label, indent, std::to_string(count) + " entries"); + + auto iter = value.begin(); + size_t i = 0; + while (iter.Next()) + { + ++i; + std::string index = std::string("[") + std::to_string(i) + "]"; + std::string item = std::to_string(iter.GetValue()) + " (" + AcceptedCommandIdToText(cluster, iter.GetValue()) + ")"; + DataModelLogger::LogString(index, indent + 1, item); + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "List truncated due to invalid value"); + } + return iter.GetStatus(); + } + + static CHIP_ERROR LogGeneratedCommandId(const char * label, size_t indent, + const chip::app::DataModel::DecodableList & value, + chip::ClusterId cluster) + { + size_t count = 0; + ReturnErrorOnFailure(value.ComputeSize(&count)); + DataModelLogger::LogString(label, indent, std::to_string(count) + " entries"); + + auto iter = value.begin(); + size_t i = 0; + while (iter.Next()) + { + ++i; + std::string index = std::string("[") + std::to_string(i) + "]"; + std::string item = std::to_string(iter.GetValue()) + " (" + GeneratedCommandIdToText(cluster, iter.GetValue()) + ")"; + DataModelLogger::LogString(index, indent + 1, item); + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "List truncated due to invalid value"); + } + return iter.GetStatus(); + } + #include static void LogString(size_t indent, const std::string string) { LogString("", indent, string); } diff --git a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt index 0f41ff2e16b96a..3f76143ffab36c 100644 --- a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt +++ b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt @@ -75,7 +75,19 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP { {{zapTypeToDecodableClusterObjectType type ns=parent.name forceNotOptional=true}} value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); +{{#if (isEqual name "ServerList")}} + return DataModelLogger::LogClusterId("{{name}}", 1, value); +{{else if (isEqual name "ClientList")}} + return DataModelLogger::LogClusterId("{{name}}", 1, value); +{{else if (isEqual name "AttributeList")}} + return DataModelLogger::LogAttributeId("{{name}}", 1, value, {{asUpperCamelCase parent.name}}::Id); +{{else if (isEqual name "AcceptedCommandList")}} + return DataModelLogger::LogAcceptedCommandId("{{name}}", 1, value, {{asUpperCamelCase parent.name}}::Id); +{{else if (isEqual name "GeneratedCommandList")}} + return DataModelLogger::LogGeneratedCommandId("{{name}}", 1, value, {{asUpperCamelCase parent.name}}::Id); +{{else}} return DataModelLogger::LogValue("{{name}}", 1, value); +{{/if}} } {{#last}} } diff --git a/examples/chip-tool/templates/logging/EntryToText-src.zapt b/examples/chip-tool/templates/logging/EntryToText-src.zapt new file mode 100644 index 00000000000000..646ee2ad872eaf --- /dev/null +++ b/examples/chip-tool/templates/logging/EntryToText-src.zapt @@ -0,0 +1,84 @@ +{{> header}} + +#include +#include +#include + +char const * ClusterIdToText(chip::ClusterId id) { + switch(id) + { +{{#zcl_clusters}} + case chip::app::Clusters::{{asUpperCamelCase name}}::Id: return "{{asUpperCamelCase name}}"; +{{/zcl_clusters}} + default: return "Unknown"; + } +} + +char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) { + switch(cluster) + { +{{#zcl_clusters}} +{{#zcl_attributes_server}} +{{#first}} + case chip::app::Clusters::{{asUpperCamelCase parent.name}}::Id: + { + switch(id) + { +{{/first}} + case chip::app::Clusters::{{asUpperCamelCase parent.name}}::Attributes::{{asUpperCamelCase name}}::Id: return "{{asUpperCamelCase name}}"; +{{#last}} + default: return "Unknown"; + } + } +{{/last}} +{{/zcl_attributes_server}} +{{/zcl_clusters}} + default: return "Unknown"; + } +} + +char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id) { + switch(cluster) + { +{{#zcl_clusters}} +{{#zcl_commands_source_client}} +{{#first}} + case chip::app::Clusters::{{asUpperCamelCase parent.name}}::Id: + { + switch(id) + { +{{/first}} + case chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::Id: return "{{asUpperCamelCase name}}"; +{{#last}} + default: return "Unknown"; + } + } +{{/last}} +{{/zcl_commands_source_client}} +{{/zcl_clusters}} + default: return "Unknown"; + } +} + +char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId id) { + switch(cluster) + { +{{#zcl_clusters}} +{{#zcl_commands_source_server}} +{{#first}} + case chip::app::Clusters::{{asUpperCamelCase parent.name}}::Id: + { + switch(id) + { +{{/first}} + case chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::Id: return "{{asUpperCamelCase name}}"; +{{#last}} + default: return "Unknown"; + } + } +{{/last}} +{{/zcl_commands_source_server}} +{{/zcl_clusters}} + default: return "Unknown"; + } +} \ No newline at end of file diff --git a/examples/chip-tool/templates/logging/EntryToText.zapt b/examples/chip-tool/templates/logging/EntryToText.zapt new file mode 100644 index 00000000000000..d1a78f84dc218c --- /dev/null +++ b/examples/chip-tool/templates/logging/EntryToText.zapt @@ -0,0 +1,13 @@ +{{> header}} + +#include +#include +#include + +char const * ClusterIdToText(chip::ClusterId id); + +char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id); + +char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id); + +char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId id); \ No newline at end of file diff --git a/examples/chip-tool/templates/templates.json b/examples/chip-tool/templates/templates.json index 528c7d266dcb97..9ced10b1372590 100644 --- a/examples/chip-tool/templates/templates.json +++ b/examples/chip-tool/templates/templates.json @@ -64,6 +64,16 @@ "path": "ComplexArgumentParser-src.zapt", "name": "Complex Argument Parser", "output": "cluster/ComplexArgumentParser.cpp" + }, + { + "path": "logging/EntryToText.zapt", + "name": "Entry To Text header", + "output": "cluster/logging/EntryToText.h" + }, + { + "path": "logging/EntryToText-src.zapt", + "name": "Entry To Text", + "output": "cluster/logging/EntryToText.cpp" } ] } diff --git a/examples/fabric-admin/commands/clusters/DataModelLogger.h b/examples/fabric-admin/commands/clusters/DataModelLogger.h index ee649755014906..36f53ba3811c24 100644 --- a/examples/fabric-admin/commands/clusters/DataModelLogger.h +++ b/examples/fabric-admin/commands/clusters/DataModelLogger.h @@ -28,6 +28,7 @@ #include #include #include +#include class DataModelLogger { @@ -157,6 +158,100 @@ class DataModelLogger return CHIP_NO_ERROR; } + static CHIP_ERROR LogClusterId(const char * label, size_t indent, + const chip::app::DataModel::DecodableList & value) + { + size_t count = 0; + ReturnErrorOnFailure(value.ComputeSize(&count)); + DataModelLogger::LogString(label, indent, std::to_string(count) + " entries"); + + auto iter = value.begin(); + size_t i = 0; + while (iter.Next()) + { + ++i; + std::string index = std::string("[") + std::to_string(i) + "]"; + std::string item = std::to_string(iter.GetValue()) + " (" + ClusterIdToText(iter.GetValue()) + ")"; + DataModelLogger::LogString(index, indent + 1, item); + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "List truncated due to invalid value"); + } + return iter.GetStatus(); + } + + static CHIP_ERROR LogAttributeId(const char * label, size_t indent, + const chip::app::DataModel::DecodableList & value, chip::ClusterId cluster) + { + size_t count = 0; + ReturnErrorOnFailure(value.ComputeSize(&count)); + DataModelLogger::LogString(label, indent, std::to_string(count) + " entries"); + + auto iter = value.begin(); + size_t i = 0; + while (iter.Next()) + { + ++i; + std::string index = std::string("[") + std::to_string(i) + "]"; + std::string item = std::to_string(iter.GetValue()) + " (" + AttributeIdToText(cluster, iter.GetValue()) + ")"; + DataModelLogger::LogString(index, indent + 1, item); + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "List truncated due to invalid value"); + } + return iter.GetStatus(); + } + + static CHIP_ERROR LogAcceptedCommandId(const char * label, size_t indent, + const chip::app::DataModel::DecodableList & value, + chip::ClusterId cluster) + { + size_t count = 0; + ReturnErrorOnFailure(value.ComputeSize(&count)); + DataModelLogger::LogString(label, indent, std::to_string(count) + " entries"); + + auto iter = value.begin(); + size_t i = 0; + while (iter.Next()) + { + ++i; + std::string index = std::string("[") + std::to_string(i) + "]"; + std::string item = std::to_string(iter.GetValue()) + " (" + AcceptedCommandIdToText(cluster, iter.GetValue()) + ")"; + DataModelLogger::LogString(index, indent + 1, item); + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "List truncated due to invalid value"); + } + return iter.GetStatus(); + } + + static CHIP_ERROR LogGeneratedCommandId(const char * label, size_t indent, + const chip::app::DataModel::DecodableList & value, + chip::ClusterId cluster) + { + size_t count = 0; + ReturnErrorOnFailure(value.ComputeSize(&count)); + DataModelLogger::LogString(label, indent, std::to_string(count) + " entries"); + + auto iter = value.begin(); + size_t i = 0; + while (iter.Next()) + { + ++i; + std::string index = std::string("[") + std::to_string(i) + "]"; + std::string item = std::to_string(iter.GetValue()) + " (" + GeneratedCommandIdToText(cluster, iter.GetValue()) + ")"; + DataModelLogger::LogString(index, indent + 1, item); + } + if (iter.GetStatus() != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "List truncated due to invalid value"); + } + return iter.GetStatus(); + } + #include static void LogString(size_t indent, const std::string string) { LogString("", indent, string); } diff --git a/examples/tv-casting-app/tv-casting-common/BUILD.gn b/examples/tv-casting-app/tv-casting-common/BUILD.gn index ee422e1b063db9..2c30080f027ee5 100644 --- a/examples/tv-casting-app/tv-casting-common/BUILD.gn +++ b/examples/tv-casting-app/tv-casting-common/BUILD.gn @@ -50,6 +50,7 @@ chip_data_model("tv-casting-common") { "${chip_root}/src/controller/ExamplePersistentStorage.h", "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp", "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp", + "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp", "clusters/content-app-observer/ContentAppObserver.cpp", "clusters/content-app-observer/ContentAppObserver.h", "commands/clusters/ModelCommand.cpp", diff --git a/src/app/tests/suites/certification/Test_TC_DEM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DEM_1_1.yaml index 4d1a72392ab435..e69e5a62b0a820 100644 --- a/src/app/tests/suites/certification/Test_TC_DEM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DEM_1_1.yaml @@ -62,21 +62,21 @@ tests: - Based on feature support:- 0x0005, 0x0006, 0x0007 Below mentioned log is based on the RPI implementation, Value may vary on real DUT - [1705649142.831039][6212:6214] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0098 Attribute 0x0000_FFFB DataVersion: 633673396 - [1705649142.831110][6212:6214] CHIP:TOO: AttributeList: 13 entries - [1705649142.831151][6212:6214] CHIP:TOO: [1]: 0 - [1705649142.831174][6212:6214] CHIP:TOO: [2]: 1 - [1705649142.831208][6212:6214] CHIP:TOO: [3]: 2 - [1705649142.831230][6212:6214] CHIP:TOO: [4]: 3 - [1705649142.831261][6212:6214] CHIP:TOO: [5]: 4 - [1705649142.831283][6212:6214] CHIP:TOO: [6]: 5 - [1705649142.831304][6212:6214] CHIP:TOO: [7]: 6 - [1705649142.831336][6212:6214] CHIP:TOO: [8]: 7 - [1705649142.831359][6212:6214] CHIP:TOO: [9]: 65528 - [1705649142.831390][6212:6214] CHIP:TOO: [10]: 65529 - [1705649142.831434][6212:6214] CHIP:TOO: [11]: 65531 - [1705649142.831458][6212:6214] CHIP:TOO: [12]: 65532 - [1705649142.831490][6212:6214] CHIP:TOO: [13]: 65533 + [1723642027.628] [328171:328173] [TOO] Endpoint: 1 Cluster: 0x0000_0098 Attribute 0x0000_FFFB DataVersion: 3122179410 + [1723642027.628] [328171:328173] [TOO] AttributeList: 13 entries + [1723642027.628] [328171:328173] [TOO] [1]: 0 (ESAType) + [1723642027.628] [328171:328173] [TOO] [2]: 1 (ESACanGenerate) + [1723642027.628] [328171:328173] [TOO] [3]: 2 (ESAState) + [1723642027.628] [328171:328173] [TOO] [4]: 3 (AbsMinPower) + [1723642027.628] [328171:328173] [TOO] [5]: 4 (AbsMaxPower) + [1723642027.628] [328171:328173] [TOO] [6]: 5 (PowerAdjustmentCapability) + [1723642027.628] [328171:328173] [TOO] [7]: 6 (Forecast) + [1723642027.628] [328171:328173] [TOO] [8]: 7 (OptOutState) + [1723642027.628] [328171:328173] [TOO] [9]: 65528 (GeneratedCommandList) + [1723642027.628] [328171:328173] [TOO] [10]: 65529 (AcceptedCommandList) + [1723642027.628] [328171:328173] [TOO] [11]: 65531 (AttributeList) + [1723642027.628] [328171:328173] [TOO] [12]: 65532 (FeatureMap) + [1723642027.628] [328171:328173] [TOO] [13]: 65533 (ClusterRevision) disabled: true - label: "Step 5*: TH reads from the DUT the EventList attribute." @@ -100,16 +100,16 @@ tests: On TH(chip-tool), Verify the AcceptedCommandList attribute that contains 7 entries: Below mentioned log is based on the RPI implementation, Value may vary on real DUT - [1705649342.947638][6221:6223] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0098 Attribute 0x0000_FFF9 DataVersion: 633673396 - [1705649342.947712][6221:6223] CHIP:TOO: AcceptedCommandList: 8 entries - [1705649342.947754][6221:6223] CHIP:TOO: [1]: 0 - [1705649342.947779][6221:6223] CHIP:TOO: [2]: 1 - [1705649342.947802][6221:6223] CHIP:TOO: [3]: 2 - [1705649342.947825][6221:6223] CHIP:TOO: [4]: 3 - [1705649342.947848][6221:6223] CHIP:TOO: [5]: 4 - [1705649342.947871][6221:6223] CHIP:TOO: [6]: 5 - [1705649342.947894][6221:6223] CHIP:TOO: [7]: 6 - [1705649342.947917][6221:6223] CHIP:TOO: [8]: 7 + [1705649342.947638][6221:6223] [TOO] Endpoint: 1 Cluster: 0x0000_0098 Attribute 0x0000_FFF9 DataVersion: 633673396 + [1705649342.947712][6221:6223] [TOO] AcceptedCommandList: 8 entries + [1705649342.947754][6221:6223] [TOO] [1]: 0 (PowerAdjustRequest) + [1705649342.947779][6221:6223] [TOO] [2]: 1 (CancelPowerAdjustRequest) + [1705649342.947802][6221:6223] [TOO] [3]: 2 (StartTimeAdjustRequest) + [1705649342.947825][6221:6223] [TOO] [4]: 3 (PauseRequest) + [1705649342.947848][6221:6223] [TOO] [5]: 4 (ResumeRequest) + [1705649342.947871][6221:6223] [TOO] [6]: 5 (ModifyForecastRequest) + [1705649342.947894][6221:6223] [TOO] [7]: 6 (RequestConstraintBasedForecast) + [1705649342.947917][6221:6223] [TOO] [8]: 7 (CancelRequest) disabled: true - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." @@ -118,6 +118,6 @@ tests: On TH(chip-tool), Verify the GeneratedCommandList attribute that contains 1 entries: - [1705567897.076935][7141:7143] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0098 Attribute 0x0000_FFF8 DataVersion: 1117764527 - [1705567897.076989][7141:7143] CHIP:TOO: GeneratedCommandList: 0 entries + [1705567897.076935][7141:7143] [TOO] Endpoint: 1 Cluster: 0x0000_0098 Attribute 0x0000_FFF8 DataVersion: 1117764527 + [1705567897.076989][7141:7143] [TOO] GeneratedCommandList: 0 entries disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml index 2ce0e296bbc2d5..2afe448fa99f30 100644 --- a/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml @@ -142,95 +142,95 @@ tests: Verify ServerList entries on the TH (Chip-tool) and below is the sample log provided for the raspi platform, - [1707996554.409850][20755:20757] CHIP:DMG: } - [1707996554.410814][20755:20757] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 3583190746 - [1707996554.410955][20755:20757] CHIP:TOO: ServerList: 71 entries - [1707996554.410990][20755:20757] CHIP:TOO: [1]: 3 - [1707996554.411002][20755:20757] CHIP:TOO: [2]: 4 - [1707996554.411013][20755:20757] CHIP:TOO: [3]: 6 - [1707996554.411024][20755:20757] CHIP:TOO: [4]: 7 - [1707996554.411034][20755:20757] CHIP:TOO: [5]: 8 - [1707996554.411045][20755:20757] CHIP:TOO: [6]: 15 - [1707996554.411056][20755:20757] CHIP:TOO: [7]: 29 - [1707996554.411067][20755:20757] CHIP:TOO: [8]: 30 - [1707996554.411078][20755:20757] CHIP:TOO: [9]: 37 - [1707996554.411092][20755:20757] CHIP:TOO: [10]: 47 - [1707996554.411103][20755:20757] CHIP:TOO: [11]: 59 - [1707996554.411113][20755:20757] CHIP:TOO: [12]: 64 - [1707996554.411124][20755:20757] CHIP:TOO: [13]: 65 - [1707996554.411135][20755:20757] CHIP:TOO: [14]: 69 - [1707996554.411146][20755:20757] CHIP:TOO: [15]: 72 - [1707996554.411156][20755:20757] CHIP:TOO: [16]: 73 - [1707996554.411167][20755:20757] CHIP:TOO: [17]: 74 - [1707996554.411177][20755:20757] CHIP:TOO: [18]: 80 - [1707996554.411188][20755:20757] CHIP:TOO: [19]: 81 - [1707996554.411199][20755:20757] CHIP:TOO: [20]: 82 - [1707996554.411209][20755:20757] CHIP:TOO: [21]: 83 - [1707996554.411220][20755:20757] CHIP:TOO: [22]: 84 - [1707996554.411231][20755:20757] CHIP:TOO: [23]: 85 - [1707996554.411240][20755:20757] CHIP:TOO: [24]: 86 - [1707996554.411251][20755:20757] CHIP:TOO: [25]: 87 - [1707996554.411261][20755:20757] CHIP:TOO: [26]: 89 - [1707996554.411271][20755:20757] CHIP:TOO: [27]: 91 - [1707996554.411282][20755:20757] CHIP:TOO: [28]: 92 - [1707996554.411293][20755:20757] CHIP:TOO: [29]: 93 - [1707996554.411303][20755:20757] CHIP:TOO: [30]: 94 - [1707996554.411313][20755:20757] CHIP:TOO: [31]: 96 - [1707996554.411323][20755:20757] CHIP:TOO: [32]: 97 - [1707996554.411334][20755:20757] CHIP:TOO: [33]: 98 - [1707996554.411345][20755:20757] CHIP:TOO: [34]: 113 - [1707996554.411355][20755:20757] CHIP:TOO: [35]: 114 - [1707996554.411367][20755:20757] CHIP:TOO: [36]: 128 - [1707996554.411376][20755:20757] CHIP:TOO: [37]: 129 - [1707996554.411387][20755:20757] CHIP:TOO: [38]: 144 - [1707996554.411396][20755:20757] CHIP:TOO: [39]: 145 - [1707996554.411406][20755:20757] CHIP:TOO: [40]: 152 - [1707996554.411417][20755:20757] CHIP:TOO: [41]: 153 - [1707996554.411427][20755:20757] CHIP:TOO: [42]: 157 - [1707996554.411437][20755:20757] CHIP:TOO: [43]: 159 - [1707996554.411449][20755:20757] CHIP:TOO: [44]: 258 - [1707996554.411459][20755:20757] CHIP:TOO: [45]: 259 - [1707996554.411469][20755:20757] CHIP:TOO: [46]: 512 - [1707996554.411480][20755:20757] CHIP:TOO: [47]: 513 - [1707996554.411490][20755:20757] CHIP:TOO: [48]: 514 - [1707996554.411500][20755:20757] CHIP:TOO: [49]: 516 - [1707996554.411511][20755:20757] CHIP:TOO: [50]: 768 - [1707996554.411521][20755:20757] CHIP:TOO: [51]: 769 - [1707996554.411532][20755:20757] CHIP:TOO: [52]: 1024 - [1707996554.411559][20755:20757] CHIP:TOO: [53]: 1026 - [1707996554.411562][20755:20757] CHIP:TOO: [54]: 1027 - [1707996554.411565][20755:20757] CHIP:TOO: [55]: 1028 - [1707996554.411568][20755:20757] CHIP:TOO: [56]: 1029 - [1707996554.411571][20755:20757] CHIP:TOO: [57]: 1030 - [1707996554.411575][20755:20757] CHIP:TOO: [58]: 1036 - [1707996554.411578][20755:20757] CHIP:TOO: [59]: 1037 - [1707996554.411581][20755:20757] CHIP:TOO: [60]: 1043 - [1707996554.411584][20755:20757] CHIP:TOO: [61]: 1045 - [1707996554.411587][20755:20757] CHIP:TOO: [62]: 1066 - [1707996554.411589][20755:20757] CHIP:TOO: [63]: 1067 - [1707996554.411592][20755:20757] CHIP:TOO: [64]: 1068 - [1707996554.411595][20755:20757] CHIP:TOO: [65]: 1069 - [1707996554.411598][20755:20757] CHIP:TOO: [66]: 1070 - [1707996554.411601][20755:20757] CHIP:TOO: [67]: 1071 - [1707996554.411604][20755:20757] CHIP:TOO: [68]: 1283 - [1707996554.411607][20755:20757] CHIP:TOO: [69]: 1288 - [1707996554.411610][20755:20757] CHIP:TOO: [70]: 2820 - [1707996554.411613][20755:20757] CHIP:TOO: [71]: 4294048773 + [1707996554.409850][20755:20757] [DMG] } + [1707996554.410814][20755:20757] [TOO] Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 3583190746 + [1707996554.410955][20755:20757] [TOO] ServerList: 71 entries + [1707996554.410990][20755:20757] [TOO] [1]: 3 (Identify) + [1707996554.411002][20755:20757] [TOO] [2]: 4 (Groups) + [1707996554.411013][20755:20757] [TOO] [3]: 6 (OnOff) + [1707996554.411024][20755:20757] [TOO] [4]: 7 (OnOffSwitchConfiguration) + [1707996554.411034][20755:20757] [TOO] [5]: 8 (LevelControl) + [1707996554.411045][20755:20757] [TOO] [6]: 15 (BinaryInputBasic) + [1707996554.411056][20755:20757] [TOO] [7]: 29 (Descriptor) + [1707996554.411067][20755:20757] [TOO] [8]: 30 (Binding) + [1707996554.411078][20755:20757] [TOO] [9]: 37 (Actions) + [1707996554.411092][20755:20757] [TOO] [10]: 47 (PowerSource) + [1707996554.411103][20755:20757] [TOO] [11]: 59 (Switch) + [1707996554.411113][20755:20757] [TOO] [12]: 64 (FixedLabel) + [1707996554.411124][20755:20757] [TOO] [13]: 65 (UserLabel) + [1707996554.411135][20755:20757] [TOO] [14]: 69 (BooleanState) + [1707996554.411146][20755:20757] [TOO] [15]: 72 (OvenCavityOperationalState) + [1707996554.411156][20755:20757] [TOO] [16]: 73 (OvenMode) + [1707996554.411167][20755:20757] [TOO] [17]: 74 (LaundryDryerControls) + [1707996554.411177][20755:20757] [TOO] [18]: 80 (ModeSelect) + [1707996554.411188][20755:20757] [TOO] [19]: 81 (LaundryWasherMode) + [1707996554.411199][20755:20757] [TOO] [20]: 82 (RefrigeratorAndTemperatureControlledCabinetMode) + [1707996554.411209][20755:20757] [TOO] [21]: 83 (LaundryWasherControls) + [1707996554.411220][20755:20757] [TOO] [22]: 84 (RvcRunMode) + [1707996554.411231][20755:20757] [TOO] [23]: 85 (RvcCleanMode) + [1707996554.411240][20755:20757] [TOO] [24]: 86 (TemperatureControl) + [1707996554.411251][20755:20757] [TOO] [25]: 87 (RefrigeratorAlarm) + [1707996554.411261][20755:20757] [TOO] [26]: 89 (DishwasherMode) + [1707996554.411271][20755:20757] [TOO] [27]: 91 (AirQuality) + [1707996554.411282][20755:20757] [TOO] [28]: 92 (SmokeCoAlarm) + [1707996554.411293][20755:20757] [TOO] [29]: 93 (DishwasherAlarm) + [1707996554.411303][20755:20757] [TOO] [30]: 94 (MicrowaveOvenMode) + [1707996554.411313][20755:20757] [TOO] [31]: 96 (OperationalState) + [1707996554.411323][20755:20757] [TOO] [32]: 97 (RvcOperationalState) + [1707996554.411334][20755:20757] [TOO] [33]: 98 (ScenesManagement) + [1707996554.411345][20755:20757] [TOO] [34]: 113 (HepaFilterMonitoring) + [1707996554.411355][20755:20757] [TOO] [35]: 114 (ActivatedCarbonFilterMonitoring) + [1707996554.411367][20755:20757] [TOO] [36]: 128 (BooleanStateConfiguration) + [1707996554.411376][20755:20757] [TOO] [37]: 129 (ValveConfigurationAndControl) + [1707996554.411387][20755:20757] [TOO] [38]: 144 (ElectricalPowerMeasurement) + [1707996554.411396][20755:20757] [TOO] [39]: 145 (ElectricalEnergyMeasurement) + [1707996554.411406][20755:20757] [TOO] [40]: 152 (DeviceEnergyManagement) + [1707996554.411417][20755:20757] [TOO] [41]: 153 (EnergyEvse) + [1707996554.411427][20755:20757] [TOO] [42]: 157 (EnergyEvseMode) + [1707996554.411437][20755:20757] [TOO] [43]: 159 (DeviceEnergyManagementMode) + [1707996554.411449][20755:20757] [TOO] [44]: 258 (WindowCovering) + [1707996554.411459][20755:20757] [TOO] [45]: 259 (BarrierControl) + [1707996554.411469][20755:20757] [TOO] [46]: 512 (PumpConfigurationAndControl) + [1707996554.411480][20755:20757] [TOO] [47]: 513 (Thermostat) + [1707996554.411490][20755:20757] [TOO] [48]: 514 (FanControl) + [1707996554.411500][20755:20757] [TOO] [49]: 516 (ThermostatUserInterfaceConfiguration) + [1707996554.411511][20755:20757] [TOO] [50]: 768 (ColorControl) + [1707996554.411521][20755:20757] [TOO] [51]: 769 (BallastConfiguration) + [1707996554.411532][20755:20757] [TOO] [52]: 1024 (IlluminanceMeasurement) + [1707996554.411559][20755:20757] [TOO] [53]: 1026 (TemperatureMeasurement) + [1707996554.411562][20755:20757] [TOO] [54]: 1027 (PressureMeasurement) + [1707996554.411565][20755:20757] [TOO] [55]: 1028 (FlowMeasurement) + [1707996554.411568][20755:20757] [TOO] [56]: 1029 (RelativeHumidityMeasurement) + [1707996554.411571][20755:20757] [TOO] [57]: 1030 (OccupancySensing) + [1707996554.411575][20755:20757] [TOO] [58]: 1036 (CarbonMonoxideConcentrationMeasurement) + [1707996554.411578][20755:20757] [TOO] [59]: 1037 (CarbonDioxideConcentrationMeasurement) + [1707996554.411581][20755:20757] [TOO] [60]: 1043 (NitrogenDioxideConcentrationMeasurement) + [1707996554.411584][20755:20757] [TOO] [61]: 1045 (OzoneConcentrationMeasurement) + [1707996554.411587][20755:20757] [TOO] [62]: 1066 (Pm25ConcentrationMeasurement) + [1707996554.411589][20755:20757] [TOO] [63]: 1067 (FormaldehydeConcentrationMeasurement) + [1707996554.411592][20755:20757] [TOO] [64]: 1068 (Pm1ConcentrationMeasurement) + [1707996554.411595][20755:20757] [TOO] [65]: 1069 (Pm10ConcentrationMeasurement) + [1707996554.411598][20755:20757] [TOO] [66]: 1070 (TotalVolatileOrganicCompoundsConcentrationMeasurement) + [1707996554.411601][20755:20757] [TOO] [67]: 1071 (RadonConcentrationMeasurement) + [1707996554.411604][20755:20757] [TOO] [68]: 1283 (WakeOnLan) + [1707996554.411607][20755:20757] [TOO] [69]: 1288 (LowPower) + [1707996554.411610][20755:20757] [TOO] [70]: 2820 (ElectricalMeasurement) + [1707996554.411613][20755:20757] [TOO] [71]: 4294048773 (UnitTesting) ./chip-tool descriptor read server-list 1 2 Verify ServerList entries on TH (Chip-tool) Log and below is the sample log provided for the raspi platform, Here ServerList entries are 7. - [1692618559.962829][31688:31690] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 1103199808 - [1692618559.962884][31688:31690] CHIP:TOO: ServerList: 7 entries - [1692618559.962910][31688:31690] CHIP:TOO: [1]: 3 - [1692618559.962922][31688:31690] CHIP:TOO: [2]: 4 - [1692618559.962933][31688:31690] CHIP:TOO: [3]: 5 - [1692618559.962945][31688:31690] CHIP:TOO: [4]: 6 - [1692618559.962955][31688:31690] CHIP:TOO: [5]: 29 - [1692618559.962966][31688:31690] CHIP:TOO: [6]: 47 - [1692618559.962978][31688:31690] CHIP:TOO: [7]: 1030 + [1692618559.962829][31688:31690] [TOO] Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 1103199808 + [1692618559.962884][31688:31690] [TOO] ServerList: 7 entries + [1692618559.962910][31688:31690] [TOO] [1]: 3 (Identify) + [1692618559.962922][31688:31690] [TOO] [2]: 4 (Groups) + [1692618559.962933][31688:31690] [TOO] [3]: 5 (Unknown) + [1692618559.962945][31688:31690] [TOO] [4]: 6 (OnOff) + [1692618559.962955][31688:31690] [TOO] [5]: 29 (Descriptor) + [1692618559.962966][31688:31690] [TOO] [6]: 47 (PowerSource) + [1692618559.962978][31688:31690] [TOO] [7]: 1030 (OccupancySensing) disabled: true - label: "Step 3: TH reads 'ClientList' attribute" @@ -244,17 +244,17 @@ tests: Verify client list entries on the TH (Chip-tool) and below is the sample log provided for the raspi platform, Here ClientList entries are 1. - [1676367470.160199][9805:9807] CHIP:DMG: } - [1676367470.160268][9805:9807] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 3336430903 - [1676367470.160282][9805:9807] CHIP:TOO: ClientList: 1 entries - [1676367470.160289][9805:9807] CHIP:TOO: [1]: 6 + [1676367470.160199][9805:9807] [DMG] } + [1676367470.160268][9805:9807] [TOO] Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 3336430903 + [1676367470.160282][9805:9807] [TOO] ClientList: 1 entries + [1676367470.160289][9805:9807] [TOO] [1]: 6 (OnOff) ./chip-tool descriptor read client-list 1 2 Verify client list entries on the TH (Chip-tool) and below is the sample log provided for the raspi platform, Here ClientList entries are 0. - [1660146160.390200][46818:46823] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 1051414887 - [1660146160.390211][46818:46823] CHIP:TOO: ClientList: 0 entries + [1660146160.390200][46818:46823] [TOO] Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0002 DataVersion: 1051414887 + [1660146160.390211][46818:46823] [TOO] ClientList: 0 entries disabled: true - label: "Step 4: TH reads 'PartsList' attribute." diff --git a/src/app/tests/suites/certification/Test_TC_IDM_2_2.yaml b/src/app/tests/suites/certification/Test_TC_IDM_2_2.yaml index 6b4f2c7e7df9a9..7c00f74535fd7d 100644 --- a/src/app/tests/suites/certification/Test_TC_IDM_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_IDM_2_2.yaml @@ -81,33 +81,33 @@ tests: On the TH(chip-tool) verify the received report data message has only the attributes that the TH has privilege to. - [1655727546.354466][5286:5291] CHIP:DMG: - [1655727546.354512][5286:5291] CHIP:DMG: SuppressResponse = true, - [1655727546.354538][5286:5291] CHIP:DMG: InteractionModelRevision = 1 - [1655727546.354580][5286:5291] CHIP:DMG: } - [1655727546.355252][5286:5291] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 1545325355 - [1655727546.355324][5286:5291] CHIP:TOO: identify time: 0 - [1655727546.355386][5286:5291] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 1545325355 - [1655727546.355414][5286:5291] CHIP:TOO: identify type: 2 - [1655727546.355470][5286:5291] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFC DataVersion: 1545325355 - [1655727546.355524][5286:5291] CHIP:TOO: FeatureMap: 0 - [1655727546.355606][5286:5291] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 1545325355 - [1655727546.355635][5286:5291] CHIP:TOO: ClusterRevision: 4 - [1655727546.355788][5286:5291] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 1545325355 - [1655727546.355845][5286:5291] CHIP:TOO: GeneratedCommandList: 0 entries - [1655727546.356030][5286:5291] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 1545325355 - [1655727546.356087][5286:5291] CHIP:TOO: AcceptedCommandList: 2 entries - [1655727546.356117][5286:5291] CHIP:TOO: [1]: 0 - [1655727546.356143][5286:5291] CHIP:TOO: [2]: 64 - [1655727546.356552][5286:5291] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 1545325355 - [1655727546.356590][5286:5291] CHIP:TOO: AttributeList: 7 entries - [1655727546.356617][5286:5291] CHIP:TOO: [1]: 0 - [1655727546.356642][5286:5291] CHIP:TOO: [2]: 1 - [1655727546.356667][5286:5291] CHIP:TOO: [3]: 65528 - [1655727546.356692][5286:5291] CHIP:TOO: [4]: 65529 - [1655727546.356716][5286:5291] CHIP:TOO: [5]: 65531 - [1655727546.356741][5286:5291] CHIP:TOO: [6]: 65532 - [1655727546.356766][5286:5291] CHIP:TOO: [7]: 65533 + [1723642164.392] [329152:329154] [DMG] + [1723642164.392] [329152:329154] [DMG] SuppressResponse = true, + [1723642164.392] [329152:329154] [DMG] InteractionModelRevision = 11 + [1723642164.392] [329152:329154] [DMG] } + [1723642164.392] [329152:329154] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 357555707 + [1723642164.392] [329152:329154] [TOO] IdentifyTime: 0 + [1723642164.392] [329152:329154] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 357555707 + [1723642164.392] [329152:329154] [TOO] IdentifyType: 2 + [1723642164.392] [329152:329154] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFC DataVersion: 357555707 + [1723642164.392] [329152:329154] [TOO] FeatureMap: 0 + [1723642164.392] [329152:329154] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 357555707 + [1723642164.392] [329152:329154] [TOO] ClusterRevision: 4 + [1723642164.393] [329152:329154] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 357555707 + [1723642164.393] [329152:329154] [TOO] GeneratedCommandList: 0 entries + [1723642164.393] [329152:329154] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 357555707 + [1723642164.393] [329152:329154] [TOO] AcceptedCommandList: 2 entries + [1723642164.393] [329152:329154] [TOO] [1]: 0 (Identify) + [1723642164.393] [329152:329154] [TOO] [2]: 64 (TriggerEffect) + [1723642164.393] [329152:329154] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 357555707 + [1723642164.393] [329152:329154] [TOO] AttributeList: 7 entries + [1723642164.393] [329152:329154] [TOO] [1]: 0 (IdentifyTime) + [1723642164.393] [329152:329154] [TOO] [2]: 1 (IdentifyType) + [1723642164.393] [329152:329154] [TOO] [3]: 65528 (GeneratedCommandList) + [1723642164.393] [329152:329154] [TOO] [4]: 65529 (AcceptedCommandList) + [1723642164.393] [329152:329154] [TOO] [5]: 65531 (AttributeList) + [1723642164.393] [329152:329154] [TOO] [6]: 65532 (FeatureMap) + [1723642164.393] [329152:329154] [TOO] [7]: 65533 (ClusterRevision) disabled: true - label: @@ -272,7 +272,7 @@ tests: disabled: true - label: - "Step 7: TH sends the Read Request Message to the DUT to read all + "Step 7: TH sends the Read Requ`est Message to the DUT to read all attributes from a cluster at all Endpoints AttributePath = [[Cluster = Specific ClusterID]] On receipt of this message, DUT should send a report data action with the attribute value from all the Endpoints to @@ -284,52 +284,52 @@ tests: On the TH(chip-tool) verify the received report data message has all the right attribute values for above command - [1653629930.057852][8778:8783] CHIP:DMG: } - [1653629930.058739][8778:8783] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 2065044836 - [1653629930.058788][8778:8783] CHIP:TOO: identify time: 0 - [1653629930.058889][8778:8783] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 2065044836 - [1653629930.058919][8778:8783] CHIP:TOO: identify type: 2 - [1653629930.058980][8778:8783] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 2065044836 - [1653629930.058998][8778:8783] CHIP:TOO: ClusterRevision: 4 - [1653629930.059191][8778:8783] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 2065044836 - [1653629930.059220][8778:8783] CHIP:TOO: GeneratedCommandList: 1 entries - [1653629930.059239][8778:8783] CHIP:TOO: [1]: 0 - [1653629930.059478][8778:8783] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 2065044836 - [1653629930.059503][8778:8783] CHIP:TOO: AcceptedCommandList: 3 entries - [1653629930.059519][8778:8783] CHIP:TOO: [1]: 0 - [1653629930.059532][8778:8783] CHIP:TOO: [2]: 1 - [1653629930.059546][8778:8783] CHIP:TOO: [3]: 64 - [1653629930.059945][8778:8783] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 2065044836 - [1653629930.059974][8778:8783] CHIP:TOO: AttributeList: 6 entries - [1653629930.059989][8778:8783] CHIP:TOO: [1]: 0 - [1653629930.060002][8778:8783] CHIP:TOO: [2]: 1 - [1653629930.060015][8778:8783] CHIP:TOO: [3]: 65528 - [1653629930.060032][8778:8783] CHIP:TOO: [4]: 65529 - [1653629930.060048][8778:8783] CHIP:TOO: [5]: 65531 - [1653629930.060064][8778:8783] CHIP:TOO: [6]: 65533 - [1653629930.060077][8778:8783] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3620435651 - [1653629930.060095][8778:8783] CHIP:TOO: identify time: 0 - [1653629930.060151][8778:8783] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3620435651 - [1653629930.060167][8778:8783] CHIP:TOO: identify type: 2 - [1653629930.060224][8778:8783] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3620435651 - [1653629930.060240][8778:8783] CHIP:TOO: ClusterRevision: 4 - [1653629930.060411][8778:8783] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3620435651 - [1653629930.060433][8778:8783] CHIP:TOO: GeneratedCommandList: 1 entries - [1653629930.060448][8778:8783] CHIP:TOO: [1]: 0 - [1653629930.060671][8778:8783] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3620435651 - [1653629930.060695][8778:8783] CHIP:TOO: AcceptedCommandList: 3 entries - [1653629930.060710][8778:8783] CHIP:TOO: [1]: 0 - [1653629930.060722][8778:8783] CHIP:TOO: [2]: 1 - [1653629930.060735][8778:8783] CHIP:TOO: [3]: 64 - [1653629930.061086][8778:8783] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3620435651 - [1653629930.061114][8778:8783] CHIP:TOO: AttributeList: 6 entries - [1653629930.061129][8778:8783] CHIP:TOO: [1]: 0 - [1653629930.061141][8778:8783] CHIP:TOO: [2]: 1 - [1653629930.061154][8778:8783] CHIP:TOO: [3]: 65528 - [1653629930.061167][8778:8783] CHIP:TOO: [4]: 65529 - [1653629930.061184][8778:8783] CHIP:TOO: [5]: 65531 - [1653629930.061201][8778:8783] CHIP:TOO: [6]: 65533 - [1653629930.061435][8778:8783] CHIP:EM: Sending Standalone Ack for MessageCounter:5968688 on exchange 11683i + [1653629930.057] [8778:8783] [DMG] } + [1653629930.058] [8778:8783] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 2065044836 + [1653629930.058] [8778:8783] [TOO] identify time: 0 + [1653629930.058] [8778:8783] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 2065044836 + [1653629930.058] [8778:8783] [TOO] identify type: 2 + [1653629930.058] [8778:8783] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 2065044836 + [1653629930.058] [8778:8783] [TOO] ClusterRevision: 4 + [1653629930.059] [8778:8783] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 2065044836 + [1653629930.059] [8778:8783] [TOO] GeneratedCommandList: 1 entries + [1653629930.059] [8778:8783] [TOO] [1]: 0 (Identify) + [1653629930.059] [8778:8783] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 2065044836 + [1653629930.059] [8778:8783] [TOO] AcceptedCommandList: 3 entries + [1653629930.059] [8778:8783] [TOO] [1]: 0 (Identify) + [1653629930.059] [8778:8783] [TOO] [2]: 1 (Unknown) + [1653629930.059] [8778:8783] [TOO] [3]: 64 (TriggerEffect) + [1653629930.059] [8778:8783] [TOO] Endpoint: 0 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 2065044836 + [1653629930.059] [8778:8783] [TOO] AttributeList: 6 entries + [1653629930.059] [8778:8783] [TOO] [1]: 0 (IdentifyTime) + [1653629930.060] [8778:8783] [TOO] [2]: 1 (IdentifyType) + [1653629930.060] [8778:8783] [TOO] [3]: 65528 (GeneratedCommandList) + [1653629930.060] [8778:8783] [TOO] [4]: 65529 (AcceptedCommandList) + [1653629930.060] [8778:8783] [TOO] [5]: 65531 (AttributeList) + [1653629930.060] [8778:8783] [TOO] [6]: 65533 (ClusterRevision) + [1653629930.060] [8778:8783] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3620435651 + [1653629930.060] [8778:8783] [TOO] identify time: 0 + [1653629930.060] [8778:8783] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3620435651 + [1653629930.060] [8778:8783] [TOO] identify type: 2 + [1653629930.060] [8778:8783] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3620435651 + [1653629930.060] [8778:8783] [TOO] ClusterRevision: 4 + [1653629930.060] [8778:8783] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3620435651 + [1653629930.060] [8778:8783] [TOO] GeneratedCommandList: 1 entries + [1653629930.060] [8778:8783] [TOO] [1]: 0 (Identify) + [1653629930.060] [8778:8783] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3620435651 + [1653629930.060] [8778:8783] [TOO] AcceptedCommandList: 3 entries + [1653629930.060] [8778:8783] [TOO] [1]: 0 (Identify) + [1653629930.060] [8778:8783] [TOO] [2]: 1 (Unknown) + [1653629930.060] [8778:8783] [TOO] [3]: 64 (TriggerEffect) + [1653629930.061] [8778:8783] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3620435651 + [1653629930.061] [8778:8783] [TOO] AttributeList: 6 entries + [1653629930.061] [8778:8783] [TOO] [1]: 0 (IdentifyTime) + [1653629930.061] [8778:8783] [TOO] [2]: 1 (IdentifyType) + [1653629930.061] [8778:8783] [TOO] [3]: 65528 (GeneratedCommandList) + [1653629930.061] [8778:8783] [TOO] [4]: 65529 (AcceptedCommandList) + [1653629930.061] [8778:8783] [TOO] [5]: 65531 (AttributeList) + [1653629930.061] [8778:8783] [TOO] [6]: 65533 (ClusterRevision) + [1653629930.061] [8778:8783] [EM] Sending Standalone Ack for MessageCounter:5968688 on exchange 11683i disabled: true - label: @@ -825,30 +825,29 @@ tests: Verify on TH(chip-tool), DUT is responds right attribute value for below command - [1653633965.092996][9835:9840] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3620435654 - [1653633965.093041][9835:9840] CHIP:TOO: identify time: 0 - [1653633965.093120][9835:9840] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3620435654 - [1653633965.093140][9835:9840] CHIP:TOO: identify type: 2 - [1653633965.093202][9835:9840] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3620435654 - [1653633965.093221][9835:9840] CHIP:TOO: ClusterRevision: 4 - [1653633965.093411][9835:9840] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3620435654 - [1653633965.093451][9835:9840] CHIP:TOO: GeneratedCommandList: 1 entries - [1653633965.093474][9835:9840] CHIP:TOO: [1]: 0 - [1653633965.093721][9835:9840] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3620435654 - [1653633965.093748][9835:9840] CHIP:TOO: AcceptedCommandList: 3 entries - [1653633965.093767][9835:9840] CHIP:TOO: [1]: 0 - [1653633965.093784][9835:9840] CHIP:TOO: [2]: 1 - [1653633965.093800][9835:9840] CHIP:TOO: [3]: 64 - [1653633965.094169][9835:9840] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3620435654 - [1653633965.094200][9835:9840] CHIP:TOO: AttributeList: 6 entries - [1653633965.094218][9835:9840] CHIP:TOO: [1]: 0 - [1653633965.094235][9835:9840] CHIP:TOO: [2]: 1 - [1653633965.094252][9835:9840] CHIP:TOO: [3]: 65528 - [1653633965.094269][9835:9840] CHIP:TOO: [4]: 65529 - [1653633965.094286][9835:9840] CHIP:TOO: [5]: 65531 - [1653633965.094302][9835:9840] CHIP:TOO: [6]: 65533 - [1653633965.094449][9835:9840] CHIP:EM: Sending Standalone Ack for MessageCounter:14221655 on exchange 17356i - + [1653633965.092996][9835:9840] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3620435654 + [1653633965.093041][9835:9840] [TOO] identify time: 0 + [1653633965.093120][9835:9840] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3620435654 + [1653633965.093140][9835:9840] [TOO] identify type: 2 + [1653633965.093202][9835:9840] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3620435654 + [1653633965.093221][9835:9840] [TOO] ClusterRevision: 4 + [1653633965.093411][9835:9840] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3620435654 + [1653633965.093451][9835:9840] [TOO] GeneratedCommandList: 1 entries + [1653633965.093474][9835:9840] [TOO] [1]: 0 (Identify) + [1653633965.093721][9835:9840] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3620435654 + [1653633965.093748][9835:9840] [TOO] AcceptedCommandList: 3 entries + [1653633965.093767][9835:9840] [TOO] [1]: 0 (Identify) + [1653633965.093784][9835:9840] [TOO] [2]: 1 (Unknown) + [1653633965.093800][9835:9840] [TOO] [3]: 64 (TriggerEffect) + [1653633965.094169][9835:9840] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3620435654 + [1653633965.094200][9835:9840] [TOO] AttributeList: 6 entries + [1653633965.094218][9835:9840] [TOO] [1]: 0 (IdentifyTime) + [1653633965.094235][9835:9840] [TOO] [2]: 1 (IdentifyType) + [1653633965.094252][9835:9840] [TOO] [3]: 65528 (GeneratedCommandList) + [1653633965.094269][9835:9840] [TOO] [4]: 65529 (AcceptedCommandList) + [1653633965.094286][9835:9840] [TOO] [5]: 65531 (AttributeList) + [1653633965.094302][9835:9840] [TOO] [6]: 65533 (ClusterRevision) + [1653633965.094449][9835:9840] [EM] Sending Standalone Ack for MessageCounter:14221655 on exchange 17356i ./chip-tool any write-by-id 0x03 0x00 2 1 1 @@ -884,29 +883,29 @@ tests: ./chip-tool any read-by-id 0x03 0xFFFFFFFF 1 1 --data-version 0xd7cb76c6 - [1653634117.935268][9878:9883] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3620435657 - [1653634117.935294][9878:9883] CHIP:TOO: identify time: 0 - [1653634117.935322][9878:9883] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3620435657 - [1653634117.935331][9878:9883] CHIP:TOO: identify type: 2 - [1653634117.935357][9878:9883] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3620435657 - [1653634117.935366][9878:9883] CHIP:TOO: ClusterRevision: 4 - [1653634117.935452][9878:9883] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3620435657 - [1653634117.935470][9878:9883] CHIP:TOO: GeneratedCommandList: 1 entries - [1653634117.935480][9878:9883] CHIP:TOO: [1]: 0 - [1653634117.935589][9878:9883] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3620435657 - [1653634117.935601][9878:9883] CHIP:TOO: AcceptedCommandList: 3 entries - [1653634117.935609][9878:9883] CHIP:TOO: [1]: 0 - [1653634117.935616][9878:9883] CHIP:TOO: [2]: 1 - [1653634117.935623][9878:9883] CHIP:TOO: [3]: 64 - [1653634117.935788][9878:9883] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3620435657 - [1653634117.935802][9878:9883] CHIP:TOO: AttributeList: 6 entries - [1653634117.935809][9878:9883] CHIP:TOO: [1]: 0 - [1653634117.935817][9878:9883] CHIP:TOO: [2]: 1 - [1653634117.935824][9878:9883] CHIP:TOO: [3]: 65528 - [1653634117.935831][9878:9883] CHIP:TOO: [4]: 65529 - [1653634117.935838][9878:9883] CHIP:TOO: [5]: 65531 - [1653634117.935845][9878:9883] CHIP:TOO: [6]: 65533 - [1653634117.935910][9878:9883] CHIP:EM: Sending Standalone Ack for MessageCounter:531776 on exchange 45674i + [1653634117.935268][9878:9883] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3620435657 + [1653634117.935294][9878:9883] [TOO] identify time: 0 + [1653634117.935322][9878:9883] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3620435657 + [1653634117.935331][9878:9883] [TOO] identify type: 2 + [1653634117.935357][9878:9883] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3620435657 + [1653634117.935366][9878:9883] [TOO] ClusterRevision: 4 + [1653634117.935452][9878:9883] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3620435657 + [1653634117.935470][9878:9883] [TOO] GeneratedCommandList: 1 entries + [1653634117.935480][9878:9883] [TOO] [1]: 0 (Identify) + [1653634117.935589][9878:9883] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3620435657 + [1653634117.935601][9878:9883] [TOO] AcceptedCommandList: 3 entries + [1653634117.935609][9878:9883] [TOO] [1]: 0 (Identify) + [1653634117.935616][9878:9883] [TOO] [2]: 1 (Unknown) + [1653634117.935623][9878:9883] [TOO] [3]: 64 (TriggerEffect) + [1653634117.935788][9878:9883] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3620435657 + [1653634117.935802][9878:9883] [TOO] AttributeList: 6 entries + [1653634117.935809][9878:9883] [TOO] [1]: 0 (IdentifyTime) + [1653634117.935817][9878:9883] [TOO] [2]: 1 (IdentifyType) + [1653634117.935824][9878:9883] [TOO] [3]: 65528 (GeneratedCommandList) + [1653634117.935831][9878:9883] [TOO] [4]: 65529 (AcceptedCommandList) + [1653634117.935838][9878:9883] [TOO] [5]: 65531 (AttributeList) + [1653634117.935845][9878:9883] [TOO] [6]: 65533 (ClusterRevision) + [1653634117.935910][9878:9883] [EM] Sending Standalone Ack for MessageCounter:531776 on exchange 45674i disabled: true - label: @@ -1000,55 +999,55 @@ tests: ./chip-tool any read-by-id 0x03 0xFFFFFFFF 1 1 - [1653634446.678378][9962:9967] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3620435660 - [1653634446.678404][9962:9967] CHIP:TOO: identify time: 0 - [1653634446.678437][9962:9967] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3620435660 - [1653634446.678447][9962:9967] CHIP:TOO: identify type: 2 - [1653634446.678474][9962:9967] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3620435660 - [1653634446.678483][9962:9967] CHIP:TOO: ClusterRevision: 4 - [1653634446.678570][9962:9967] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3620435660 - [1653634446.678584][9962:9967] CHIP:TOO: GeneratedCommandList: 1 entries - [1653634446.678594][9962:9967] CHIP:TOO: [1]: 0 - [1653634446.678767][9962:9967] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3620435660 - [1653634446.678780][9962:9967] CHIP:TOO: AcceptedCommandList: 3 entries - [1653634446.678789][9962:9967] CHIP:TOO: [1]: 0 - [1653634446.678796][9962:9967] CHIP:TOO: [2]: 1 - [1653634446.678805][9962:9967] CHIP:TOO: [3]: 64 - [1653634446.678998][9962:9967] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3620435660 - [1653634446.679017][9962:9967] CHIP:TOO: AttributeList: 6 entries - [1653634446.679024][9962:9967] CHIP:TOO: [1]: 0 - [1653634446.679030][9962:9967] CHIP:TOO: [2]: 1 - [1653634446.679036][9962:9967] CHIP:TOO: [3]: 65528 - [1653634446.679042][9962:9967] CHIP:TOO: [4]: 65529 - [1653634446.679048][9962:9967] CHIP:TOO: [5]: 65531 - [1653634446.679055][9962:9967] CHIP:TOO: [6]: 65533 - [1653634446.679129][9962:9967] CHIP:EM: Sending Standalone Ack for MessageCounter:15830359 on exchange 10739i + [1653634446.678378] [9962:9967] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0000 DataVersion: 3620435660 + [1653634446.678404] [9962:9967] [TOO] identify time: 0 + [1653634446.678437] [9962:9967] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_0001 DataVersion: 3620435660 + [1653634446.678447] [9962:9967] [TOO] identify type: 2 + [1653634446.678474] [9962:9967] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFD DataVersion: 3620435660 + [1653634446.678483] [9962:9967] [TOO] ClusterRevision: 4 + [1653634446.678570] [9962:9967] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF8 DataVersion: 3620435660 + [1653634446.678584] [9962:9967] [TOO] GeneratedCommandList: 1 entries + [1653634446.678594] [9962:9967] [TOO] [1]: 0 (Identify) + [1653634446.678767] [9962:9967] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFF9 DataVersion: 3620435660 + [1653634446.678780] [9962:9967] [TOO] AcceptedCommandList: 3 entries + [1653634446.678789] [9962:9967] [TOO] [1]: 0 (Identify) + [1653634446.678796] [9962:9967] [TOO] [2]: 1 (Unknown) + [1653634446.678805] [9962:9967] [TOO] [3]: 64 (TriggerEffect) + [1653634446.678998] [9962:9967] [TOO] Endpoint: 1 Cluster: 0x0000_0003 Attribute 0x0000_FFFB DataVersion: 3620435660 + [1653634446.679017] [9962:9967] [TOO] AttributeList: 6 entries + [1653634446.679024] [9962:9967] [TOO] [1]: 0 (IdentifyTime) + [1653634446.679030] [9962:9967] [TOO] [2]: 1 (IdentifyType) + [1653634446.679036] [9962:9967] [TOO] [3]: 65528 (GeneratedCommandList) + [1653634446.679042] [9962:9967] [TOO] [4]: 65529 (AcceptedCommandList) + [1653634446.679048] [9962:9967] [TOO] [5]: 65531 (AttributeList) + [1653634446.679055] [9962:9967] [TOO] [6]: 65533 (ClusterRevision) + [1653634446.679129] [9962:9967] [EM] Sending Standalone Ack for MessageCounter:15830359 on exchange 10739i ./chip-tool levelcontrol read-by-id 0xFFFFFFFF 1 1 --data-version 0xd7cb76cc (Here given data version received for identify cluster) - [1653634568.902390][9990:9995] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0008 Attribute 0x0000_FFFB DataVersion: 199562416 - [1653634568.902417][9990:9995] CHIP:TOO: AttributeList: 19 entries - [1653634568.902428][9990:9995] CHIP:TOO: [1]: 0 - [1653634568.902436][9990:9995] CHIP:TOO: [2]: 1 - [1653634568.902444][9990:9995] CHIP:TOO: [3]: 2 - [1653634568.902451][9990:9995] CHIP:TOO: [4]: 3 - [1653634568.902458][9990:9995] CHIP:TOO: [5]: 4 - [1653634568.902466][9990:9995] CHIP:TOO: [6]: 5 - [1653634568.902475][9990:9995] CHIP:TOO: [7]: 6 - [1653634568.902483][9990:9995] CHIP:TOO: [8]: 15 - [1653634568.902490][9990:9995] CHIP:TOO: [9]: 16 - [1653634568.902498][9990:9995] CHIP:TOO: [10]: 17 - [1653634568.902506][9990:9995] CHIP:TOO: [11]: 18 - [1653634568.902513][9990:9995] CHIP:TOO: [12]: 19 - [1653634568.902520][9990:9995] CHIP:TOO: [13]: 20 - [1653634568.902528][9990:9995] CHIP:TOO: [14]: 16384 - [1653634568.902535][9990:9995] CHIP:TOO: [15]: 65528 - [1653634568.902542][9990:9995] CHIP:TOO: [16]: 65529 - [1653634568.902550][9990:9995] CHIP:TOO: [17]: 65531 - [1653634568.902557][9990:9995] CHIP:TOO: [18]: 65532 - [1653634568.902565][9990:9995] CHIP:TOO: [19]: 65533 - [1653634568.902621][9990:9995] CHIP:EM: Sending Standalone Ack for MessageCounter:3712616 on exchange 9501 + [1653634568.902390] [9990:9995] [TOO] Endpoint: 1 Cluster: 0x0000_0008 Attribute 0x0000_FFFB DataVersion: 199562416 + [1653634568.902417] [9990:9995] [TOO] AttributeList: 19 entries + [1653634568.902428] [9990:9995] [TOO] [1]: 0 (CurrentLevel) + [1653634568.902436] [9990:9995] [TOO] [2]: 1 (RemainingTime) + [1653634568.902444] [9990:9995] [TOO] [3]: 2 (MinLevel) + [1653634568.902451] [9990:9995] [TOO] [4]: 3 (MaxLevel) + [1653634568.902458] [9990:9995] [TOO] [5]: 4 (CurrentFrequency) + [1653634568.902466] [9990:9995] [TOO] [6]: 5 (MinFrequency) + [1653634568.902475] [9990:9995] [TOO] [7]: 6 (MaxFrequency) + [1653634568.902483] [9990:9995] [TOO] [8]: 15 (Options) + [1653634568.902490] [9990:9995] [TOO] [9]: 16 (OnOffTransitionTime) + [1653634568.902498] [9990:9995] [TOO] [10]: 17 (OnLevel) + [1653634568.902506] [9990:9995] [TOO] [11]: 18 (OnTransitionTime) + [1653634568.902513] [9990:9995] [TOO] [12]: 19 (OffTransitionTime) + [1653634568.902520] [9990:9995] [TOO] [13]: 20 (DefaultMoveRate) + [1653634568.902528] [9990:9995] [TOO] [14]: 16384 (StartUpCurrentLevel) + [1653634568.902535] [9990:9995] [TOO] [15]: 65528 (GeneratedCommandList) + [1653634568.902542] [9990:9995] [TOO] [16]: 65529 (AcceptedCommandList) + [1653634568.902550] [9990:9995] [TOO] [17]: 65531 (AttributeList) + [1653634568.902557] [9990:9995] [TOO] [18]: 65532 (FeatureMap) + [1653634568.902565] [9990:9995] [TOO] [19]: 65533 (ClusterRevision) + [1653634568.902621] [9990:9995] [EM] Sending Standalone Ack for MessageCounter:3712616 on exchange 9501 disabled: true - label: @@ -1166,53 +1165,52 @@ tests: Verify that there are no errors sent back for attributes the TH has no access to. - [1659422360.478947][2049:2054] CHIP:DMG: } - [1659422360.479556][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0000 DataVersion: 3949809681 - [1659422360.479619][2049:2054] CHIP:TOO: ACL: 1 entries - [1659422360.479679][2049:2054] CHIP:TOO: [1]: { - [1659422360.479706][2049:2054] CHIP:TOO: Privilege: 5 - [1659422360.479729][2049:2054] CHIP:TOO: AuthMode: 2 - [1659422360.479768][2049:2054] CHIP:TOO: Subjects: 2 entries - [1659422360.479819][2049:2054] CHIP:TOO: [1]: 1 - [1659422360.479847][2049:2054] CHIP:TOO: [2]: 112233 - [1659422360.479876][2049:2054] CHIP:TOO: Targets: 1 entries - [1659422360.479925][2049:2054] CHIP:TOO: [1]: { - [1659422360.479969][2049:2054] CHIP:TOO: Cluster: 31 - [1659422360.479993][2049:2054] CHIP:TOO: Endpoint: 0 - [1659422360.480016][2049:2054] CHIP:TOO: DeviceType: null - [1659422360.480038][2049:2054] CHIP:TOO: } - [1659422360.480062][2049:2054] CHIP:TOO: FabricIndex: 1 - [1659422360.480085][2049:2054] CHIP:TOO: } - [1659422360.480165][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 3949809681 - [1659422360.480197][2049:2054] CHIP:TOO: Extension: 0 entries - [1659422360.480225][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0002 DataVersion: 3949809681 - [1659422360.480251][2049:2054] CHIP:TOO: SubjectsPerAccessControlEntry: 4 - [1659422360.480311][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0003 DataVersion: 3949809681 - [1659422360.480337][2049:2054] CHIP:TOO: TargetsPerAccessControlEntry: 3 - [1659422360.480395][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0004 DataVersion: 3949809681 - [1659422360.480421][2049:2054] CHIP:TOO: AccessControlEntriesPerFabric: 3 - [1659422360.480479][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFFC DataVersion: 3949809681 - [1659422360.480505][2049:2054] CHIP:TOO: FeatureMap: 0 - [1659422360.480563][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFFD DataVersion: 3949809681 - [1659422360.480588][2049:2054] CHIP:TOO: ClusterRevision: 1 - [1659422360.480690][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFF8 DataVersion: 3949809681 - [1659422360.480721][2049:2054] CHIP:TOO: GeneratedCommandList: 0 entries - [1659422360.480789][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFF9 DataVersion: 3949809681 - [1659422360.480818][2049:2054] CHIP:TOO: AcceptedCommandList: 0 entries - [1659422360.481269][2049:2054] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFFB DataVersion: 3949809681 - [1659422360.481307][2049:2054] CHIP:TOO: AttributeList: 10 entries - [1659422360.481334][2049:2054] CHIP:TOO: [1]: 0 - [1659422360.481359][2049:2054] CHIP:TOO: [2]: 1 - [1659422360.481383][2049:2054] CHIP:TOO: [3]: 2 - [1659422360.481408][2049:2054] CHIP:TOO: [4]: 3 - [1659422360.481432][2049:2054] CHIP:TOO: [5]: 4 - [1659422360.481457][2049:2054] CHIP:TOO: [6]: 65528 - [1659422360.481482][2049:2054] CHIP:TOO: [7]: 65529 - [1659422360.481506][2049:2054] CHIP:TOO: [8]: 65531 - [1659422360.481531][2049:2054] CHIP:TOO: [9]: 65532 - [1659422360.481556][2049:2054] CHIP:TOO: [10]: 65533 - [1659422360.481706][2049:2054] CHIP:EM: Sending Standalone Ack for MessageCounter:183166533 on exchange 17693i - + [1659422360.478947][2049:2054] [DMG] } + [1659422360.479556][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0000 DataVersion: 3949809681 + [1659422360.479619][2049:2054] [TOO] ACL: 1 entries + [1659422360.479679][2049:2054] [TOO] [1]: { + [1659422360.479706][2049:2054] [TOO] Privilege: 5 + [1659422360.479729][2049:2054] [TOO] AuthMode: 2 + [1659422360.479768][2049:2054] [TOO] Subjects: 2 entries + [1659422360.479819][2049:2054] [TOO] [1]: 1 + [1659422360.479847][2049:2054] [TOO] [2]: 112233 + [1659422360.479876][2049:2054] [TOO] Targets: 1 entries + [1659422360.479925][2049:2054] [TOO] [1]: { + [1659422360.479969][2049:2054] [TOO] Cluster: 31 + [1659422360.479993][2049:2054] [TOO] Endpoint: 0 + [1659422360.480016][2049:2054] [TOO] DeviceType: null + [1659422360.480038][2049:2054] [TOO] } + [1659422360.480062][2049:2054] [TOO] FabricIndex: 1 + [1659422360.480085][2049:2054] [TOO] } + [1659422360.480165][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 3949809681 + [1659422360.480197][2049:2054] [TOO] Extension: 0 entries + [1659422360.480225][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0002 DataVersion: 3949809681 + [1659422360.480251][2049:2054] [TOO] SubjectsPerAccessControlEntry: 4 + [1659422360.480311][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0003 DataVersion: 3949809681 + [1659422360.480337][2049:2054] [TOO] TargetsPerAccessControlEntry: 3 + [1659422360.480395][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0004 DataVersion: 3949809681 + [1659422360.480421][2049:2054] [TOO] AccessControlEntriesPerFabric: 3 + [1659422360.480479][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFFC DataVersion: 3949809681 + [1659422360.480505][2049:2054] [TOO] FeatureMap: 0 + [1659422360.480563][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFFD DataVersion: 3949809681 + [1659422360.480588][2049:2054] [TOO] ClusterRevision: 1 + [1659422360.480690][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFF8 DataVersion: 3949809681 + [1659422360.480721][2049:2054] [TOO] GeneratedCommandList: 0 entries + [1659422360.480789][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFF9 DataVersion: 3949809681 + [1659422360.480818][2049:2054] [TOO] AcceptedCommandList: 0 entries + [1659422360.481269][2049:2054] [TOO] Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_FFFB DataVersion: 3949809681 + [1659422360.481307][2049:2054] [TOO] AttributeList: 10 entries + [1659422360.481334][2049:2054] [TOO] [1]: 0 (NOCs) + [1659422360.481359][2049:2054] [TOO] [2]: 1 (Fabrics) + [1659422360.481383][2049:2054] [TOO] [3]: 2 (SupportedFabrics) + [1659422360.481408][2049:2054] [TOO] [4]: 3 (CommissionedFabrics) + [1659422360.481432][2049:2054] [TOO] [5]: 4 (TrustedRootCertificates) + [1659422360.481457][2049:2054] [TOO] [6]: 65528 (GeneratedCommandList) + [1659422360.481482][2049:2054] [TOO] [7]: 65529 (AcceptedCommandList) + [1659422360.481506][2049:2054] [TOO] [8]: 65531 (AttributeList) + [1659422360.481531][2049:2054] [TOO] [9]: 65532 (FeatureMap) + [1659422360.481556][2049:2054] [TOO] [10]: 65533 (ClusterRevision) + [1659422360.481706][2049:2054] [EM] Sending Standalone Ack for MessageCounter:183166533 on exchange 17693i With the above command, we are overwriting the default privilege that chip-tool has as an admin. After this test step you need to send below mentioned command to Grant access to all clusters again. diff --git a/src/app/tests/suites/certification/Test_TC_WAKEONLAN_4_1.yaml b/src/app/tests/suites/certification/Test_TC_WAKEONLAN_4_1.yaml index eb36c1a41801d4..fc3f6674683683 100644 --- a/src/app/tests/suites/certification/Test_TC_WAKEONLAN_4_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WAKEONLAN_4_1.yaml @@ -55,10 +55,10 @@ tests: ./chip-tv-casting-app lowpower read accepted-command-list 1 1 On TH Verify that the DUT is no longer in a low-power state by sending above command - [1654248854.491911][3652:3657] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0508 Attribute 0x0000_FFF9 DataVersion: 2125568804 - [1654248854.491994][3652:3657] CHIP:TOO: AcceptedCommandList: 1 entries - [1654248854.492040][3652:3657] CHIP:TOO: [1]: 0 - [1654248854.492157][3652:3657] CHIP:EM: Sending Standalone Ack for MessageCounter:15063522 on exchange 51389i + [1654248854.491911][3652:3657] [TOO] Endpoint: 1 Cluster: 0x0000_0508 Attribute 0x0000_FFF9 DataVersion: 2125568804 + [1654248854.491994][3652:3657] [TOO] AcceptedCommandList: 1 entries + [1654248854.492040][3652:3657] [TOO] [1]: 0 (Sleep) + [1654248854.492157][3652:3657] [EM] Sending Standalone Ack for MessageCounter:15063522 on exchange 51389i cluster: "LogCommands" command: "UserPrompt" PICS: PICS_USER_PROMPT 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 12382e3cb41495..3d40f3897e852b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -8952,12 +8952,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Identify::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Identify::Id); } case Identify::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Identify::Id); } case Identify::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -8967,7 +8967,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Identify::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Identify::Id); } case Identify::Attributes::FeatureMap::Id: { uint32_t value; @@ -8993,12 +8993,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Groups::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Groups::Id); } case Groups::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Groups::Id); } case Groups::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9008,7 +9008,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Groups::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Groups::Id); } case Groups::Attributes::FeatureMap::Id: { uint32_t value; @@ -9054,12 +9054,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OnOff::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OnOff::Id); } case OnOff::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OnOff::Id); } case OnOff::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9069,7 +9069,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OnOff::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OnOff::Id); } case OnOff::Attributes::FeatureMap::Id: { uint32_t value; @@ -9100,12 +9100,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OnOffSwitchConfiguration::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OnOffSwitchConfiguration::Id); } case OnOffSwitchConfiguration::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OnOffSwitchConfiguration::Id); } case OnOffSwitchConfiguration::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9115,7 +9115,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OnOffSwitchConfiguration::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OnOffSwitchConfiguration::Id); } case OnOffSwitchConfiguration::Attributes::FeatureMap::Id: { uint32_t value; @@ -9206,12 +9206,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LevelControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, LevelControl::Id); } case LevelControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, LevelControl::Id); } case LevelControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9221,7 +9221,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LevelControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, LevelControl::Id); } case LevelControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -9287,12 +9287,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BinaryInputBasic::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BinaryInputBasic::Id); } case BinaryInputBasic::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BinaryInputBasic::Id); } case BinaryInputBasic::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9302,7 +9302,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BinaryInputBasic::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, BinaryInputBasic::Id); } case BinaryInputBasic::Attributes::FeatureMap::Id: { uint32_t value; @@ -9323,12 +9323,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PulseWidthModulation::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PulseWidthModulation::Id); } case PulseWidthModulation::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PulseWidthModulation::Id); } case PulseWidthModulation::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9338,7 +9338,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PulseWidthModulation::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, PulseWidthModulation::Id); } case PulseWidthModulation::Attributes::FeatureMap::Id: { uint32_t value; @@ -9364,12 +9364,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Descriptor::Attributes::ServerList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ServerList", 1, value); + return DataModelLogger::LogClusterId("ServerList", 1, value); } case Descriptor::Attributes::ClientList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClientList", 1, value); + return DataModelLogger::LogClusterId("ClientList", 1, value); } case Descriptor::Attributes::PartsList::Id: { chip::app::DataModel::DecodableList value; @@ -9384,12 +9384,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Descriptor::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Descriptor::Id); } case Descriptor::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Descriptor::Id); } case Descriptor::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9399,7 +9399,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Descriptor::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Descriptor::Id); } case Descriptor::Attributes::FeatureMap::Id: { uint32_t value; @@ -9425,12 +9425,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Binding::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Binding::Id); } case Binding::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Binding::Id); } case Binding::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9440,7 +9440,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Binding::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Binding::Id); } case Binding::Attributes::FeatureMap::Id: { uint32_t value; @@ -9504,12 +9504,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AccessControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, AccessControl::Id); } case AccessControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, AccessControl::Id); } case AccessControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9519,7 +9519,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AccessControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, AccessControl::Id); } case AccessControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -9555,12 +9555,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Actions::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Actions::Id); } case Actions::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Actions::Id); } case Actions::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9570,7 +9570,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Actions::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Actions::Id); } case Actions::Attributes::FeatureMap::Id: { uint32_t value; @@ -9706,12 +9706,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BasicInformation::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BasicInformation::Id); } case BasicInformation::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BasicInformation::Id); } case BasicInformation::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9721,7 +9721,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BasicInformation::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, BasicInformation::Id); } case BasicInformation::Attributes::FeatureMap::Id: { uint32_t value; @@ -9742,12 +9742,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OtaSoftwareUpdateProvider::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OtaSoftwareUpdateProvider::Id); } case OtaSoftwareUpdateProvider::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OtaSoftwareUpdateProvider::Id); } case OtaSoftwareUpdateProvider::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9757,7 +9757,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OtaSoftwareUpdateProvider::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OtaSoftwareUpdateProvider::Id); } case OtaSoftwareUpdateProvider::Attributes::FeatureMap::Id: { uint32_t value; @@ -9800,12 +9800,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OtaSoftwareUpdateRequestor::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OtaSoftwareUpdateRequestor::Id); } case OtaSoftwareUpdateRequestor::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OtaSoftwareUpdateRequestor::Id); } case OtaSoftwareUpdateRequestor::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9815,7 +9815,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OtaSoftwareUpdateRequestor::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OtaSoftwareUpdateRequestor::Id); } case OtaSoftwareUpdateRequestor::Attributes::FeatureMap::Id: { uint32_t value; @@ -9846,12 +9846,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LocalizationConfiguration::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, LocalizationConfiguration::Id); } case LocalizationConfiguration::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, LocalizationConfiguration::Id); } case LocalizationConfiguration::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9861,7 +9861,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LocalizationConfiguration::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, LocalizationConfiguration::Id); } case LocalizationConfiguration::Attributes::FeatureMap::Id: { uint32_t value; @@ -9897,12 +9897,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TimeFormatLocalization::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, TimeFormatLocalization::Id); } case TimeFormatLocalization::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, TimeFormatLocalization::Id); } case TimeFormatLocalization::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9912,7 +9912,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TimeFormatLocalization::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, TimeFormatLocalization::Id); } case TimeFormatLocalization::Attributes::FeatureMap::Id: { uint32_t value; @@ -9938,12 +9938,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case UnitLocalization::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, UnitLocalization::Id); } case UnitLocalization::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, UnitLocalization::Id); } case UnitLocalization::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9953,7 +9953,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case UnitLocalization::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, UnitLocalization::Id); } case UnitLocalization::Attributes::FeatureMap::Id: { uint32_t value; @@ -9979,12 +9979,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PowerSourceConfiguration::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PowerSourceConfiguration::Id); } case PowerSourceConfiguration::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PowerSourceConfiguration::Id); } case PowerSourceConfiguration::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -9994,7 +9994,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PowerSourceConfiguration::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, PowerSourceConfiguration::Id); } case PowerSourceConfiguration::Attributes::FeatureMap::Id: { uint32_t value; @@ -10175,12 +10175,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PowerSource::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PowerSource::Id); } case PowerSource::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PowerSource::Id); } case PowerSource::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -10190,7 +10190,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PowerSource::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, PowerSource::Id); } case PowerSource::Attributes::FeatureMap::Id: { uint32_t value; @@ -10256,12 +10256,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case GeneralCommissioning::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, GeneralCommissioning::Id); } case GeneralCommissioning::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, GeneralCommissioning::Id); } case GeneralCommissioning::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -10271,7 +10271,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case GeneralCommissioning::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, GeneralCommissioning::Id); } case GeneralCommissioning::Attributes::FeatureMap::Id: { uint32_t value; @@ -10349,12 +10349,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case NetworkCommissioning::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, NetworkCommissioning::Id); } case NetworkCommissioning::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, NetworkCommissioning::Id); } case NetworkCommissioning::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -10364,7 +10364,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case NetworkCommissioning::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, NetworkCommissioning::Id); } case NetworkCommissioning::Attributes::FeatureMap::Id: { uint32_t value; @@ -10385,12 +10385,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DiagnosticLogs::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, DiagnosticLogs::Id); } case DiagnosticLogs::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, DiagnosticLogs::Id); } case DiagnosticLogs::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -10400,7 +10400,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DiagnosticLogs::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, DiagnosticLogs::Id); } case DiagnosticLogs::Attributes::FeatureMap::Id: { uint32_t value; @@ -10467,12 +10467,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case GeneralDiagnostics::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, GeneralDiagnostics::Id); } case GeneralDiagnostics::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, GeneralDiagnostics::Id); } case GeneralDiagnostics::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -10482,7 +10482,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case GeneralDiagnostics::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, GeneralDiagnostics::Id); } case GeneralDiagnostics::Attributes::FeatureMap::Id: { uint32_t value; @@ -10525,12 +10525,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case SoftwareDiagnostics::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, SoftwareDiagnostics::Id); } case SoftwareDiagnostics::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, SoftwareDiagnostics::Id); } case SoftwareDiagnostics::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -10540,7 +10540,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case SoftwareDiagnostics::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, SoftwareDiagnostics::Id); } case SoftwareDiagnostics::Attributes::FeatureMap::Id: { uint32_t value; @@ -10883,12 +10883,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ThreadNetworkDiagnostics::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ThreadNetworkDiagnostics::Id); } case ThreadNetworkDiagnostics::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ThreadNetworkDiagnostics::Id); } case ThreadNetworkDiagnostics::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -10898,7 +10898,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ThreadNetworkDiagnostics::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ThreadNetworkDiagnostics::Id); } case ThreadNetworkDiagnostics::Attributes::FeatureMap::Id: { uint32_t value; @@ -10984,12 +10984,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WiFiNetworkDiagnostics::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WiFiNetworkDiagnostics::Id); } case WiFiNetworkDiagnostics::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WiFiNetworkDiagnostics::Id); } case WiFiNetworkDiagnostics::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -10999,7 +10999,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WiFiNetworkDiagnostics::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WiFiNetworkDiagnostics::Id); } case WiFiNetworkDiagnostics::Attributes::FeatureMap::Id: { uint32_t value; @@ -11065,12 +11065,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EthernetNetworkDiagnostics::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, EthernetNetworkDiagnostics::Id); } case EthernetNetworkDiagnostics::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, EthernetNetworkDiagnostics::Id); } case EthernetNetworkDiagnostics::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11080,7 +11080,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EthernetNetworkDiagnostics::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, EthernetNetworkDiagnostics::Id); } case EthernetNetworkDiagnostics::Attributes::FeatureMap::Id: { uint32_t value; @@ -11170,12 +11170,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TimeSynchronization::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, TimeSynchronization::Id); } case TimeSynchronization::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, TimeSynchronization::Id); } case TimeSynchronization::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11185,7 +11185,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TimeSynchronization::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, TimeSynchronization::Id); } case TimeSynchronization::Attributes::FeatureMap::Id: { uint32_t value; @@ -11291,12 +11291,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BridgedDeviceBasicInformation::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BridgedDeviceBasicInformation::Id); } case BridgedDeviceBasicInformation::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BridgedDeviceBasicInformation::Id); } case BridgedDeviceBasicInformation::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11306,7 +11306,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BridgedDeviceBasicInformation::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, BridgedDeviceBasicInformation::Id); } case BridgedDeviceBasicInformation::Attributes::FeatureMap::Id: { uint32_t value; @@ -11342,12 +11342,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Switch::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Switch::Id); } case Switch::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Switch::Id); } case Switch::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11357,7 +11357,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Switch::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Switch::Id); } case Switch::Attributes::FeatureMap::Id: { uint32_t value; @@ -11393,12 +11393,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AdministratorCommissioning::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, AdministratorCommissioning::Id); } case AdministratorCommissioning::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, AdministratorCommissioning::Id); } case AdministratorCommissioning::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11408,7 +11408,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AdministratorCommissioning::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, AdministratorCommissioning::Id); } case AdministratorCommissioning::Attributes::FeatureMap::Id: { uint32_t value; @@ -11462,12 +11462,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OperationalCredentials::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OperationalCredentials::Id); } case OperationalCredentials::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OperationalCredentials::Id); } case OperationalCredentials::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11477,7 +11477,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OperationalCredentials::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OperationalCredentials::Id); } case OperationalCredentials::Attributes::FeatureMap::Id: { uint32_t value; @@ -11520,12 +11520,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case GroupKeyManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, GroupKeyManagement::Id); } case GroupKeyManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, GroupKeyManagement::Id); } case GroupKeyManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11535,7 +11535,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case GroupKeyManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, GroupKeyManagement::Id); } case GroupKeyManagement::Attributes::FeatureMap::Id: { uint32_t value; @@ -11561,12 +11561,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FixedLabel::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, FixedLabel::Id); } case FixedLabel::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, FixedLabel::Id); } case FixedLabel::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11576,7 +11576,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FixedLabel::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, FixedLabel::Id); } case FixedLabel::Attributes::FeatureMap::Id: { uint32_t value; @@ -11602,12 +11602,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case UserLabel::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, UserLabel::Id); } case UserLabel::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, UserLabel::Id); } case UserLabel::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11617,7 +11617,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case UserLabel::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, UserLabel::Id); } case UserLabel::Attributes::FeatureMap::Id: { uint32_t value; @@ -11638,12 +11638,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ProxyConfiguration::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ProxyConfiguration::Id); } case ProxyConfiguration::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ProxyConfiguration::Id); } case ProxyConfiguration::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11653,7 +11653,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ProxyConfiguration::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ProxyConfiguration::Id); } case ProxyConfiguration::Attributes::FeatureMap::Id: { uint32_t value; @@ -11674,12 +11674,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ProxyDiscovery::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ProxyDiscovery::Id); } case ProxyDiscovery::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ProxyDiscovery::Id); } case ProxyDiscovery::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11689,7 +11689,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ProxyDiscovery::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ProxyDiscovery::Id); } case ProxyDiscovery::Attributes::FeatureMap::Id: { uint32_t value; @@ -11710,12 +11710,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ProxyValid::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ProxyValid::Id); } case ProxyValid::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ProxyValid::Id); } case ProxyValid::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11725,7 +11725,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ProxyValid::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ProxyValid::Id); } case ProxyValid::Attributes::FeatureMap::Id: { uint32_t value; @@ -11751,12 +11751,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BooleanState::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BooleanState::Id); } case BooleanState::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BooleanState::Id); } case BooleanState::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11766,7 +11766,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BooleanState::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, BooleanState::Id); } case BooleanState::Attributes::FeatureMap::Id: { uint32_t value; @@ -11839,12 +11839,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case IcdManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, IcdManagement::Id); } case IcdManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, IcdManagement::Id); } case IcdManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11854,7 +11854,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case IcdManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, IcdManagement::Id); } case IcdManagement::Attributes::FeatureMap::Id: { uint32_t value; @@ -11890,12 +11890,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Timer::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Timer::Id); } case Timer::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Timer::Id); } case Timer::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11905,7 +11905,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Timer::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Timer::Id); } case Timer::Attributes::FeatureMap::Id: { uint32_t value; @@ -11958,12 +11958,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OvenCavityOperationalState::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OvenCavityOperationalState::Id); } case OvenCavityOperationalState::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OvenCavityOperationalState::Id); } case OvenCavityOperationalState::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -11973,7 +11973,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OvenCavityOperationalState::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OvenCavityOperationalState::Id); } case OvenCavityOperationalState::Attributes::FeatureMap::Id: { uint32_t value; @@ -12014,12 +12014,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OvenMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OvenMode::Id); } case OvenMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OvenMode::Id); } case OvenMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12029,7 +12029,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OvenMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OvenMode::Id); } case OvenMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -12060,12 +12060,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LaundryDryerControls::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, LaundryDryerControls::Id); } case LaundryDryerControls::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, LaundryDryerControls::Id); } case LaundryDryerControls::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12075,7 +12075,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LaundryDryerControls::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, LaundryDryerControls::Id); } case LaundryDryerControls::Attributes::FeatureMap::Id: { uint32_t value; @@ -12126,12 +12126,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ModeSelect::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ModeSelect::Id); } case ModeSelect::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ModeSelect::Id); } case ModeSelect::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12141,7 +12141,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ModeSelect::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ModeSelect::Id); } case ModeSelect::Attributes::FeatureMap::Id: { uint32_t value; @@ -12183,12 +12183,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LaundryWasherMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, LaundryWasherMode::Id); } case LaundryWasherMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, LaundryWasherMode::Id); } case LaundryWasherMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12198,7 +12198,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LaundryWasherMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, LaundryWasherMode::Id); } case LaundryWasherMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -12241,12 +12241,14 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + RefrigeratorAndTemperatureControlledCabinetMode::Id); } case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, + RefrigeratorAndTemperatureControlledCabinetMode::Id); } case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12256,7 +12258,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, RefrigeratorAndTemperatureControlledCabinetMode::Id); } case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -12297,12 +12299,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LaundryWasherControls::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, LaundryWasherControls::Id); } case LaundryWasherControls::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, LaundryWasherControls::Id); } case LaundryWasherControls::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12312,7 +12314,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LaundryWasherControls::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, LaundryWasherControls::Id); } case LaundryWasherControls::Attributes::FeatureMap::Id: { uint32_t value; @@ -12343,12 +12345,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RvcRunMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, RvcRunMode::Id); } case RvcRunMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, RvcRunMode::Id); } case RvcRunMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12358,7 +12360,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RvcRunMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, RvcRunMode::Id); } case RvcRunMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -12389,12 +12391,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RvcCleanMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, RvcCleanMode::Id); } case RvcCleanMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, RvcCleanMode::Id); } case RvcCleanMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12404,7 +12406,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RvcCleanMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, RvcCleanMode::Id); } case RvcCleanMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -12455,12 +12457,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TemperatureControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, TemperatureControl::Id); } case TemperatureControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, TemperatureControl::Id); } case TemperatureControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12470,7 +12472,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TemperatureControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, TemperatureControl::Id); } case TemperatureControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -12506,12 +12508,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RefrigeratorAlarm::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, RefrigeratorAlarm::Id); } case RefrigeratorAlarm::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, RefrigeratorAlarm::Id); } case RefrigeratorAlarm::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12521,7 +12523,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RefrigeratorAlarm::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, RefrigeratorAlarm::Id); } case RefrigeratorAlarm::Attributes::FeatureMap::Id: { uint32_t value; @@ -12563,12 +12565,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DishwasherMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, DishwasherMode::Id); } case DishwasherMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, DishwasherMode::Id); } case DishwasherMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12578,7 +12580,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DishwasherMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, DishwasherMode::Id); } case DishwasherMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -12604,12 +12606,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AirQuality::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, AirQuality::Id); } case AirQuality::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, AirQuality::Id); } case AirQuality::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12619,7 +12621,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AirQuality::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, AirQuality::Id); } case AirQuality::Attributes::FeatureMap::Id: { uint32_t value; @@ -12705,12 +12707,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case SmokeCoAlarm::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, SmokeCoAlarm::Id); } case SmokeCoAlarm::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, SmokeCoAlarm::Id); } case SmokeCoAlarm::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12720,7 +12722,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case SmokeCoAlarm::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, SmokeCoAlarm::Id); } case SmokeCoAlarm::Attributes::FeatureMap::Id: { uint32_t value; @@ -12761,12 +12763,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DishwasherAlarm::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, DishwasherAlarm::Id); } case DishwasherAlarm::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, DishwasherAlarm::Id); } case DishwasherAlarm::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12776,7 +12778,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DishwasherAlarm::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, DishwasherAlarm::Id); } case DishwasherAlarm::Attributes::FeatureMap::Id: { uint32_t value; @@ -12808,12 +12810,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case MicrowaveOvenMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, MicrowaveOvenMode::Id); } case MicrowaveOvenMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, MicrowaveOvenMode::Id); } case MicrowaveOvenMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12823,7 +12825,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case MicrowaveOvenMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, MicrowaveOvenMode::Id); } case MicrowaveOvenMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -12889,12 +12891,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case MicrowaveOvenControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, MicrowaveOvenControl::Id); } case MicrowaveOvenControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, MicrowaveOvenControl::Id); } case MicrowaveOvenControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12904,7 +12906,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case MicrowaveOvenControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, MicrowaveOvenControl::Id); } case MicrowaveOvenControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -12957,12 +12959,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OperationalState::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OperationalState::Id); } case OperationalState::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OperationalState::Id); } case OperationalState::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -12972,7 +12974,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OperationalState::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OperationalState::Id); } case OperationalState::Attributes::FeatureMap::Id: { uint32_t value; @@ -13025,12 +13027,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RvcOperationalState::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, RvcOperationalState::Id); } case RvcOperationalState::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, RvcOperationalState::Id); } case RvcOperationalState::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13040,7 +13042,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RvcOperationalState::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, RvcOperationalState::Id); } case RvcOperationalState::Attributes::FeatureMap::Id: { uint32_t value; @@ -13077,12 +13079,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ScenesManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ScenesManagement::Id); } case ScenesManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ScenesManagement::Id); } case ScenesManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13092,7 +13094,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ScenesManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ScenesManagement::Id); } case ScenesManagement::Attributes::FeatureMap::Id: { uint32_t value; @@ -13145,12 +13147,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case HepaFilterMonitoring::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, HepaFilterMonitoring::Id); } case HepaFilterMonitoring::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, HepaFilterMonitoring::Id); } case HepaFilterMonitoring::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13160,7 +13162,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case HepaFilterMonitoring::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, HepaFilterMonitoring::Id); } case HepaFilterMonitoring::Attributes::FeatureMap::Id: { uint32_t value; @@ -13213,12 +13215,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ActivatedCarbonFilterMonitoring::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ActivatedCarbonFilterMonitoring::Id); } case ActivatedCarbonFilterMonitoring::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ActivatedCarbonFilterMonitoring::Id); } case ActivatedCarbonFilterMonitoring::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13228,7 +13230,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ActivatedCarbonFilterMonitoring::Id); } case ActivatedCarbonFilterMonitoring::Attributes::FeatureMap::Id: { uint32_t value; @@ -13289,12 +13291,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BooleanStateConfiguration::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BooleanStateConfiguration::Id); } case BooleanStateConfiguration::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BooleanStateConfiguration::Id); } case BooleanStateConfiguration::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13304,7 +13306,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BooleanStateConfiguration::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, BooleanStateConfiguration::Id); } case BooleanStateConfiguration::Attributes::FeatureMap::Id: { uint32_t value; @@ -13380,12 +13382,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ValveConfigurationAndControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ValveConfigurationAndControl::Id); } case ValveConfigurationAndControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ValveConfigurationAndControl::Id); } case ValveConfigurationAndControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13395,7 +13397,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ValveConfigurationAndControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ValveConfigurationAndControl::Id); } case ValveConfigurationAndControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -13519,12 +13521,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ElectricalPowerMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ElectricalPowerMeasurement::Id); } case ElectricalPowerMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ElectricalPowerMeasurement::Id); } case ElectricalPowerMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13534,7 +13536,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ElectricalPowerMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ElectricalPowerMeasurement::Id); } case ElectricalPowerMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -13595,12 +13597,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ElectricalEnergyMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ElectricalEnergyMeasurement::Id); } case ElectricalEnergyMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ElectricalEnergyMeasurement::Id); } case ElectricalEnergyMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13610,7 +13612,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ElectricalEnergyMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ElectricalEnergyMeasurement::Id); } case ElectricalEnergyMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -13661,12 +13663,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WaterHeaterManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WaterHeaterManagement::Id); } case WaterHeaterManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WaterHeaterManagement::Id); } case WaterHeaterManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13676,7 +13678,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WaterHeaterManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WaterHeaterManagement::Id); } case WaterHeaterManagement::Attributes::FeatureMap::Id: { uint32_t value; @@ -13743,12 +13745,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DemandResponseLoadControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, DemandResponseLoadControl::Id); } case DemandResponseLoadControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, DemandResponseLoadControl::Id); } case DemandResponseLoadControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13758,7 +13760,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DemandResponseLoadControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, DemandResponseLoadControl::Id); } case DemandResponseLoadControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -13789,12 +13791,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Messages::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Messages::Id); } case Messages::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Messages::Id); } case Messages::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13804,7 +13806,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Messages::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Messages::Id); } case Messages::Attributes::FeatureMap::Id: { uint32_t value; @@ -13868,12 +13870,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DeviceEnergyManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, DeviceEnergyManagement::Id); } case DeviceEnergyManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, DeviceEnergyManagement::Id); } case DeviceEnergyManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -13883,7 +13885,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DeviceEnergyManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, DeviceEnergyManagement::Id); } case DeviceEnergyManagement::Attributes::FeatureMap::Id: { uint32_t value; @@ -14019,12 +14021,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EnergyEvse::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, EnergyEvse::Id); } case EnergyEvse::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, EnergyEvse::Id); } case EnergyEvse::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14034,7 +14036,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EnergyEvse::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, EnergyEvse::Id); } case EnergyEvse::Attributes::FeatureMap::Id: { uint32_t value; @@ -14080,12 +14082,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EnergyPreference::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, EnergyPreference::Id); } case EnergyPreference::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, EnergyPreference::Id); } case EnergyPreference::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14095,7 +14097,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EnergyPreference::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, EnergyPreference::Id); } case EnergyPreference::Attributes::FeatureMap::Id: { uint32_t value; @@ -14126,12 +14128,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PowerTopology::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PowerTopology::Id); } case PowerTopology::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PowerTopology::Id); } case PowerTopology::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14141,7 +14143,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PowerTopology::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, PowerTopology::Id); } case PowerTopology::Attributes::FeatureMap::Id: { uint32_t value; @@ -14183,12 +14185,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EnergyEvseMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, EnergyEvseMode::Id); } case EnergyEvseMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, EnergyEvseMode::Id); } case EnergyEvseMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14198,7 +14200,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EnergyEvseMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, EnergyEvseMode::Id); } case EnergyEvseMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -14240,12 +14242,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WaterHeaterMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WaterHeaterMode::Id); } case WaterHeaterMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WaterHeaterMode::Id); } case WaterHeaterMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14255,7 +14257,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WaterHeaterMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WaterHeaterMode::Id); } case WaterHeaterMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -14298,12 +14300,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DeviceEnergyManagementMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, DeviceEnergyManagementMode::Id); } case DeviceEnergyManagementMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, DeviceEnergyManagementMode::Id); } case DeviceEnergyManagementMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14313,7 +14315,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DeviceEnergyManagementMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, DeviceEnergyManagementMode::Id); } case DeviceEnergyManagementMode::Attributes::FeatureMap::Id: { uint32_t value; @@ -14559,12 +14561,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DoorLock::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, DoorLock::Id); } case DoorLock::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, DoorLock::Id); } case DoorLock::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14574,7 +14576,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case DoorLock::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, DoorLock::Id); } case DoorLock::Attributes::FeatureMap::Id: { uint32_t value; @@ -14705,12 +14707,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WindowCovering::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WindowCovering::Id); } case WindowCovering::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WindowCovering::Id); } case WindowCovering::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14720,7 +14722,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WindowCovering::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WindowCovering::Id); } case WindowCovering::Attributes::FeatureMap::Id: { uint32_t value; @@ -14791,12 +14793,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BarrierControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BarrierControl::Id); } case BarrierControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BarrierControl::Id); } case BarrierControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14806,7 +14808,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BarrierControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, BarrierControl::Id); } case BarrierControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -14857,12 +14859,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ServiceArea::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ServiceArea::Id); } case ServiceArea::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ServiceArea::Id); } case ServiceArea::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -14872,7 +14874,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ServiceArea::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ServiceArea::Id); } case ServiceArea::Attributes::FeatureMap::Id: { uint32_t value; @@ -15008,12 +15010,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PumpConfigurationAndControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PumpConfigurationAndControl::Id); } case PumpConfigurationAndControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PumpConfigurationAndControl::Id); } case PumpConfigurationAndControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -15023,7 +15025,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PumpConfigurationAndControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, PumpConfigurationAndControl::Id); } case PumpConfigurationAndControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -15344,12 +15346,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Thermostat::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Thermostat::Id); } case Thermostat::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Thermostat::Id); } case Thermostat::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -15359,7 +15361,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Thermostat::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Thermostat::Id); } case Thermostat::Attributes::FeatureMap::Id: { uint32_t value; @@ -15440,12 +15442,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FanControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, FanControl::Id); } case FanControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, FanControl::Id); } case FanControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -15455,7 +15457,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FanControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, FanControl::Id); } case FanControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -15491,12 +15493,13 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ThermostatUserInterfaceConfiguration::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + ThermostatUserInterfaceConfiguration::Id); } case ThermostatUserInterfaceConfiguration::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ThermostatUserInterfaceConfiguration::Id); } case ThermostatUserInterfaceConfiguration::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -15506,7 +15509,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ThermostatUserInterfaceConfiguration::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ThermostatUserInterfaceConfiguration::Id); } case ThermostatUserInterfaceConfiguration::Attributes::FeatureMap::Id: { uint32_t value; @@ -15787,12 +15790,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ColorControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ColorControl::Id); } case ColorControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ColorControl::Id); } case ColorControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -15802,7 +15805,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ColorControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ColorControl::Id); } case ColorControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -15893,12 +15896,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BallastConfiguration::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BallastConfiguration::Id); } case BallastConfiguration::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BallastConfiguration::Id); } case BallastConfiguration::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -15908,7 +15911,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case BallastConfiguration::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, BallastConfiguration::Id); } case BallastConfiguration::Attributes::FeatureMap::Id: { uint32_t value; @@ -15954,12 +15957,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case IlluminanceMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, IlluminanceMeasurement::Id); } case IlluminanceMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, IlluminanceMeasurement::Id); } case IlluminanceMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -15969,7 +15972,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case IlluminanceMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, IlluminanceMeasurement::Id); } case IlluminanceMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16010,12 +16013,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TemperatureMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, TemperatureMeasurement::Id); } case TemperatureMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, TemperatureMeasurement::Id); } case TemperatureMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16025,7 +16028,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TemperatureMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, TemperatureMeasurement::Id); } case TemperatureMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16091,12 +16094,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PressureMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PressureMeasurement::Id); } case PressureMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PressureMeasurement::Id); } case PressureMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16106,7 +16109,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case PressureMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, PressureMeasurement::Id); } case PressureMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16147,12 +16150,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FlowMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, FlowMeasurement::Id); } case FlowMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, FlowMeasurement::Id); } case FlowMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16162,7 +16165,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FlowMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, FlowMeasurement::Id); } case FlowMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16203,12 +16206,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RelativeHumidityMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, RelativeHumidityMeasurement::Id); } case RelativeHumidityMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, RelativeHumidityMeasurement::Id); } case RelativeHumidityMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16218,7 +16221,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RelativeHumidityMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, RelativeHumidityMeasurement::Id); } case RelativeHumidityMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16309,12 +16312,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OccupancySensing::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OccupancySensing::Id); } case OccupancySensing::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OccupancySensing::Id); } case OccupancySensing::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16324,7 +16327,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OccupancySensing::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OccupancySensing::Id); } case OccupancySensing::Attributes::FeatureMap::Id: { uint32_t value; @@ -16400,12 +16403,14 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case CarbonMonoxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + CarbonMonoxideConcentrationMeasurement::Id); } case CarbonMonoxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, + CarbonMonoxideConcentrationMeasurement::Id); } case CarbonMonoxideConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16415,7 +16420,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, CarbonMonoxideConcentrationMeasurement::Id); } case CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16491,12 +16496,14 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case CarbonDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + CarbonDioxideConcentrationMeasurement::Id); } case CarbonDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, + CarbonDioxideConcentrationMeasurement::Id); } case CarbonDioxideConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16506,7 +16513,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, CarbonDioxideConcentrationMeasurement::Id); } case CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16582,12 +16589,14 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case NitrogenDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + NitrogenDioxideConcentrationMeasurement::Id); } case NitrogenDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, + NitrogenDioxideConcentrationMeasurement::Id); } case NitrogenDioxideConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16597,7 +16606,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, NitrogenDioxideConcentrationMeasurement::Id); } case NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16673,12 +16682,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OzoneConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OzoneConcentrationMeasurement::Id); } case OzoneConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OzoneConcentrationMeasurement::Id); } case OzoneConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16688,7 +16697,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case OzoneConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OzoneConcentrationMeasurement::Id); } case OzoneConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16764,12 +16773,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Pm25ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Pm25ConcentrationMeasurement::Id); } case Pm25ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Pm25ConcentrationMeasurement::Id); } case Pm25ConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16779,7 +16788,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Pm25ConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Pm25ConcentrationMeasurement::Id); } case Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16855,12 +16864,13 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FormaldehydeConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + FormaldehydeConcentrationMeasurement::Id); } case FormaldehydeConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, FormaldehydeConcentrationMeasurement::Id); } case FormaldehydeConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16870,7 +16880,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, FormaldehydeConcentrationMeasurement::Id); } case FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -16946,12 +16956,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Pm1ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Pm1ConcentrationMeasurement::Id); } case Pm1ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Pm1ConcentrationMeasurement::Id); } case Pm1ConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -16961,7 +16971,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Pm1ConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Pm1ConcentrationMeasurement::Id); } case Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -17037,12 +17047,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Pm10ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Pm10ConcentrationMeasurement::Id); } case Pm10ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Pm10ConcentrationMeasurement::Id); } case Pm10ConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17052,7 +17062,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Pm10ConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Pm10ConcentrationMeasurement::Id); } case Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -17128,12 +17138,14 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Id); } case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Id); } case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17143,7 +17155,8 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Id); } case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -17219,12 +17232,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RadonConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, RadonConcentrationMeasurement::Id); } case RadonConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, RadonConcentrationMeasurement::Id); } case RadonConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17234,7 +17247,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case RadonConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, RadonConcentrationMeasurement::Id); } case RadonConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -17265,12 +17278,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WiFiNetworkManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WiFiNetworkManagement::Id); } case WiFiNetworkManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WiFiNetworkManagement::Id); } case WiFiNetworkManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17280,7 +17293,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WiFiNetworkManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WiFiNetworkManagement::Id); } case WiFiNetworkManagement::Attributes::FeatureMap::Id: { uint32_t value; @@ -17331,12 +17344,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ThreadBorderRouterManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ThreadBorderRouterManagement::Id); } case ThreadBorderRouterManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ThreadBorderRouterManagement::Id); } case ThreadBorderRouterManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17346,7 +17359,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ThreadBorderRouterManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ThreadBorderRouterManagement::Id); } case ThreadBorderRouterManagement::Attributes::FeatureMap::Id: { uint32_t value; @@ -17384,12 +17397,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ThreadNetworkDirectory::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ThreadNetworkDirectory::Id); } case ThreadNetworkDirectory::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ThreadNetworkDirectory::Id); } case ThreadNetworkDirectory::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17399,7 +17412,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ThreadNetworkDirectory::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ThreadNetworkDirectory::Id); } case ThreadNetworkDirectory::Attributes::FeatureMap::Id: { uint32_t value; @@ -17430,12 +17443,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WakeOnLan::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WakeOnLan::Id); } case WakeOnLan::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WakeOnLan::Id); } case WakeOnLan::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17445,7 +17458,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WakeOnLan::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WakeOnLan::Id); } case WakeOnLan::Attributes::FeatureMap::Id: { uint32_t value; @@ -17481,12 +17494,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Channel::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Channel::Id); } case Channel::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Channel::Id); } case Channel::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17496,7 +17509,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case Channel::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Channel::Id); } case Channel::Attributes::FeatureMap::Id: { uint32_t value; @@ -17528,12 +17541,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TargetNavigator::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, TargetNavigator::Id); } case TargetNavigator::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, TargetNavigator::Id); } case TargetNavigator::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17543,7 +17556,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case TargetNavigator::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, TargetNavigator::Id); } case TargetNavigator::Attributes::FeatureMap::Id: { uint32_t value; @@ -17624,12 +17637,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case MediaPlayback::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, MediaPlayback::Id); } case MediaPlayback::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, MediaPlayback::Id); } case MediaPlayback::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17639,7 +17652,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case MediaPlayback::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, MediaPlayback::Id); } case MediaPlayback::Attributes::FeatureMap::Id: { uint32_t value; @@ -17670,12 +17683,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case MediaInput::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, MediaInput::Id); } case MediaInput::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, MediaInput::Id); } case MediaInput::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17685,7 +17698,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case MediaInput::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, MediaInput::Id); } case MediaInput::Attributes::FeatureMap::Id: { uint32_t value; @@ -17706,12 +17719,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LowPower::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, LowPower::Id); } case LowPower::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, LowPower::Id); } case LowPower::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17721,7 +17734,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case LowPower::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, LowPower::Id); } case LowPower::Attributes::FeatureMap::Id: { uint32_t value; @@ -17742,12 +17755,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case KeypadInput::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, KeypadInput::Id); } case KeypadInput::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, KeypadInput::Id); } case KeypadInput::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17757,7 +17770,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case KeypadInput::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, KeypadInput::Id); } case KeypadInput::Attributes::FeatureMap::Id: { uint32_t value; @@ -17788,12 +17801,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ContentLauncher::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ContentLauncher::Id); } case ContentLauncher::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ContentLauncher::Id); } case ContentLauncher::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17803,7 +17816,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ContentLauncher::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ContentLauncher::Id); } case ContentLauncher::Attributes::FeatureMap::Id: { uint32_t value; @@ -17834,12 +17847,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AudioOutput::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, AudioOutput::Id); } case AudioOutput::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, AudioOutput::Id); } case AudioOutput::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17849,7 +17862,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AudioOutput::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, AudioOutput::Id); } case AudioOutput::Attributes::FeatureMap::Id: { uint32_t value; @@ -17881,12 +17894,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ApplicationLauncher::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ApplicationLauncher::Id); } case ApplicationLauncher::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ApplicationLauncher::Id); } case ApplicationLauncher::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17896,7 +17909,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ApplicationLauncher::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ApplicationLauncher::Id); } case ApplicationLauncher::Attributes::FeatureMap::Id: { uint32_t value; @@ -17957,12 +17970,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ApplicationBasic::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ApplicationBasic::Id); } case ApplicationBasic::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ApplicationBasic::Id); } case ApplicationBasic::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -17972,7 +17985,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ApplicationBasic::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ApplicationBasic::Id); } case ApplicationBasic::Attributes::FeatureMap::Id: { uint32_t value; @@ -17993,12 +18006,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AccountLogin::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, AccountLogin::Id); } case AccountLogin::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, AccountLogin::Id); } case AccountLogin::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -18008,7 +18021,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case AccountLogin::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, AccountLogin::Id); } case AccountLogin::Attributes::FeatureMap::Id: { uint32_t value; @@ -18071,12 +18084,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ContentControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ContentControl::Id); } case ContentControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ContentControl::Id); } case ContentControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -18086,7 +18099,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ContentControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ContentControl::Id); } case ContentControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -18107,12 +18120,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ContentAppObserver::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ContentAppObserver::Id); } case ContentAppObserver::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ContentAppObserver::Id); } case ContentAppObserver::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -18122,7 +18135,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ContentAppObserver::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ContentAppObserver::Id); } case ContentAppObserver::Attributes::FeatureMap::Id: { uint32_t value; @@ -18162,12 +18175,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EcosystemInformation::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, EcosystemInformation::Id); } case EcosystemInformation::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, EcosystemInformation::Id); } case EcosystemInformation::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -18177,7 +18190,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case EcosystemInformation::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, EcosystemInformation::Id); } case EcosystemInformation::Attributes::FeatureMap::Id: { uint32_t value; @@ -18203,12 +18216,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case CommissionerControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, CommissionerControl::Id); } case CommissionerControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, CommissionerControl::Id); } case CommissionerControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -18218,7 +18231,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case CommissionerControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, CommissionerControl::Id); } case CommissionerControl::Attributes::FeatureMap::Id: { uint32_t value; @@ -18879,12 +18892,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ElectricalMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ElectricalMeasurement::Id); } case ElectricalMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ElectricalMeasurement::Id); } case ElectricalMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -18894,7 +18907,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case ElectricalMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ElectricalMeasurement::Id); } case ElectricalMeasurement::Attributes::FeatureMap::Id: { uint32_t value; @@ -19348,12 +19361,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case UnitTesting::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, UnitTesting::Id); } case UnitTesting::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, UnitTesting::Id); } case UnitTesting::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -19363,7 +19376,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case UnitTesting::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, UnitTesting::Id); } case UnitTesting::Attributes::FeatureMap::Id: { uint32_t value; @@ -19389,12 +19402,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FaultInjection::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, FaultInjection::Id); } case FaultInjection::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, FaultInjection::Id); } case FaultInjection::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -19404,7 +19417,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case FaultInjection::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, FaultInjection::Id); } case FaultInjection::Attributes::FeatureMap::Id: { uint32_t value; @@ -19430,12 +19443,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case SampleMei::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, SampleMei::Id); } case SampleMei::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, SampleMei::Id); } case SampleMei::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; @@ -19445,7 +19458,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case SampleMei::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AttributeList", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, SampleMei::Id); } case SampleMei::Attributes::FeatureMap::Id: { uint32_t value; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp new file mode 100644 index 00000000000000..c97ff2590fa60b --- /dev/null +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -0,0 +1,6700 @@ +/* + * + * 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +#include +#include +#include + +char const * ClusterIdToText(chip::ClusterId id) +{ + switch (id) + { + case chip::app::Clusters::Identify::Id: + return "Identify"; + case chip::app::Clusters::Groups::Id: + return "Groups"; + case chip::app::Clusters::OnOff::Id: + return "OnOff"; + case chip::app::Clusters::OnOffSwitchConfiguration::Id: + return "OnOffSwitchConfiguration"; + case chip::app::Clusters::LevelControl::Id: + return "LevelControl"; + case chip::app::Clusters::BinaryInputBasic::Id: + return "BinaryInputBasic"; + case chip::app::Clusters::PulseWidthModulation::Id: + return "PulseWidthModulation"; + case chip::app::Clusters::Descriptor::Id: + return "Descriptor"; + case chip::app::Clusters::Binding::Id: + return "Binding"; + case chip::app::Clusters::AccessControl::Id: + return "AccessControl"; + case chip::app::Clusters::Actions::Id: + return "Actions"; + case chip::app::Clusters::BasicInformation::Id: + return "BasicInformation"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Id: + return "OtaSoftwareUpdateProvider"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Id: + return "OtaSoftwareUpdateRequestor"; + case chip::app::Clusters::LocalizationConfiguration::Id: + return "LocalizationConfiguration"; + case chip::app::Clusters::TimeFormatLocalization::Id: + return "TimeFormatLocalization"; + case chip::app::Clusters::UnitLocalization::Id: + return "UnitLocalization"; + case chip::app::Clusters::PowerSourceConfiguration::Id: + return "PowerSourceConfiguration"; + case chip::app::Clusters::PowerSource::Id: + return "PowerSource"; + case chip::app::Clusters::GeneralCommissioning::Id: + return "GeneralCommissioning"; + case chip::app::Clusters::NetworkCommissioning::Id: + return "NetworkCommissioning"; + case chip::app::Clusters::DiagnosticLogs::Id: + return "DiagnosticLogs"; + case chip::app::Clusters::GeneralDiagnostics::Id: + return "GeneralDiagnostics"; + case chip::app::Clusters::SoftwareDiagnostics::Id: + return "SoftwareDiagnostics"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Id: + return "ThreadNetworkDiagnostics"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Id: + return "WiFiNetworkDiagnostics"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Id: + return "EthernetNetworkDiagnostics"; + case chip::app::Clusters::TimeSynchronization::Id: + return "TimeSynchronization"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Id: + return "BridgedDeviceBasicInformation"; + case chip::app::Clusters::Switch::Id: + return "Switch"; + case chip::app::Clusters::AdministratorCommissioning::Id: + return "AdministratorCommissioning"; + case chip::app::Clusters::OperationalCredentials::Id: + return "OperationalCredentials"; + case chip::app::Clusters::GroupKeyManagement::Id: + return "GroupKeyManagement"; + case chip::app::Clusters::FixedLabel::Id: + return "FixedLabel"; + case chip::app::Clusters::UserLabel::Id: + return "UserLabel"; + case chip::app::Clusters::ProxyConfiguration::Id: + return "ProxyConfiguration"; + case chip::app::Clusters::ProxyDiscovery::Id: + return "ProxyDiscovery"; + case chip::app::Clusters::ProxyValid::Id: + return "ProxyValid"; + case chip::app::Clusters::BooleanState::Id: + return "BooleanState"; + case chip::app::Clusters::IcdManagement::Id: + return "IcdManagement"; + case chip::app::Clusters::Timer::Id: + return "Timer"; + case chip::app::Clusters::OvenCavityOperationalState::Id: + return "OvenCavityOperationalState"; + case chip::app::Clusters::OvenMode::Id: + return "OvenMode"; + case chip::app::Clusters::LaundryDryerControls::Id: + return "LaundryDryerControls"; + case chip::app::Clusters::ModeSelect::Id: + return "ModeSelect"; + case chip::app::Clusters::LaundryWasherMode::Id: + return "LaundryWasherMode"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id: + return "RefrigeratorAndTemperatureControlledCabinetMode"; + case chip::app::Clusters::LaundryWasherControls::Id: + return "LaundryWasherControls"; + case chip::app::Clusters::RvcRunMode::Id: + return "RvcRunMode"; + case chip::app::Clusters::RvcCleanMode::Id: + return "RvcCleanMode"; + case chip::app::Clusters::TemperatureControl::Id: + return "TemperatureControl"; + case chip::app::Clusters::RefrigeratorAlarm::Id: + return "RefrigeratorAlarm"; + case chip::app::Clusters::DishwasherMode::Id: + return "DishwasherMode"; + case chip::app::Clusters::AirQuality::Id: + return "AirQuality"; + case chip::app::Clusters::SmokeCoAlarm::Id: + return "SmokeCoAlarm"; + case chip::app::Clusters::DishwasherAlarm::Id: + return "DishwasherAlarm"; + case chip::app::Clusters::MicrowaveOvenMode::Id: + return "MicrowaveOvenMode"; + case chip::app::Clusters::MicrowaveOvenControl::Id: + return "MicrowaveOvenControl"; + case chip::app::Clusters::OperationalState::Id: + return "OperationalState"; + case chip::app::Clusters::RvcOperationalState::Id: + return "RvcOperationalState"; + case chip::app::Clusters::ScenesManagement::Id: + return "ScenesManagement"; + case chip::app::Clusters::HepaFilterMonitoring::Id: + return "HepaFilterMonitoring"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Id: + return "ActivatedCarbonFilterMonitoring"; + case chip::app::Clusters::BooleanStateConfiguration::Id: + return "BooleanStateConfiguration"; + case chip::app::Clusters::ValveConfigurationAndControl::Id: + return "ValveConfigurationAndControl"; + case chip::app::Clusters::ElectricalPowerMeasurement::Id: + return "ElectricalPowerMeasurement"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Id: + return "ElectricalEnergyMeasurement"; + case chip::app::Clusters::WaterHeaterManagement::Id: + return "WaterHeaterManagement"; + case chip::app::Clusters::DemandResponseLoadControl::Id: + return "DemandResponseLoadControl"; + case chip::app::Clusters::Messages::Id: + return "Messages"; + case chip::app::Clusters::DeviceEnergyManagement::Id: + return "DeviceEnergyManagement"; + case chip::app::Clusters::EnergyEvse::Id: + return "EnergyEvse"; + case chip::app::Clusters::EnergyPreference::Id: + return "EnergyPreference"; + case chip::app::Clusters::PowerTopology::Id: + return "PowerTopology"; + case chip::app::Clusters::EnergyEvseMode::Id: + return "EnergyEvseMode"; + case chip::app::Clusters::WaterHeaterMode::Id: + return "WaterHeaterMode"; + case chip::app::Clusters::DeviceEnergyManagementMode::Id: + return "DeviceEnergyManagementMode"; + case chip::app::Clusters::DoorLock::Id: + return "DoorLock"; + case chip::app::Clusters::WindowCovering::Id: + return "WindowCovering"; + case chip::app::Clusters::BarrierControl::Id: + return "BarrierControl"; + case chip::app::Clusters::ServiceArea::Id: + return "ServiceArea"; + case chip::app::Clusters::PumpConfigurationAndControl::Id: + return "PumpConfigurationAndControl"; + case chip::app::Clusters::Thermostat::Id: + return "Thermostat"; + case chip::app::Clusters::FanControl::Id: + return "FanControl"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Id: + return "ThermostatUserInterfaceConfiguration"; + case chip::app::Clusters::ColorControl::Id: + return "ColorControl"; + case chip::app::Clusters::BallastConfiguration::Id: + return "BallastConfiguration"; + case chip::app::Clusters::IlluminanceMeasurement::Id: + return "IlluminanceMeasurement"; + case chip::app::Clusters::TemperatureMeasurement::Id: + return "TemperatureMeasurement"; + case chip::app::Clusters::PressureMeasurement::Id: + return "PressureMeasurement"; + case chip::app::Clusters::FlowMeasurement::Id: + return "FlowMeasurement"; + case chip::app::Clusters::RelativeHumidityMeasurement::Id: + return "RelativeHumidityMeasurement"; + case chip::app::Clusters::OccupancySensing::Id: + return "OccupancySensing"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Id: + return "CarbonMonoxideConcentrationMeasurement"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Id: + return "CarbonDioxideConcentrationMeasurement"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Id: + return "NitrogenDioxideConcentrationMeasurement"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Id: + return "OzoneConcentrationMeasurement"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Id: + return "Pm25ConcentrationMeasurement"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Id: + return "FormaldehydeConcentrationMeasurement"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Id: + return "Pm1ConcentrationMeasurement"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Id: + return "Pm10ConcentrationMeasurement"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Id: + return "TotalVolatileOrganicCompoundsConcentrationMeasurement"; + case chip::app::Clusters::RadonConcentrationMeasurement::Id: + return "RadonConcentrationMeasurement"; + case chip::app::Clusters::WiFiNetworkManagement::Id: + return "WiFiNetworkManagement"; + case chip::app::Clusters::ThreadBorderRouterManagement::Id: + return "ThreadBorderRouterManagement"; + case chip::app::Clusters::ThreadNetworkDirectory::Id: + return "ThreadNetworkDirectory"; + case chip::app::Clusters::WakeOnLan::Id: + return "WakeOnLan"; + case chip::app::Clusters::Channel::Id: + return "Channel"; + case chip::app::Clusters::TargetNavigator::Id: + return "TargetNavigator"; + case chip::app::Clusters::MediaPlayback::Id: + return "MediaPlayback"; + case chip::app::Clusters::MediaInput::Id: + return "MediaInput"; + case chip::app::Clusters::LowPower::Id: + return "LowPower"; + case chip::app::Clusters::KeypadInput::Id: + return "KeypadInput"; + case chip::app::Clusters::ContentLauncher::Id: + return "ContentLauncher"; + case chip::app::Clusters::AudioOutput::Id: + return "AudioOutput"; + case chip::app::Clusters::ApplicationLauncher::Id: + return "ApplicationLauncher"; + case chip::app::Clusters::ApplicationBasic::Id: + return "ApplicationBasic"; + case chip::app::Clusters::AccountLogin::Id: + return "AccountLogin"; + case chip::app::Clusters::ContentControl::Id: + return "ContentControl"; + case chip::app::Clusters::ContentAppObserver::Id: + return "ContentAppObserver"; + case chip::app::Clusters::EcosystemInformation::Id: + return "EcosystemInformation"; + case chip::app::Clusters::CommissionerControl::Id: + return "CommissionerControl"; + case chip::app::Clusters::ElectricalMeasurement::Id: + return "ElectricalMeasurement"; + case chip::app::Clusters::UnitTesting::Id: + return "UnitTesting"; + case chip::app::Clusters::FaultInjection::Id: + return "FaultInjection"; + case chip::app::Clusters::SampleMei::Id: + return "SampleMei"; + default: + return "Unknown"; + } +} + +char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) +{ + switch (cluster) + { + case chip::app::Clusters::Identify::Id: { + switch (id) + { + case chip::app::Clusters::Identify::Attributes::IdentifyTime::Id: + return "IdentifyTime"; + case chip::app::Clusters::Identify::Attributes::IdentifyType::Id: + return "IdentifyType"; + case chip::app::Clusters::Identify::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Identify::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Identify::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Identify::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Identify::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Identify::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Groups::Id: { + switch (id) + { + case chip::app::Clusters::Groups::Attributes::NameSupport::Id: + return "NameSupport"; + case chip::app::Clusters::Groups::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Groups::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Groups::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Groups::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Groups::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Groups::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OnOff::Id: { + switch (id) + { + case chip::app::Clusters::OnOff::Attributes::OnOff::Id: + return "OnOff"; + case chip::app::Clusters::OnOff::Attributes::GlobalSceneControl::Id: + return "GlobalSceneControl"; + case chip::app::Clusters::OnOff::Attributes::OnTime::Id: + return "OnTime"; + case chip::app::Clusters::OnOff::Attributes::OffWaitTime::Id: + return "OffWaitTime"; + case chip::app::Clusters::OnOff::Attributes::StartUpOnOff::Id: + return "StartUpOnOff"; + case chip::app::Clusters::OnOff::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OnOff::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OnOff::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OnOff::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OnOff::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OnOff::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OnOffSwitchConfiguration::Id: { + switch (id) + { + case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchType::Id: + return "SwitchType"; + case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchActions::Id: + return "SwitchActions"; + case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LevelControl::Id: { + switch (id) + { + case chip::app::Clusters::LevelControl::Attributes::CurrentLevel::Id: + return "CurrentLevel"; + case chip::app::Clusters::LevelControl::Attributes::RemainingTime::Id: + return "RemainingTime"; + case chip::app::Clusters::LevelControl::Attributes::MinLevel::Id: + return "MinLevel"; + case chip::app::Clusters::LevelControl::Attributes::MaxLevel::Id: + return "MaxLevel"; + case chip::app::Clusters::LevelControl::Attributes::CurrentFrequency::Id: + return "CurrentFrequency"; + case chip::app::Clusters::LevelControl::Attributes::MinFrequency::Id: + return "MinFrequency"; + case chip::app::Clusters::LevelControl::Attributes::MaxFrequency::Id: + return "MaxFrequency"; + case chip::app::Clusters::LevelControl::Attributes::Options::Id: + return "Options"; + case chip::app::Clusters::LevelControl::Attributes::OnOffTransitionTime::Id: + return "OnOffTransitionTime"; + case chip::app::Clusters::LevelControl::Attributes::OnLevel::Id: + return "OnLevel"; + case chip::app::Clusters::LevelControl::Attributes::OnTransitionTime::Id: + return "OnTransitionTime"; + case chip::app::Clusters::LevelControl::Attributes::OffTransitionTime::Id: + return "OffTransitionTime"; + case chip::app::Clusters::LevelControl::Attributes::DefaultMoveRate::Id: + return "DefaultMoveRate"; + case chip::app::Clusters::LevelControl::Attributes::StartUpCurrentLevel::Id: + return "StartUpCurrentLevel"; + case chip::app::Clusters::LevelControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::LevelControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::LevelControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::LevelControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::LevelControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::LevelControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BinaryInputBasic::Id: { + switch (id) + { + case chip::app::Clusters::BinaryInputBasic::Attributes::ActiveText::Id: + return "ActiveText"; + case chip::app::Clusters::BinaryInputBasic::Attributes::Description::Id: + return "Description"; + case chip::app::Clusters::BinaryInputBasic::Attributes::InactiveText::Id: + return "InactiveText"; + case chip::app::Clusters::BinaryInputBasic::Attributes::OutOfService::Id: + return "OutOfService"; + case chip::app::Clusters::BinaryInputBasic::Attributes::Polarity::Id: + return "Polarity"; + case chip::app::Clusters::BinaryInputBasic::Attributes::PresentValue::Id: + return "PresentValue"; + case chip::app::Clusters::BinaryInputBasic::Attributes::Reliability::Id: + return "Reliability"; + case chip::app::Clusters::BinaryInputBasic::Attributes::StatusFlags::Id: + return "StatusFlags"; + case chip::app::Clusters::BinaryInputBasic::Attributes::ApplicationType::Id: + return "ApplicationType"; + case chip::app::Clusters::BinaryInputBasic::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::BinaryInputBasic::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::BinaryInputBasic::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::BinaryInputBasic::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::BinaryInputBasic::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::BinaryInputBasic::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::PulseWidthModulation::Id: { + switch (id) + { + case chip::app::Clusters::PulseWidthModulation::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::PulseWidthModulation::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::PulseWidthModulation::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::PulseWidthModulation::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::PulseWidthModulation::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::PulseWidthModulation::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Descriptor::Id: { + switch (id) + { + case chip::app::Clusters::Descriptor::Attributes::DeviceTypeList::Id: + return "DeviceTypeList"; + case chip::app::Clusters::Descriptor::Attributes::ServerList::Id: + return "ServerList"; + case chip::app::Clusters::Descriptor::Attributes::ClientList::Id: + return "ClientList"; + case chip::app::Clusters::Descriptor::Attributes::PartsList::Id: + return "PartsList"; + case chip::app::Clusters::Descriptor::Attributes::TagList::Id: + return "TagList"; + case chip::app::Clusters::Descriptor::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Descriptor::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Descriptor::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Descriptor::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Descriptor::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Descriptor::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Binding::Id: { + switch (id) + { + case chip::app::Clusters::Binding::Attributes::Binding::Id: + return "Binding"; + case chip::app::Clusters::Binding::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Binding::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Binding::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Binding::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Binding::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Binding::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AccessControl::Id: { + switch (id) + { + case chip::app::Clusters::AccessControl::Attributes::Acl::Id: + return "Acl"; + case chip::app::Clusters::AccessControl::Attributes::Extension::Id: + return "Extension"; + case chip::app::Clusters::AccessControl::Attributes::SubjectsPerAccessControlEntry::Id: + return "SubjectsPerAccessControlEntry"; + case chip::app::Clusters::AccessControl::Attributes::TargetsPerAccessControlEntry::Id: + return "TargetsPerAccessControlEntry"; + case chip::app::Clusters::AccessControl::Attributes::AccessControlEntriesPerFabric::Id: + return "AccessControlEntriesPerFabric"; + case chip::app::Clusters::AccessControl::Attributes::CommissioningARL::Id: + return "CommissioningARL"; + case chip::app::Clusters::AccessControl::Attributes::Arl::Id: + return "Arl"; + case chip::app::Clusters::AccessControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::AccessControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::AccessControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::AccessControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::AccessControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::AccessControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Actions::Id: { + switch (id) + { + case chip::app::Clusters::Actions::Attributes::ActionList::Id: + return "ActionList"; + case chip::app::Clusters::Actions::Attributes::EndpointLists::Id: + return "EndpointLists"; + case chip::app::Clusters::Actions::Attributes::SetupURL::Id: + return "SetupURL"; + case chip::app::Clusters::Actions::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Actions::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Actions::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Actions::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Actions::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Actions::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BasicInformation::Id: { + switch (id) + { + case chip::app::Clusters::BasicInformation::Attributes::DataModelRevision::Id: + return "DataModelRevision"; + case chip::app::Clusters::BasicInformation::Attributes::VendorName::Id: + return "VendorName"; + case chip::app::Clusters::BasicInformation::Attributes::VendorID::Id: + return "VendorID"; + case chip::app::Clusters::BasicInformation::Attributes::ProductName::Id: + return "ProductName"; + case chip::app::Clusters::BasicInformation::Attributes::ProductID::Id: + return "ProductID"; + case chip::app::Clusters::BasicInformation::Attributes::NodeLabel::Id: + return "NodeLabel"; + case chip::app::Clusters::BasicInformation::Attributes::Location::Id: + return "Location"; + case chip::app::Clusters::BasicInformation::Attributes::HardwareVersion::Id: + return "HardwareVersion"; + case chip::app::Clusters::BasicInformation::Attributes::HardwareVersionString::Id: + return "HardwareVersionString"; + case chip::app::Clusters::BasicInformation::Attributes::SoftwareVersion::Id: + return "SoftwareVersion"; + case chip::app::Clusters::BasicInformation::Attributes::SoftwareVersionString::Id: + return "SoftwareVersionString"; + case chip::app::Clusters::BasicInformation::Attributes::ManufacturingDate::Id: + return "ManufacturingDate"; + case chip::app::Clusters::BasicInformation::Attributes::PartNumber::Id: + return "PartNumber"; + case chip::app::Clusters::BasicInformation::Attributes::ProductURL::Id: + return "ProductURL"; + case chip::app::Clusters::BasicInformation::Attributes::ProductLabel::Id: + return "ProductLabel"; + case chip::app::Clusters::BasicInformation::Attributes::SerialNumber::Id: + return "SerialNumber"; + case chip::app::Clusters::BasicInformation::Attributes::LocalConfigDisabled::Id: + return "LocalConfigDisabled"; + case chip::app::Clusters::BasicInformation::Attributes::Reachable::Id: + return "Reachable"; + case chip::app::Clusters::BasicInformation::Attributes::UniqueID::Id: + return "UniqueID"; + case chip::app::Clusters::BasicInformation::Attributes::CapabilityMinima::Id: + return "CapabilityMinima"; + case chip::app::Clusters::BasicInformation::Attributes::ProductAppearance::Id: + return "ProductAppearance"; + case chip::app::Clusters::BasicInformation::Attributes::SpecificationVersion::Id: + return "SpecificationVersion"; + case chip::app::Clusters::BasicInformation::Attributes::MaxPathsPerInvoke::Id: + return "MaxPathsPerInvoke"; + case chip::app::Clusters::BasicInformation::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::BasicInformation::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::BasicInformation::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::BasicInformation::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::BasicInformation::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::BasicInformation::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OtaSoftwareUpdateProvider::Id: { + switch (id) + { + case chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Id: { + switch (id) + { + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::DefaultOTAProviders::Id: + return "DefaultOTAProviders"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdatePossible::Id: + return "UpdatePossible"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdateState::Id: + return "UpdateState"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdateStateProgress::Id: + return "UpdateStateProgress"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LocalizationConfiguration::Id: { + switch (id) + { + case chip::app::Clusters::LocalizationConfiguration::Attributes::ActiveLocale::Id: + return "ActiveLocale"; + case chip::app::Clusters::LocalizationConfiguration::Attributes::SupportedLocales::Id: + return "SupportedLocales"; + case chip::app::Clusters::LocalizationConfiguration::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::LocalizationConfiguration::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::LocalizationConfiguration::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::LocalizationConfiguration::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::LocalizationConfiguration::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::LocalizationConfiguration::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TimeFormatLocalization::Id: { + switch (id) + { + case chip::app::Clusters::TimeFormatLocalization::Attributes::HourFormat::Id: + return "HourFormat"; + case chip::app::Clusters::TimeFormatLocalization::Attributes::ActiveCalendarType::Id: + return "ActiveCalendarType"; + case chip::app::Clusters::TimeFormatLocalization::Attributes::SupportedCalendarTypes::Id: + return "SupportedCalendarTypes"; + case chip::app::Clusters::TimeFormatLocalization::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::TimeFormatLocalization::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::TimeFormatLocalization::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::TimeFormatLocalization::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::TimeFormatLocalization::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::TimeFormatLocalization::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::UnitLocalization::Id: { + switch (id) + { + case chip::app::Clusters::UnitLocalization::Attributes::TemperatureUnit::Id: + return "TemperatureUnit"; + case chip::app::Clusters::UnitLocalization::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::UnitLocalization::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::UnitLocalization::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::UnitLocalization::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::UnitLocalization::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::UnitLocalization::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::PowerSourceConfiguration::Id: { + switch (id) + { + case chip::app::Clusters::PowerSourceConfiguration::Attributes::Sources::Id: + return "Sources"; + case chip::app::Clusters::PowerSourceConfiguration::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::PowerSourceConfiguration::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::PowerSourceConfiguration::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::PowerSourceConfiguration::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::PowerSourceConfiguration::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::PowerSourceConfiguration::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::PowerSource::Id: { + switch (id) + { + case chip::app::Clusters::PowerSource::Attributes::Status::Id: + return "Status"; + case chip::app::Clusters::PowerSource::Attributes::Order::Id: + return "Order"; + case chip::app::Clusters::PowerSource::Attributes::Description::Id: + return "Description"; + case chip::app::Clusters::PowerSource::Attributes::WiredAssessedInputVoltage::Id: + return "WiredAssessedInputVoltage"; + case chip::app::Clusters::PowerSource::Attributes::WiredAssessedInputFrequency::Id: + return "WiredAssessedInputFrequency"; + case chip::app::Clusters::PowerSource::Attributes::WiredCurrentType::Id: + return "WiredCurrentType"; + case chip::app::Clusters::PowerSource::Attributes::WiredAssessedCurrent::Id: + return "WiredAssessedCurrent"; + case chip::app::Clusters::PowerSource::Attributes::WiredNominalVoltage::Id: + return "WiredNominalVoltage"; + case chip::app::Clusters::PowerSource::Attributes::WiredMaximumCurrent::Id: + return "WiredMaximumCurrent"; + case chip::app::Clusters::PowerSource::Attributes::WiredPresent::Id: + return "WiredPresent"; + case chip::app::Clusters::PowerSource::Attributes::ActiveWiredFaults::Id: + return "ActiveWiredFaults"; + case chip::app::Clusters::PowerSource::Attributes::BatVoltage::Id: + return "BatVoltage"; + case chip::app::Clusters::PowerSource::Attributes::BatPercentRemaining::Id: + return "BatPercentRemaining"; + case chip::app::Clusters::PowerSource::Attributes::BatTimeRemaining::Id: + return "BatTimeRemaining"; + case chip::app::Clusters::PowerSource::Attributes::BatChargeLevel::Id: + return "BatChargeLevel"; + case chip::app::Clusters::PowerSource::Attributes::BatReplacementNeeded::Id: + return "BatReplacementNeeded"; + case chip::app::Clusters::PowerSource::Attributes::BatReplaceability::Id: + return "BatReplaceability"; + case chip::app::Clusters::PowerSource::Attributes::BatPresent::Id: + return "BatPresent"; + case chip::app::Clusters::PowerSource::Attributes::ActiveBatFaults::Id: + return "ActiveBatFaults"; + case chip::app::Clusters::PowerSource::Attributes::BatReplacementDescription::Id: + return "BatReplacementDescription"; + case chip::app::Clusters::PowerSource::Attributes::BatCommonDesignation::Id: + return "BatCommonDesignation"; + case chip::app::Clusters::PowerSource::Attributes::BatANSIDesignation::Id: + return "BatANSIDesignation"; + case chip::app::Clusters::PowerSource::Attributes::BatIECDesignation::Id: + return "BatIECDesignation"; + case chip::app::Clusters::PowerSource::Attributes::BatApprovedChemistry::Id: + return "BatApprovedChemistry"; + case chip::app::Clusters::PowerSource::Attributes::BatCapacity::Id: + return "BatCapacity"; + case chip::app::Clusters::PowerSource::Attributes::BatQuantity::Id: + return "BatQuantity"; + case chip::app::Clusters::PowerSource::Attributes::BatChargeState::Id: + return "BatChargeState"; + case chip::app::Clusters::PowerSource::Attributes::BatTimeToFullCharge::Id: + return "BatTimeToFullCharge"; + case chip::app::Clusters::PowerSource::Attributes::BatFunctionalWhileCharging::Id: + return "BatFunctionalWhileCharging"; + case chip::app::Clusters::PowerSource::Attributes::BatChargingCurrent::Id: + return "BatChargingCurrent"; + case chip::app::Clusters::PowerSource::Attributes::ActiveBatChargeFaults::Id: + return "ActiveBatChargeFaults"; + case chip::app::Clusters::PowerSource::Attributes::EndpointList::Id: + return "EndpointList"; + case chip::app::Clusters::PowerSource::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::PowerSource::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::PowerSource::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::PowerSource::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::PowerSource::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::PowerSource::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GeneralCommissioning::Id: { + switch (id) + { + case chip::app::Clusters::GeneralCommissioning::Attributes::Breadcrumb::Id: + return "Breadcrumb"; + case chip::app::Clusters::GeneralCommissioning::Attributes::BasicCommissioningInfo::Id: + return "BasicCommissioningInfo"; + case chip::app::Clusters::GeneralCommissioning::Attributes::RegulatoryConfig::Id: + return "RegulatoryConfig"; + case chip::app::Clusters::GeneralCommissioning::Attributes::LocationCapability::Id: + return "LocationCapability"; + case chip::app::Clusters::GeneralCommissioning::Attributes::SupportsConcurrentConnection::Id: + return "SupportsConcurrentConnection"; + case chip::app::Clusters::GeneralCommissioning::Attributes::TCAcceptedVersion::Id: + return "TCAcceptedVersion"; + case chip::app::Clusters::GeneralCommissioning::Attributes::TCMinRequiredVersion::Id: + return "TCMinRequiredVersion"; + case chip::app::Clusters::GeneralCommissioning::Attributes::TCAcknowledgements::Id: + return "TCAcknowledgements"; + case chip::app::Clusters::GeneralCommissioning::Attributes::TCAcknowledgementsRequired::Id: + return "TCAcknowledgementsRequired"; + case chip::app::Clusters::GeneralCommissioning::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::GeneralCommissioning::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::GeneralCommissioning::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::GeneralCommissioning::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::GeneralCommissioning::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::GeneralCommissioning::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::NetworkCommissioning::Id: { + switch (id) + { + case chip::app::Clusters::NetworkCommissioning::Attributes::MaxNetworks::Id: + return "MaxNetworks"; + case chip::app::Clusters::NetworkCommissioning::Attributes::Networks::Id: + return "Networks"; + case chip::app::Clusters::NetworkCommissioning::Attributes::ScanMaxTimeSeconds::Id: + return "ScanMaxTimeSeconds"; + case chip::app::Clusters::NetworkCommissioning::Attributes::ConnectMaxTimeSeconds::Id: + return "ConnectMaxTimeSeconds"; + case chip::app::Clusters::NetworkCommissioning::Attributes::InterfaceEnabled::Id: + return "InterfaceEnabled"; + case chip::app::Clusters::NetworkCommissioning::Attributes::LastNetworkingStatus::Id: + return "LastNetworkingStatus"; + case chip::app::Clusters::NetworkCommissioning::Attributes::LastNetworkID::Id: + return "LastNetworkID"; + case chip::app::Clusters::NetworkCommissioning::Attributes::LastConnectErrorValue::Id: + return "LastConnectErrorValue"; + case chip::app::Clusters::NetworkCommissioning::Attributes::SupportedWiFiBands::Id: + return "SupportedWiFiBands"; + case chip::app::Clusters::NetworkCommissioning::Attributes::SupportedThreadFeatures::Id: + return "SupportedThreadFeatures"; + case chip::app::Clusters::NetworkCommissioning::Attributes::ThreadVersion::Id: + return "ThreadVersion"; + case chip::app::Clusters::NetworkCommissioning::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::NetworkCommissioning::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::NetworkCommissioning::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::NetworkCommissioning::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::NetworkCommissioning::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::NetworkCommissioning::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DiagnosticLogs::Id: { + switch (id) + { + case chip::app::Clusters::DiagnosticLogs::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::DiagnosticLogs::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::DiagnosticLogs::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::DiagnosticLogs::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::DiagnosticLogs::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::DiagnosticLogs::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GeneralDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::GeneralDiagnostics::Attributes::NetworkInterfaces::Id: + return "NetworkInterfaces"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::RebootCount::Id: + return "RebootCount"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::UpTime::Id: + return "UpTime"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::TotalOperationalHours::Id: + return "TotalOperationalHours"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::BootReason::Id: + return "BootReason"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::ActiveHardwareFaults::Id: + return "ActiveHardwareFaults"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::ActiveRadioFaults::Id: + return "ActiveRadioFaults"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::ActiveNetworkFaults::Id: + return "ActiveNetworkFaults"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::TestEventTriggersEnabled::Id: + return "TestEventTriggersEnabled"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::GeneralDiagnostics::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::SoftwareDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::SoftwareDiagnostics::Attributes::ThreadMetrics::Id: + return "ThreadMetrics"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapFree::Id: + return "CurrentHeapFree"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapUsed::Id: + return "CurrentHeapUsed"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapHighWatermark::Id: + return "CurrentHeapHighWatermark"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::SoftwareDiagnostics::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThreadNetworkDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::Channel::Id: + return "Channel"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RoutingRole::Id: + return "RoutingRole"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::NetworkName::Id: + return "NetworkName"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PanId::Id: + return "PanId"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ExtendedPanId::Id: + return "ExtendedPanId"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::MeshLocalPrefix::Id: + return "MeshLocalPrefix"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::OverrunCount::Id: + return "OverrunCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::NeighborTable::Id: + return "NeighborTable"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RouteTable::Id: + return "RouteTable"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PartitionId::Id: + return "PartitionId"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::Weighting::Id: + return "Weighting"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::DataVersion::Id: + return "DataVersion"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::StableDataVersion::Id: + return "StableDataVersion"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::LeaderRouterId::Id: + return "LeaderRouterId"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::DetachedRoleCount::Id: + return "DetachedRoleCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ChildRoleCount::Id: + return "ChildRoleCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RouterRoleCount::Id: + return "RouterRoleCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::LeaderRoleCount::Id: + return "LeaderRoleCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::AttachAttemptCount::Id: + return "AttachAttemptCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PartitionIdChangeCount::Id: + return "PartitionIdChangeCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::Id: + return "BetterPartitionAttachAttemptCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ParentChangeCount::Id: + return "ParentChangeCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxTotalCount::Id: + return "TxTotalCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxUnicastCount::Id: + return "TxUnicastCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::Id: + return "TxBroadcastCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::Id: + return "TxAckRequestedCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxAckedCount::Id: + return "TxAckedCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::Id: + return "TxNoAckRequestedCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDataCount::Id: + return "TxDataCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDataPollCount::Id: + return "TxDataPollCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBeaconCount::Id: + return "TxBeaconCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::Id: + return "TxBeaconRequestCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxOtherCount::Id: + return "TxOtherCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxRetryCount::Id: + return "TxRetryCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::Id: + return "TxDirectMaxRetryExpiryCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::Id: + return "TxIndirectMaxRetryExpiryCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::Id: + return "TxErrCcaCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::Id: + return "TxErrAbortCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::Id: + return "TxErrBusyChannelCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxTotalCount::Id: + return "RxTotalCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxUnicastCount::Id: + return "RxUnicastCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::Id: + return "RxBroadcastCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDataCount::Id: + return "RxDataCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDataPollCount::Id: + return "RxDataPollCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBeaconCount::Id: + return "RxBeaconCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::Id: + return "RxBeaconRequestCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxOtherCount::Id: + return "RxOtherCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::Id: + return "RxAddressFilteredCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::Id: + return "RxDestAddrFilteredCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::Id: + return "RxDuplicatedCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::Id: + return "RxErrNoFrameCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::Id: + return "RxErrUnknownNeighborCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrInvalidSrcAddrCount::Id: + return "RxErrInvalidSrcAddrCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrSecCount::Id: + return "RxErrSecCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::Id: + return "RxErrFcsCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::Id: + return "RxErrOtherCount"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ActiveTimestamp::Id: + return "ActiveTimestamp"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PendingTimestamp::Id: + return "PendingTimestamp"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::Delay::Id: + return "Delay"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::SecurityPolicy::Id: + return "SecurityPolicy"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ChannelPage0Mask::Id: + return "ChannelPage0Mask"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::OperationalDatasetComponents::Id: + return "OperationalDatasetComponents"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ActiveNetworkFaultsList::Id: + return "ActiveNetworkFaultsList"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WiFiNetworkDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::Bssid::Id: + return "Bssid"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::SecurityType::Id: + return "SecurityType"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::WiFiVersion::Id: + return "WiFiVersion"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::ChannelNumber::Id: + return "ChannelNumber"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::Rssi::Id: + return "Rssi"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::BeaconLostCount::Id: + return "BeaconLostCount"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::BeaconRxCount::Id: + return "BeaconRxCount"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketMulticastRxCount::Id: + return "PacketMulticastRxCount"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketMulticastTxCount::Id: + return "PacketMulticastTxCount"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketUnicastRxCount::Id: + return "PacketUnicastRxCount"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketUnicastTxCount::Id: + return "PacketUnicastTxCount"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::CurrentMaxRate::Id: + return "CurrentMaxRate"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::OverrunCount::Id: + return "OverrunCount"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EthernetNetworkDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PHYRate::Id: + return "PHYRate"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::FullDuplex::Id: + return "FullDuplex"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PacketRxCount::Id: + return "PacketRxCount"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PacketTxCount::Id: + return "PacketTxCount"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::TxErrCount::Id: + return "TxErrCount"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::CollisionCount::Id: + return "CollisionCount"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::OverrunCount::Id: + return "OverrunCount"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::CarrierDetect::Id: + return "CarrierDetect"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::TimeSinceReset::Id: + return "TimeSinceReset"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TimeSynchronization::Id: { + switch (id) + { + case chip::app::Clusters::TimeSynchronization::Attributes::UTCTime::Id: + return "UTCTime"; + case chip::app::Clusters::TimeSynchronization::Attributes::Granularity::Id: + return "Granularity"; + case chip::app::Clusters::TimeSynchronization::Attributes::TimeSource::Id: + return "TimeSource"; + case chip::app::Clusters::TimeSynchronization::Attributes::TrustedTimeSource::Id: + return "TrustedTimeSource"; + case chip::app::Clusters::TimeSynchronization::Attributes::DefaultNTP::Id: + return "DefaultNTP"; + case chip::app::Clusters::TimeSynchronization::Attributes::TimeZone::Id: + return "TimeZone"; + case chip::app::Clusters::TimeSynchronization::Attributes::DSTOffset::Id: + return "DSTOffset"; + case chip::app::Clusters::TimeSynchronization::Attributes::LocalTime::Id: + return "LocalTime"; + case chip::app::Clusters::TimeSynchronization::Attributes::TimeZoneDatabase::Id: + return "TimeZoneDatabase"; + case chip::app::Clusters::TimeSynchronization::Attributes::NTPServerAvailable::Id: + return "NTPServerAvailable"; + case chip::app::Clusters::TimeSynchronization::Attributes::TimeZoneListMaxSize::Id: + return "TimeZoneListMaxSize"; + case chip::app::Clusters::TimeSynchronization::Attributes::DSTOffsetListMaxSize::Id: + return "DSTOffsetListMaxSize"; + case chip::app::Clusters::TimeSynchronization::Attributes::SupportsDNSResolve::Id: + return "SupportsDNSResolve"; + case chip::app::Clusters::TimeSynchronization::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::TimeSynchronization::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::TimeSynchronization::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::TimeSynchronization::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::TimeSynchronization::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::TimeSynchronization::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BridgedDeviceBasicInformation::Id: { + switch (id) + { + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::VendorName::Id: + return "VendorName"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::VendorID::Id: + return "VendorID"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ProductName::Id: + return "ProductName"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ProductID::Id: + return "ProductID"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::NodeLabel::Id: + return "NodeLabel"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::HardwareVersion::Id: + return "HardwareVersion"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::HardwareVersionString::Id: + return "HardwareVersionString"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::SoftwareVersion::Id: + return "SoftwareVersion"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::SoftwareVersionString::Id: + return "SoftwareVersionString"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ManufacturingDate::Id: + return "ManufacturingDate"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::PartNumber::Id: + return "PartNumber"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ProductURL::Id: + return "ProductURL"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ProductLabel::Id: + return "ProductLabel"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::SerialNumber::Id: + return "SerialNumber"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::Reachable::Id: + return "Reachable"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::UniqueID::Id: + return "UniqueID"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ProductAppearance::Id: + return "ProductAppearance"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Switch::Id: { + switch (id) + { + case chip::app::Clusters::Switch::Attributes::NumberOfPositions::Id: + return "NumberOfPositions"; + case chip::app::Clusters::Switch::Attributes::CurrentPosition::Id: + return "CurrentPosition"; + case chip::app::Clusters::Switch::Attributes::MultiPressMax::Id: + return "MultiPressMax"; + case chip::app::Clusters::Switch::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Switch::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Switch::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Switch::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Switch::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Switch::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AdministratorCommissioning::Id: { + switch (id) + { + case chip::app::Clusters::AdministratorCommissioning::Attributes::WindowStatus::Id: + return "WindowStatus"; + case chip::app::Clusters::AdministratorCommissioning::Attributes::AdminFabricIndex::Id: + return "AdminFabricIndex"; + case chip::app::Clusters::AdministratorCommissioning::Attributes::AdminVendorId::Id: + return "AdminVendorId"; + case chip::app::Clusters::AdministratorCommissioning::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::AdministratorCommissioning::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::AdministratorCommissioning::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::AdministratorCommissioning::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::AdministratorCommissioning::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::AdministratorCommissioning::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OperationalCredentials::Id: { + switch (id) + { + case chip::app::Clusters::OperationalCredentials::Attributes::NOCs::Id: + return "NOCs"; + case chip::app::Clusters::OperationalCredentials::Attributes::Fabrics::Id: + return "Fabrics"; + case chip::app::Clusters::OperationalCredentials::Attributes::SupportedFabrics::Id: + return "SupportedFabrics"; + case chip::app::Clusters::OperationalCredentials::Attributes::CommissionedFabrics::Id: + return "CommissionedFabrics"; + case chip::app::Clusters::OperationalCredentials::Attributes::TrustedRootCertificates::Id: + return "TrustedRootCertificates"; + case chip::app::Clusters::OperationalCredentials::Attributes::CurrentFabricIndex::Id: + return "CurrentFabricIndex"; + case chip::app::Clusters::OperationalCredentials::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OperationalCredentials::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OperationalCredentials::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OperationalCredentials::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OperationalCredentials::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OperationalCredentials::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GroupKeyManagement::Id: { + switch (id) + { + case chip::app::Clusters::GroupKeyManagement::Attributes::GroupKeyMap::Id: + return "GroupKeyMap"; + case chip::app::Clusters::GroupKeyManagement::Attributes::GroupTable::Id: + return "GroupTable"; + case chip::app::Clusters::GroupKeyManagement::Attributes::MaxGroupsPerFabric::Id: + return "MaxGroupsPerFabric"; + case chip::app::Clusters::GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::Id: + return "MaxGroupKeysPerFabric"; + case chip::app::Clusters::GroupKeyManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::GroupKeyManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::GroupKeyManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::GroupKeyManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::GroupKeyManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::GroupKeyManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::FixedLabel::Id: { + switch (id) + { + case chip::app::Clusters::FixedLabel::Attributes::LabelList::Id: + return "LabelList"; + case chip::app::Clusters::FixedLabel::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::FixedLabel::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::FixedLabel::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::FixedLabel::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::FixedLabel::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::FixedLabel::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::UserLabel::Id: { + switch (id) + { + case chip::app::Clusters::UserLabel::Attributes::LabelList::Id: + return "LabelList"; + case chip::app::Clusters::UserLabel::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::UserLabel::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::UserLabel::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::UserLabel::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::UserLabel::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::UserLabel::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ProxyConfiguration::Id: { + switch (id) + { + case chip::app::Clusters::ProxyConfiguration::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ProxyConfiguration::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ProxyConfiguration::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ProxyConfiguration::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ProxyConfiguration::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ProxyConfiguration::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ProxyDiscovery::Id: { + switch (id) + { + case chip::app::Clusters::ProxyDiscovery::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ProxyDiscovery::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ProxyDiscovery::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ProxyDiscovery::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ProxyDiscovery::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ProxyDiscovery::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ProxyValid::Id: { + switch (id) + { + case chip::app::Clusters::ProxyValid::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ProxyValid::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ProxyValid::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ProxyValid::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ProxyValid::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ProxyValid::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BooleanState::Id: { + switch (id) + { + case chip::app::Clusters::BooleanState::Attributes::StateValue::Id: + return "StateValue"; + case chip::app::Clusters::BooleanState::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::BooleanState::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::BooleanState::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::BooleanState::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::BooleanState::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::BooleanState::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::IcdManagement::Id: { + switch (id) + { + case chip::app::Clusters::IcdManagement::Attributes::IdleModeDuration::Id: + return "IdleModeDuration"; + case chip::app::Clusters::IcdManagement::Attributes::ActiveModeDuration::Id: + return "ActiveModeDuration"; + case chip::app::Clusters::IcdManagement::Attributes::ActiveModeThreshold::Id: + return "ActiveModeThreshold"; + case chip::app::Clusters::IcdManagement::Attributes::RegisteredClients::Id: + return "RegisteredClients"; + case chip::app::Clusters::IcdManagement::Attributes::ICDCounter::Id: + return "ICDCounter"; + case chip::app::Clusters::IcdManagement::Attributes::ClientsSupportedPerFabric::Id: + return "ClientsSupportedPerFabric"; + case chip::app::Clusters::IcdManagement::Attributes::UserActiveModeTriggerHint::Id: + return "UserActiveModeTriggerHint"; + case chip::app::Clusters::IcdManagement::Attributes::UserActiveModeTriggerInstruction::Id: + return "UserActiveModeTriggerInstruction"; + case chip::app::Clusters::IcdManagement::Attributes::OperatingMode::Id: + return "OperatingMode"; + case chip::app::Clusters::IcdManagement::Attributes::MaximumCheckInBackOff::Id: + return "MaximumCheckInBackOff"; + case chip::app::Clusters::IcdManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::IcdManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::IcdManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::IcdManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::IcdManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::IcdManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Timer::Id: { + switch (id) + { + case chip::app::Clusters::Timer::Attributes::SetTime::Id: + return "SetTime"; + case chip::app::Clusters::Timer::Attributes::TimeRemaining::Id: + return "TimeRemaining"; + case chip::app::Clusters::Timer::Attributes::TimerState::Id: + return "TimerState"; + case chip::app::Clusters::Timer::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Timer::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Timer::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Timer::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Timer::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Timer::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OvenCavityOperationalState::Id: { + switch (id) + { + case chip::app::Clusters::OvenCavityOperationalState::Attributes::PhaseList::Id: + return "PhaseList"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::CurrentPhase::Id: + return "CurrentPhase"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::CountdownTime::Id: + return "CountdownTime"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::OperationalStateList::Id: + return "OperationalStateList"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::OperationalState::Id: + return "OperationalState"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::OperationalError::Id: + return "OperationalError"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OvenCavityOperationalState::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OvenMode::Id: { + switch (id) + { + case chip::app::Clusters::OvenMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::OvenMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::OvenMode::Attributes::StartUpMode::Id: + return "StartUpMode"; + case chip::app::Clusters::OvenMode::Attributes::OnMode::Id: + return "OnMode"; + case chip::app::Clusters::OvenMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OvenMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OvenMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OvenMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OvenMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OvenMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LaundryDryerControls::Id: { + switch (id) + { + case chip::app::Clusters::LaundryDryerControls::Attributes::SupportedDrynessLevels::Id: + return "SupportedDrynessLevels"; + case chip::app::Clusters::LaundryDryerControls::Attributes::SelectedDrynessLevel::Id: + return "SelectedDrynessLevel"; + case chip::app::Clusters::LaundryDryerControls::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::LaundryDryerControls::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::LaundryDryerControls::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::LaundryDryerControls::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::LaundryDryerControls::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::LaundryDryerControls::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ModeSelect::Id: { + switch (id) + { + case chip::app::Clusters::ModeSelect::Attributes::Description::Id: + return "Description"; + case chip::app::Clusters::ModeSelect::Attributes::StandardNamespace::Id: + return "StandardNamespace"; + case chip::app::Clusters::ModeSelect::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::ModeSelect::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::ModeSelect::Attributes::StartUpMode::Id: + return "StartUpMode"; + case chip::app::Clusters::ModeSelect::Attributes::OnMode::Id: + return "OnMode"; + case chip::app::Clusters::ModeSelect::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ModeSelect::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ModeSelect::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ModeSelect::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ModeSelect::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ModeSelect::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LaundryWasherMode::Id: { + switch (id) + { + case chip::app::Clusters::LaundryWasherMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::LaundryWasherMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::LaundryWasherMode::Attributes::StartUpMode::Id: + return "StartUpMode"; + case chip::app::Clusters::LaundryWasherMode::Attributes::OnMode::Id: + return "OnMode"; + case chip::app::Clusters::LaundryWasherMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::LaundryWasherMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::LaundryWasherMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::LaundryWasherMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::LaundryWasherMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::LaundryWasherMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id: { + switch (id) + { + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::StartUpMode::Id: + return "StartUpMode"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::OnMode::Id: + return "OnMode"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LaundryWasherControls::Id: { + switch (id) + { + case chip::app::Clusters::LaundryWasherControls::Attributes::SpinSpeeds::Id: + return "SpinSpeeds"; + case chip::app::Clusters::LaundryWasherControls::Attributes::SpinSpeedCurrent::Id: + return "SpinSpeedCurrent"; + case chip::app::Clusters::LaundryWasherControls::Attributes::NumberOfRinses::Id: + return "NumberOfRinses"; + case chip::app::Clusters::LaundryWasherControls::Attributes::SupportedRinses::Id: + return "SupportedRinses"; + case chip::app::Clusters::LaundryWasherControls::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::LaundryWasherControls::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::LaundryWasherControls::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::LaundryWasherControls::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::LaundryWasherControls::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::LaundryWasherControls::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcRunMode::Id: { + switch (id) + { + case chip::app::Clusters::RvcRunMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::RvcRunMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::RvcRunMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::RvcRunMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::RvcRunMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::RvcRunMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::RvcRunMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::RvcRunMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcCleanMode::Id: { + switch (id) + { + case chip::app::Clusters::RvcCleanMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::RvcCleanMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::RvcCleanMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::RvcCleanMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::RvcCleanMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::RvcCleanMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::RvcCleanMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::RvcCleanMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TemperatureControl::Id: { + switch (id) + { + case chip::app::Clusters::TemperatureControl::Attributes::TemperatureSetpoint::Id: + return "TemperatureSetpoint"; + case chip::app::Clusters::TemperatureControl::Attributes::MinTemperature::Id: + return "MinTemperature"; + case chip::app::Clusters::TemperatureControl::Attributes::MaxTemperature::Id: + return "MaxTemperature"; + case chip::app::Clusters::TemperatureControl::Attributes::Step::Id: + return "Step"; + case chip::app::Clusters::TemperatureControl::Attributes::SelectedTemperatureLevel::Id: + return "SelectedTemperatureLevel"; + case chip::app::Clusters::TemperatureControl::Attributes::SupportedTemperatureLevels::Id: + return "SupportedTemperatureLevels"; + case chip::app::Clusters::TemperatureControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::TemperatureControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::TemperatureControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::TemperatureControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::TemperatureControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::TemperatureControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RefrigeratorAlarm::Id: { + switch (id) + { + case chip::app::Clusters::RefrigeratorAlarm::Attributes::Mask::Id: + return "Mask"; + case chip::app::Clusters::RefrigeratorAlarm::Attributes::State::Id: + return "State"; + case chip::app::Clusters::RefrigeratorAlarm::Attributes::Supported::Id: + return "Supported"; + case chip::app::Clusters::RefrigeratorAlarm::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::RefrigeratorAlarm::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::RefrigeratorAlarm::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::RefrigeratorAlarm::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::RefrigeratorAlarm::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::RefrigeratorAlarm::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DishwasherMode::Id: { + switch (id) + { + case chip::app::Clusters::DishwasherMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::DishwasherMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::DishwasherMode::Attributes::StartUpMode::Id: + return "StartUpMode"; + case chip::app::Clusters::DishwasherMode::Attributes::OnMode::Id: + return "OnMode"; + case chip::app::Clusters::DishwasherMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::DishwasherMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::DishwasherMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::DishwasherMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::DishwasherMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::DishwasherMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AirQuality::Id: { + switch (id) + { + case chip::app::Clusters::AirQuality::Attributes::AirQuality::Id: + return "AirQuality"; + case chip::app::Clusters::AirQuality::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::AirQuality::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::AirQuality::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::AirQuality::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::AirQuality::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::AirQuality::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::SmokeCoAlarm::Id: { + switch (id) + { + case chip::app::Clusters::SmokeCoAlarm::Attributes::ExpressedState::Id: + return "ExpressedState"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::SmokeState::Id: + return "SmokeState"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::COState::Id: + return "COState"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::BatteryAlert::Id: + return "BatteryAlert"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::DeviceMuted::Id: + return "DeviceMuted"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::TestInProgress::Id: + return "TestInProgress"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::HardwareFaultAlert::Id: + return "HardwareFaultAlert"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::EndOfServiceAlert::Id: + return "EndOfServiceAlert"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::InterconnectSmokeAlarm::Id: + return "InterconnectSmokeAlarm"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::InterconnectCOAlarm::Id: + return "InterconnectCOAlarm"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::ContaminationState::Id: + return "ContaminationState"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::SmokeSensitivityLevel::Id: + return "SmokeSensitivityLevel"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::ExpiryDate::Id: + return "ExpiryDate"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::SmokeCoAlarm::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DishwasherAlarm::Id: { + switch (id) + { + case chip::app::Clusters::DishwasherAlarm::Attributes::Mask::Id: + return "Mask"; + case chip::app::Clusters::DishwasherAlarm::Attributes::Latch::Id: + return "Latch"; + case chip::app::Clusters::DishwasherAlarm::Attributes::State::Id: + return "State"; + case chip::app::Clusters::DishwasherAlarm::Attributes::Supported::Id: + return "Supported"; + case chip::app::Clusters::DishwasherAlarm::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::DishwasherAlarm::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::DishwasherAlarm::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::DishwasherAlarm::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::DishwasherAlarm::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::DishwasherAlarm::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::MicrowaveOvenMode::Id: { + switch (id) + { + case chip::app::Clusters::MicrowaveOvenMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::MicrowaveOvenMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::MicrowaveOvenMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::MicrowaveOvenMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::MicrowaveOvenMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::MicrowaveOvenMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::MicrowaveOvenMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::MicrowaveOvenMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::MicrowaveOvenControl::Id: { + switch (id) + { + case chip::app::Clusters::MicrowaveOvenControl::Attributes::CookTime::Id: + return "CookTime"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::MaxCookTime::Id: + return "MaxCookTime"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::PowerSetting::Id: + return "PowerSetting"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::MinPower::Id: + return "MinPower"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::MaxPower::Id: + return "MaxPower"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::PowerStep::Id: + return "PowerStep"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::SupportedWatts::Id: + return "SupportedWatts"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::SelectedWattIndex::Id: + return "SelectedWattIndex"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::WattRating::Id: + return "WattRating"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::MicrowaveOvenControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OperationalState::Id: { + switch (id) + { + case chip::app::Clusters::OperationalState::Attributes::PhaseList::Id: + return "PhaseList"; + case chip::app::Clusters::OperationalState::Attributes::CurrentPhase::Id: + return "CurrentPhase"; + case chip::app::Clusters::OperationalState::Attributes::CountdownTime::Id: + return "CountdownTime"; + case chip::app::Clusters::OperationalState::Attributes::OperationalStateList::Id: + return "OperationalStateList"; + case chip::app::Clusters::OperationalState::Attributes::OperationalState::Id: + return "OperationalState"; + case chip::app::Clusters::OperationalState::Attributes::OperationalError::Id: + return "OperationalError"; + case chip::app::Clusters::OperationalState::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OperationalState::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OperationalState::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OperationalState::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OperationalState::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OperationalState::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcOperationalState::Id: { + switch (id) + { + case chip::app::Clusters::RvcOperationalState::Attributes::PhaseList::Id: + return "PhaseList"; + case chip::app::Clusters::RvcOperationalState::Attributes::CurrentPhase::Id: + return "CurrentPhase"; + case chip::app::Clusters::RvcOperationalState::Attributes::CountdownTime::Id: + return "CountdownTime"; + case chip::app::Clusters::RvcOperationalState::Attributes::OperationalStateList::Id: + return "OperationalStateList"; + case chip::app::Clusters::RvcOperationalState::Attributes::OperationalState::Id: + return "OperationalState"; + case chip::app::Clusters::RvcOperationalState::Attributes::OperationalError::Id: + return "OperationalError"; + case chip::app::Clusters::RvcOperationalState::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::RvcOperationalState::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::RvcOperationalState::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::RvcOperationalState::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::RvcOperationalState::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::RvcOperationalState::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ScenesManagement::Id: { + switch (id) + { + case chip::app::Clusters::ScenesManagement::Attributes::LastConfiguredBy::Id: + return "LastConfiguredBy"; + case chip::app::Clusters::ScenesManagement::Attributes::SceneTableSize::Id: + return "SceneTableSize"; + case chip::app::Clusters::ScenesManagement::Attributes::FabricSceneInfo::Id: + return "FabricSceneInfo"; + case chip::app::Clusters::ScenesManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ScenesManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ScenesManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ScenesManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ScenesManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ScenesManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::HepaFilterMonitoring::Id: { + switch (id) + { + case chip::app::Clusters::HepaFilterMonitoring::Attributes::Condition::Id: + return "Condition"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::DegradationDirection::Id: + return "DegradationDirection"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::ChangeIndication::Id: + return "ChangeIndication"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::InPlaceIndicator::Id: + return "InPlaceIndicator"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::LastChangedTime::Id: + return "LastChangedTime"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::ReplacementProductList::Id: + return "ReplacementProductList"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::HepaFilterMonitoring::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Id: { + switch (id) + { + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::Condition::Id: + return "Condition"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::DegradationDirection::Id: + return "DegradationDirection"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::ChangeIndication::Id: + return "ChangeIndication"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::InPlaceIndicator::Id: + return "InPlaceIndicator"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::LastChangedTime::Id: + return "LastChangedTime"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::ReplacementProductList::Id: + return "ReplacementProductList"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BooleanStateConfiguration::Id: { + switch (id) + { + case chip::app::Clusters::BooleanStateConfiguration::Attributes::CurrentSensitivityLevel::Id: + return "CurrentSensitivityLevel"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::SupportedSensitivityLevels::Id: + return "SupportedSensitivityLevels"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::DefaultSensitivityLevel::Id: + return "DefaultSensitivityLevel"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::AlarmsActive::Id: + return "AlarmsActive"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::AlarmsSuppressed::Id: + return "AlarmsSuppressed"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::AlarmsEnabled::Id: + return "AlarmsEnabled"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::AlarmsSupported::Id: + return "AlarmsSupported"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::SensorFault::Id: + return "SensorFault"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::BooleanStateConfiguration::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ValveConfigurationAndControl::Id: { + switch (id) + { + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::OpenDuration::Id: + return "OpenDuration"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::DefaultOpenDuration::Id: + return "DefaultOpenDuration"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::AutoCloseTime::Id: + return "AutoCloseTime"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::RemainingDuration::Id: + return "RemainingDuration"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::CurrentState::Id: + return "CurrentState"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::TargetState::Id: + return "TargetState"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::CurrentLevel::Id: + return "CurrentLevel"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::TargetLevel::Id: + return "TargetLevel"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::DefaultOpenLevel::Id: + return "DefaultOpenLevel"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::ValveFault::Id: + return "ValveFault"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::LevelStep::Id: + return "LevelStep"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ValveConfigurationAndControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ElectricalPowerMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::PowerMode::Id: + return "PowerMode"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::NumberOfMeasurementTypes::Id: + return "NumberOfMeasurementTypes"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::Accuracy::Id: + return "Accuracy"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::Ranges::Id: + return "Ranges"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::Voltage::Id: + return "Voltage"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::ActiveCurrent::Id: + return "ActiveCurrent"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::ReactiveCurrent::Id: + return "ReactiveCurrent"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::ApparentCurrent::Id: + return "ApparentCurrent"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::ActivePower::Id: + return "ActivePower"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::ReactivePower::Id: + return "ReactivePower"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::ApparentPower::Id: + return "ApparentPower"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::RMSVoltage::Id: + return "RMSVoltage"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::RMSCurrent::Id: + return "RMSCurrent"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::RMSPower::Id: + return "RMSPower"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::Frequency::Id: + return "Frequency"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::HarmonicCurrents::Id: + return "HarmonicCurrents"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::HarmonicPhases::Id: + return "HarmonicPhases"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::PowerFactor::Id: + return "PowerFactor"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::NeutralCurrent::Id: + return "NeutralCurrent"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ElectricalPowerMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ElectricalEnergyMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::Accuracy::Id: + return "Accuracy"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::CumulativeEnergyImported::Id: + return "CumulativeEnergyImported"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::CumulativeEnergyExported::Id: + return "CumulativeEnergyExported"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::PeriodicEnergyImported::Id: + return "PeriodicEnergyImported"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::PeriodicEnergyExported::Id: + return "PeriodicEnergyExported"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::CumulativeEnergyReset::Id: + return "CumulativeEnergyReset"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ElectricalEnergyMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WaterHeaterManagement::Id: { + switch (id) + { + case chip::app::Clusters::WaterHeaterManagement::Attributes::HeaterTypes::Id: + return "HeaterTypes"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::HeatDemand::Id: + return "HeatDemand"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::TankVolume::Id: + return "TankVolume"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::EstimatedHeatRequired::Id: + return "EstimatedHeatRequired"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::TankPercentage::Id: + return "TankPercentage"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::BoostState::Id: + return "BoostState"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::WaterHeaterManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DemandResponseLoadControl::Id: { + switch (id) + { + case chip::app::Clusters::DemandResponseLoadControl::Attributes::LoadControlPrograms::Id: + return "LoadControlPrograms"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::NumberOfLoadControlPrograms::Id: + return "NumberOfLoadControlPrograms"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::Events::Id: + return "Events"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::ActiveEvents::Id: + return "ActiveEvents"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::NumberOfEventsPerProgram::Id: + return "NumberOfEventsPerProgram"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::NumberOfTransitions::Id: + return "NumberOfTransitions"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::DefaultRandomStart::Id: + return "DefaultRandomStart"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::DefaultRandomDuration::Id: + return "DefaultRandomDuration"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::DemandResponseLoadControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Messages::Id: { + switch (id) + { + case chip::app::Clusters::Messages::Attributes::Messages::Id: + return "Messages"; + case chip::app::Clusters::Messages::Attributes::ActiveMessageIDs::Id: + return "ActiveMessageIDs"; + case chip::app::Clusters::Messages::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Messages::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Messages::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Messages::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Messages::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Messages::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DeviceEnergyManagement::Id: { + switch (id) + { + case chip::app::Clusters::DeviceEnergyManagement::Attributes::ESAType::Id: + return "ESAType"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::ESACanGenerate::Id: + return "ESACanGenerate"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::ESAState::Id: + return "ESAState"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::AbsMinPower::Id: + return "AbsMinPower"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::AbsMaxPower::Id: + return "AbsMaxPower"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::PowerAdjustmentCapability::Id: + return "PowerAdjustmentCapability"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::Forecast::Id: + return "Forecast"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::OptOutState::Id: + return "OptOutState"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::DeviceEnergyManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EnergyEvse::Id: { + switch (id) + { + case chip::app::Clusters::EnergyEvse::Attributes::State::Id: + return "State"; + case chip::app::Clusters::EnergyEvse::Attributes::SupplyState::Id: + return "SupplyState"; + case chip::app::Clusters::EnergyEvse::Attributes::FaultState::Id: + return "FaultState"; + case chip::app::Clusters::EnergyEvse::Attributes::ChargingEnabledUntil::Id: + return "ChargingEnabledUntil"; + case chip::app::Clusters::EnergyEvse::Attributes::DischargingEnabledUntil::Id: + return "DischargingEnabledUntil"; + case chip::app::Clusters::EnergyEvse::Attributes::CircuitCapacity::Id: + return "CircuitCapacity"; + case chip::app::Clusters::EnergyEvse::Attributes::MinimumChargeCurrent::Id: + return "MinimumChargeCurrent"; + case chip::app::Clusters::EnergyEvse::Attributes::MaximumChargeCurrent::Id: + return "MaximumChargeCurrent"; + case chip::app::Clusters::EnergyEvse::Attributes::MaximumDischargeCurrent::Id: + return "MaximumDischargeCurrent"; + case chip::app::Clusters::EnergyEvse::Attributes::UserMaximumChargeCurrent::Id: + return "UserMaximumChargeCurrent"; + case chip::app::Clusters::EnergyEvse::Attributes::RandomizationDelayWindow::Id: + return "RandomizationDelayWindow"; + case chip::app::Clusters::EnergyEvse::Attributes::NextChargeStartTime::Id: + return "NextChargeStartTime"; + case chip::app::Clusters::EnergyEvse::Attributes::NextChargeTargetTime::Id: + return "NextChargeTargetTime"; + case chip::app::Clusters::EnergyEvse::Attributes::NextChargeRequiredEnergy::Id: + return "NextChargeRequiredEnergy"; + case chip::app::Clusters::EnergyEvse::Attributes::NextChargeTargetSoC::Id: + return "NextChargeTargetSoC"; + case chip::app::Clusters::EnergyEvse::Attributes::ApproximateEVEfficiency::Id: + return "ApproximateEVEfficiency"; + case chip::app::Clusters::EnergyEvse::Attributes::StateOfCharge::Id: + return "StateOfCharge"; + case chip::app::Clusters::EnergyEvse::Attributes::BatteryCapacity::Id: + return "BatteryCapacity"; + case chip::app::Clusters::EnergyEvse::Attributes::VehicleID::Id: + return "VehicleID"; + case chip::app::Clusters::EnergyEvse::Attributes::SessionID::Id: + return "SessionID"; + case chip::app::Clusters::EnergyEvse::Attributes::SessionDuration::Id: + return "SessionDuration"; + case chip::app::Clusters::EnergyEvse::Attributes::SessionEnergyCharged::Id: + return "SessionEnergyCharged"; + case chip::app::Clusters::EnergyEvse::Attributes::SessionEnergyDischarged::Id: + return "SessionEnergyDischarged"; + case chip::app::Clusters::EnergyEvse::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::EnergyEvse::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::EnergyEvse::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::EnergyEvse::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::EnergyEvse::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::EnergyEvse::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EnergyPreference::Id: { + switch (id) + { + case chip::app::Clusters::EnergyPreference::Attributes::EnergyBalances::Id: + return "EnergyBalances"; + case chip::app::Clusters::EnergyPreference::Attributes::CurrentEnergyBalance::Id: + return "CurrentEnergyBalance"; + case chip::app::Clusters::EnergyPreference::Attributes::EnergyPriorities::Id: + return "EnergyPriorities"; + case chip::app::Clusters::EnergyPreference::Attributes::LowPowerModeSensitivities::Id: + return "LowPowerModeSensitivities"; + case chip::app::Clusters::EnergyPreference::Attributes::CurrentLowPowerModeSensitivity::Id: + return "CurrentLowPowerModeSensitivity"; + case chip::app::Clusters::EnergyPreference::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::EnergyPreference::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::EnergyPreference::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::EnergyPreference::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::EnergyPreference::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::EnergyPreference::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::PowerTopology::Id: { + switch (id) + { + case chip::app::Clusters::PowerTopology::Attributes::AvailableEndpoints::Id: + return "AvailableEndpoints"; + case chip::app::Clusters::PowerTopology::Attributes::ActiveEndpoints::Id: + return "ActiveEndpoints"; + case chip::app::Clusters::PowerTopology::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::PowerTopology::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::PowerTopology::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::PowerTopology::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::PowerTopology::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::PowerTopology::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EnergyEvseMode::Id: { + switch (id) + { + case chip::app::Clusters::EnergyEvseMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::EnergyEvseMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::EnergyEvseMode::Attributes::StartUpMode::Id: + return "StartUpMode"; + case chip::app::Clusters::EnergyEvseMode::Attributes::OnMode::Id: + return "OnMode"; + case chip::app::Clusters::EnergyEvseMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::EnergyEvseMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::EnergyEvseMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::EnergyEvseMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::EnergyEvseMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::EnergyEvseMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WaterHeaterMode::Id: { + switch (id) + { + case chip::app::Clusters::WaterHeaterMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::WaterHeaterMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::WaterHeaterMode::Attributes::StartUpMode::Id: + return "StartUpMode"; + case chip::app::Clusters::WaterHeaterMode::Attributes::OnMode::Id: + return "OnMode"; + case chip::app::Clusters::WaterHeaterMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::WaterHeaterMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::WaterHeaterMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::WaterHeaterMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::WaterHeaterMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::WaterHeaterMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DeviceEnergyManagementMode::Id: { + switch (id) + { + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::SupportedModes::Id: + return "SupportedModes"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::CurrentMode::Id: + return "CurrentMode"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::StartUpMode::Id: + return "StartUpMode"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::OnMode::Id: + return "OnMode"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DoorLock::Id: { + switch (id) + { + case chip::app::Clusters::DoorLock::Attributes::LockState::Id: + return "LockState"; + case chip::app::Clusters::DoorLock::Attributes::LockType::Id: + return "LockType"; + case chip::app::Clusters::DoorLock::Attributes::ActuatorEnabled::Id: + return "ActuatorEnabled"; + case chip::app::Clusters::DoorLock::Attributes::DoorState::Id: + return "DoorState"; + case chip::app::Clusters::DoorLock::Attributes::DoorOpenEvents::Id: + return "DoorOpenEvents"; + case chip::app::Clusters::DoorLock::Attributes::DoorClosedEvents::Id: + return "DoorClosedEvents"; + case chip::app::Clusters::DoorLock::Attributes::OpenPeriod::Id: + return "OpenPeriod"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfTotalUsersSupported::Id: + return "NumberOfTotalUsersSupported"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfPINUsersSupported::Id: + return "NumberOfPINUsersSupported"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfRFIDUsersSupported::Id: + return "NumberOfRFIDUsersSupported"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfWeekDaySchedulesSupportedPerUser::Id: + return "NumberOfWeekDaySchedulesSupportedPerUser"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfYearDaySchedulesSupportedPerUser::Id: + return "NumberOfYearDaySchedulesSupportedPerUser"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfHolidaySchedulesSupported::Id: + return "NumberOfHolidaySchedulesSupported"; + case chip::app::Clusters::DoorLock::Attributes::MaxPINCodeLength::Id: + return "MaxPINCodeLength"; + case chip::app::Clusters::DoorLock::Attributes::MinPINCodeLength::Id: + return "MinPINCodeLength"; + case chip::app::Clusters::DoorLock::Attributes::MaxRFIDCodeLength::Id: + return "MaxRFIDCodeLength"; + case chip::app::Clusters::DoorLock::Attributes::MinRFIDCodeLength::Id: + return "MinRFIDCodeLength"; + case chip::app::Clusters::DoorLock::Attributes::CredentialRulesSupport::Id: + return "CredentialRulesSupport"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfCredentialsSupportedPerUser::Id: + return "NumberOfCredentialsSupportedPerUser"; + case chip::app::Clusters::DoorLock::Attributes::Language::Id: + return "Language"; + case chip::app::Clusters::DoorLock::Attributes::LEDSettings::Id: + return "LEDSettings"; + case chip::app::Clusters::DoorLock::Attributes::AutoRelockTime::Id: + return "AutoRelockTime"; + case chip::app::Clusters::DoorLock::Attributes::SoundVolume::Id: + return "SoundVolume"; + case chip::app::Clusters::DoorLock::Attributes::OperatingMode::Id: + return "OperatingMode"; + case chip::app::Clusters::DoorLock::Attributes::SupportedOperatingModes::Id: + return "SupportedOperatingModes"; + case chip::app::Clusters::DoorLock::Attributes::DefaultConfigurationRegister::Id: + return "DefaultConfigurationRegister"; + case chip::app::Clusters::DoorLock::Attributes::EnableLocalProgramming::Id: + return "EnableLocalProgramming"; + case chip::app::Clusters::DoorLock::Attributes::EnableOneTouchLocking::Id: + return "EnableOneTouchLocking"; + case chip::app::Clusters::DoorLock::Attributes::EnableInsideStatusLED::Id: + return "EnableInsideStatusLED"; + case chip::app::Clusters::DoorLock::Attributes::EnablePrivacyModeButton::Id: + return "EnablePrivacyModeButton"; + case chip::app::Clusters::DoorLock::Attributes::LocalProgrammingFeatures::Id: + return "LocalProgrammingFeatures"; + case chip::app::Clusters::DoorLock::Attributes::WrongCodeEntryLimit::Id: + return "WrongCodeEntryLimit"; + case chip::app::Clusters::DoorLock::Attributes::UserCodeTemporaryDisableTime::Id: + return "UserCodeTemporaryDisableTime"; + case chip::app::Clusters::DoorLock::Attributes::SendPINOverTheAir::Id: + return "SendPINOverTheAir"; + case chip::app::Clusters::DoorLock::Attributes::RequirePINforRemoteOperation::Id: + return "RequirePINforRemoteOperation"; + case chip::app::Clusters::DoorLock::Attributes::ExpiringUserTimeout::Id: + return "ExpiringUserTimeout"; + case chip::app::Clusters::DoorLock::Attributes::AliroReaderVerificationKey::Id: + return "AliroReaderVerificationKey"; + case chip::app::Clusters::DoorLock::Attributes::AliroReaderGroupIdentifier::Id: + return "AliroReaderGroupIdentifier"; + case chip::app::Clusters::DoorLock::Attributes::AliroReaderGroupSubIdentifier::Id: + return "AliroReaderGroupSubIdentifier"; + case chip::app::Clusters::DoorLock::Attributes::AliroExpeditedTransactionSupportedProtocolVersions::Id: + return "AliroExpeditedTransactionSupportedProtocolVersions"; + case chip::app::Clusters::DoorLock::Attributes::AliroGroupResolvingKey::Id: + return "AliroGroupResolvingKey"; + case chip::app::Clusters::DoorLock::Attributes::AliroSupportedBLEUWBProtocolVersions::Id: + return "AliroSupportedBLEUWBProtocolVersions"; + case chip::app::Clusters::DoorLock::Attributes::AliroBLEAdvertisingVersion::Id: + return "AliroBLEAdvertisingVersion"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfAliroCredentialIssuerKeysSupported::Id: + return "NumberOfAliroCredentialIssuerKeysSupported"; + case chip::app::Clusters::DoorLock::Attributes::NumberOfAliroEndpointKeysSupported::Id: + return "NumberOfAliroEndpointKeysSupported"; + case chip::app::Clusters::DoorLock::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::DoorLock::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::DoorLock::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::DoorLock::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::DoorLock::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::DoorLock::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WindowCovering::Id: { + switch (id) + { + case chip::app::Clusters::WindowCovering::Attributes::Type::Id: + return "Type"; + case chip::app::Clusters::WindowCovering::Attributes::PhysicalClosedLimitLift::Id: + return "PhysicalClosedLimitLift"; + case chip::app::Clusters::WindowCovering::Attributes::PhysicalClosedLimitTilt::Id: + return "PhysicalClosedLimitTilt"; + case chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLift::Id: + return "CurrentPositionLift"; + case chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTilt::Id: + return "CurrentPositionTilt"; + case chip::app::Clusters::WindowCovering::Attributes::NumberOfActuationsLift::Id: + return "NumberOfActuationsLift"; + case chip::app::Clusters::WindowCovering::Attributes::NumberOfActuationsTilt::Id: + return "NumberOfActuationsTilt"; + case chip::app::Clusters::WindowCovering::Attributes::ConfigStatus::Id: + return "ConfigStatus"; + case chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLiftPercentage::Id: + return "CurrentPositionLiftPercentage"; + case chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTiltPercentage::Id: + return "CurrentPositionTiltPercentage"; + case chip::app::Clusters::WindowCovering::Attributes::OperationalStatus::Id: + return "OperationalStatus"; + case chip::app::Clusters::WindowCovering::Attributes::TargetPositionLiftPercent100ths::Id: + return "TargetPositionLiftPercent100ths"; + case chip::app::Clusters::WindowCovering::Attributes::TargetPositionTiltPercent100ths::Id: + return "TargetPositionTiltPercent100ths"; + case chip::app::Clusters::WindowCovering::Attributes::EndProductType::Id: + return "EndProductType"; + case chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id: + return "CurrentPositionLiftPercent100ths"; + case chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id: + return "CurrentPositionTiltPercent100ths"; + case chip::app::Clusters::WindowCovering::Attributes::InstalledOpenLimitLift::Id: + return "InstalledOpenLimitLift"; + case chip::app::Clusters::WindowCovering::Attributes::InstalledClosedLimitLift::Id: + return "InstalledClosedLimitLift"; + case chip::app::Clusters::WindowCovering::Attributes::InstalledOpenLimitTilt::Id: + return "InstalledOpenLimitTilt"; + case chip::app::Clusters::WindowCovering::Attributes::InstalledClosedLimitTilt::Id: + return "InstalledClosedLimitTilt"; + case chip::app::Clusters::WindowCovering::Attributes::Mode::Id: + return "Mode"; + case chip::app::Clusters::WindowCovering::Attributes::SafetyStatus::Id: + return "SafetyStatus"; + case chip::app::Clusters::WindowCovering::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::WindowCovering::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::WindowCovering::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::WindowCovering::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::WindowCovering::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::WindowCovering::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BarrierControl::Id: { + switch (id) + { + case chip::app::Clusters::BarrierControl::Attributes::BarrierMovingState::Id: + return "BarrierMovingState"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierSafetyStatus::Id: + return "BarrierSafetyStatus"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierCapabilities::Id: + return "BarrierCapabilities"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierOpenEvents::Id: + return "BarrierOpenEvents"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierCloseEvents::Id: + return "BarrierCloseEvents"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierCommandOpenEvents::Id: + return "BarrierCommandOpenEvents"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierCommandCloseEvents::Id: + return "BarrierCommandCloseEvents"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierOpenPeriod::Id: + return "BarrierOpenPeriod"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierClosePeriod::Id: + return "BarrierClosePeriod"; + case chip::app::Clusters::BarrierControl::Attributes::BarrierPosition::Id: + return "BarrierPosition"; + case chip::app::Clusters::BarrierControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::BarrierControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::BarrierControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::BarrierControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::BarrierControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::BarrierControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ServiceArea::Id: { + switch (id) + { + case chip::app::Clusters::ServiceArea::Attributes::SupportedAreas::Id: + return "SupportedAreas"; + case chip::app::Clusters::ServiceArea::Attributes::SupportedMaps::Id: + return "SupportedMaps"; + case chip::app::Clusters::ServiceArea::Attributes::SelectedAreas::Id: + return "SelectedAreas"; + case chip::app::Clusters::ServiceArea::Attributes::CurrentArea::Id: + return "CurrentArea"; + case chip::app::Clusters::ServiceArea::Attributes::EstimatedEndTime::Id: + return "EstimatedEndTime"; + case chip::app::Clusters::ServiceArea::Attributes::Progress::Id: + return "Progress"; + case chip::app::Clusters::ServiceArea::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ServiceArea::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ServiceArea::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ServiceArea::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ServiceArea::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ServiceArea::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::PumpConfigurationAndControl::Id: { + switch (id) + { + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxPressure::Id: + return "MaxPressure"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxSpeed::Id: + return "MaxSpeed"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxFlow::Id: + return "MaxFlow"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstPressure::Id: + return "MinConstPressure"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstPressure::Id: + return "MaxConstPressure"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinCompPressure::Id: + return "MinCompPressure"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxCompPressure::Id: + return "MaxCompPressure"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstSpeed::Id: + return "MinConstSpeed"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstSpeed::Id: + return "MaxConstSpeed"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstFlow::Id: + return "MinConstFlow"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstFlow::Id: + return "MaxConstFlow"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstTemp::Id: + return "MinConstTemp"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstTemp::Id: + return "MaxConstTemp"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::PumpStatus::Id: + return "PumpStatus"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::EffectiveOperationMode::Id: + return "EffectiveOperationMode"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id: + return "EffectiveControlMode"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::Capacity::Id: + return "Capacity"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::Speed::Id: + return "Speed"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeRunningHours::Id: + return "LifetimeRunningHours"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::Power::Id: + return "Power"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::Id: + return "LifetimeEnergyConsumed"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::OperationMode::Id: + return "OperationMode"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::ControlMode::Id: + return "ControlMode"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::PumpConfigurationAndControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Thermostat::Id: { + switch (id) + { + case chip::app::Clusters::Thermostat::Attributes::LocalTemperature::Id: + return "LocalTemperature"; + case chip::app::Clusters::Thermostat::Attributes::OutdoorTemperature::Id: + return "OutdoorTemperature"; + case chip::app::Clusters::Thermostat::Attributes::Occupancy::Id: + return "Occupancy"; + case chip::app::Clusters::Thermostat::Attributes::AbsMinHeatSetpointLimit::Id: + return "AbsMinHeatSetpointLimit"; + case chip::app::Clusters::Thermostat::Attributes::AbsMaxHeatSetpointLimit::Id: + return "AbsMaxHeatSetpointLimit"; + case chip::app::Clusters::Thermostat::Attributes::AbsMinCoolSetpointLimit::Id: + return "AbsMinCoolSetpointLimit"; + case chip::app::Clusters::Thermostat::Attributes::AbsMaxCoolSetpointLimit::Id: + return "AbsMaxCoolSetpointLimit"; + case chip::app::Clusters::Thermostat::Attributes::PICoolingDemand::Id: + return "PICoolingDemand"; + case chip::app::Clusters::Thermostat::Attributes::PIHeatingDemand::Id: + return "PIHeatingDemand"; + case chip::app::Clusters::Thermostat::Attributes::HVACSystemTypeConfiguration::Id: + return "HVACSystemTypeConfiguration"; + case chip::app::Clusters::Thermostat::Attributes::LocalTemperatureCalibration::Id: + return "LocalTemperatureCalibration"; + case chip::app::Clusters::Thermostat::Attributes::OccupiedCoolingSetpoint::Id: + return "OccupiedCoolingSetpoint"; + case chip::app::Clusters::Thermostat::Attributes::OccupiedHeatingSetpoint::Id: + return "OccupiedHeatingSetpoint"; + case chip::app::Clusters::Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id: + return "UnoccupiedCoolingSetpoint"; + case chip::app::Clusters::Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id: + return "UnoccupiedHeatingSetpoint"; + case chip::app::Clusters::Thermostat::Attributes::MinHeatSetpointLimit::Id: + return "MinHeatSetpointLimit"; + case chip::app::Clusters::Thermostat::Attributes::MaxHeatSetpointLimit::Id: + return "MaxHeatSetpointLimit"; + case chip::app::Clusters::Thermostat::Attributes::MinCoolSetpointLimit::Id: + return "MinCoolSetpointLimit"; + case chip::app::Clusters::Thermostat::Attributes::MaxCoolSetpointLimit::Id: + return "MaxCoolSetpointLimit"; + case chip::app::Clusters::Thermostat::Attributes::MinSetpointDeadBand::Id: + return "MinSetpointDeadBand"; + case chip::app::Clusters::Thermostat::Attributes::RemoteSensing::Id: + return "RemoteSensing"; + case chip::app::Clusters::Thermostat::Attributes::ControlSequenceOfOperation::Id: + return "ControlSequenceOfOperation"; + case chip::app::Clusters::Thermostat::Attributes::SystemMode::Id: + return "SystemMode"; + case chip::app::Clusters::Thermostat::Attributes::ThermostatRunningMode::Id: + return "ThermostatRunningMode"; + case chip::app::Clusters::Thermostat::Attributes::StartOfWeek::Id: + return "StartOfWeek"; + case chip::app::Clusters::Thermostat::Attributes::NumberOfWeeklyTransitions::Id: + return "NumberOfWeeklyTransitions"; + case chip::app::Clusters::Thermostat::Attributes::NumberOfDailyTransitions::Id: + return "NumberOfDailyTransitions"; + case chip::app::Clusters::Thermostat::Attributes::TemperatureSetpointHold::Id: + return "TemperatureSetpointHold"; + case chip::app::Clusters::Thermostat::Attributes::TemperatureSetpointHoldDuration::Id: + return "TemperatureSetpointHoldDuration"; + case chip::app::Clusters::Thermostat::Attributes::ThermostatProgrammingOperationMode::Id: + return "ThermostatProgrammingOperationMode"; + case chip::app::Clusters::Thermostat::Attributes::ThermostatRunningState::Id: + return "ThermostatRunningState"; + case chip::app::Clusters::Thermostat::Attributes::SetpointChangeSource::Id: + return "SetpointChangeSource"; + case chip::app::Clusters::Thermostat::Attributes::SetpointChangeAmount::Id: + return "SetpointChangeAmount"; + case chip::app::Clusters::Thermostat::Attributes::SetpointChangeSourceTimestamp::Id: + return "SetpointChangeSourceTimestamp"; + case chip::app::Clusters::Thermostat::Attributes::OccupiedSetback::Id: + return "OccupiedSetback"; + case chip::app::Clusters::Thermostat::Attributes::OccupiedSetbackMin::Id: + return "OccupiedSetbackMin"; + case chip::app::Clusters::Thermostat::Attributes::OccupiedSetbackMax::Id: + return "OccupiedSetbackMax"; + case chip::app::Clusters::Thermostat::Attributes::UnoccupiedSetback::Id: + return "UnoccupiedSetback"; + case chip::app::Clusters::Thermostat::Attributes::UnoccupiedSetbackMin::Id: + return "UnoccupiedSetbackMin"; + case chip::app::Clusters::Thermostat::Attributes::UnoccupiedSetbackMax::Id: + return "UnoccupiedSetbackMax"; + case chip::app::Clusters::Thermostat::Attributes::EmergencyHeatDelta::Id: + return "EmergencyHeatDelta"; + case chip::app::Clusters::Thermostat::Attributes::ACType::Id: + return "ACType"; + case chip::app::Clusters::Thermostat::Attributes::ACCapacity::Id: + return "ACCapacity"; + case chip::app::Clusters::Thermostat::Attributes::ACRefrigerantType::Id: + return "ACRefrigerantType"; + case chip::app::Clusters::Thermostat::Attributes::ACCompressorType::Id: + return "ACCompressorType"; + case chip::app::Clusters::Thermostat::Attributes::ACErrorCode::Id: + return "ACErrorCode"; + case chip::app::Clusters::Thermostat::Attributes::ACLouverPosition::Id: + return "ACLouverPosition"; + case chip::app::Clusters::Thermostat::Attributes::ACCoilTemperature::Id: + return "ACCoilTemperature"; + case chip::app::Clusters::Thermostat::Attributes::ACCapacityformat::Id: + return "ACCapacityformat"; + case chip::app::Clusters::Thermostat::Attributes::PresetTypes::Id: + return "PresetTypes"; + case chip::app::Clusters::Thermostat::Attributes::ScheduleTypes::Id: + return "ScheduleTypes"; + case chip::app::Clusters::Thermostat::Attributes::NumberOfPresets::Id: + return "NumberOfPresets"; + case chip::app::Clusters::Thermostat::Attributes::NumberOfSchedules::Id: + return "NumberOfSchedules"; + case chip::app::Clusters::Thermostat::Attributes::NumberOfScheduleTransitions::Id: + return "NumberOfScheduleTransitions"; + case chip::app::Clusters::Thermostat::Attributes::NumberOfScheduleTransitionPerDay::Id: + return "NumberOfScheduleTransitionPerDay"; + case chip::app::Clusters::Thermostat::Attributes::ActivePresetHandle::Id: + return "ActivePresetHandle"; + case chip::app::Clusters::Thermostat::Attributes::ActiveScheduleHandle::Id: + return "ActiveScheduleHandle"; + case chip::app::Clusters::Thermostat::Attributes::Presets::Id: + return "Presets"; + case chip::app::Clusters::Thermostat::Attributes::Schedules::Id: + return "Schedules"; + case chip::app::Clusters::Thermostat::Attributes::SetpointHoldExpiryTimestamp::Id: + return "SetpointHoldExpiryTimestamp"; + case chip::app::Clusters::Thermostat::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Thermostat::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Thermostat::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Thermostat::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Thermostat::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Thermostat::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::FanControl::Id: { + switch (id) + { + case chip::app::Clusters::FanControl::Attributes::FanMode::Id: + return "FanMode"; + case chip::app::Clusters::FanControl::Attributes::FanModeSequence::Id: + return "FanModeSequence"; + case chip::app::Clusters::FanControl::Attributes::PercentSetting::Id: + return "PercentSetting"; + case chip::app::Clusters::FanControl::Attributes::PercentCurrent::Id: + return "PercentCurrent"; + case chip::app::Clusters::FanControl::Attributes::SpeedMax::Id: + return "SpeedMax"; + case chip::app::Clusters::FanControl::Attributes::SpeedSetting::Id: + return "SpeedSetting"; + case chip::app::Clusters::FanControl::Attributes::SpeedCurrent::Id: + return "SpeedCurrent"; + case chip::app::Clusters::FanControl::Attributes::RockSupport::Id: + return "RockSupport"; + case chip::app::Clusters::FanControl::Attributes::RockSetting::Id: + return "RockSetting"; + case chip::app::Clusters::FanControl::Attributes::WindSupport::Id: + return "WindSupport"; + case chip::app::Clusters::FanControl::Attributes::WindSetting::Id: + return "WindSetting"; + case chip::app::Clusters::FanControl::Attributes::AirflowDirection::Id: + return "AirflowDirection"; + case chip::app::Clusters::FanControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::FanControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::FanControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::FanControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::FanControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::FanControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Id: { + switch (id) + { + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::Id: + return "TemperatureDisplayMode"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id: + return "KeypadLockout"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::Id: + return "ScheduleProgrammingVisibility"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ColorControl::Id: { + switch (id) + { + case chip::app::Clusters::ColorControl::Attributes::CurrentHue::Id: + return "CurrentHue"; + case chip::app::Clusters::ColorControl::Attributes::CurrentSaturation::Id: + return "CurrentSaturation"; + case chip::app::Clusters::ColorControl::Attributes::RemainingTime::Id: + return "RemainingTime"; + case chip::app::Clusters::ColorControl::Attributes::CurrentX::Id: + return "CurrentX"; + case chip::app::Clusters::ColorControl::Attributes::CurrentY::Id: + return "CurrentY"; + case chip::app::Clusters::ColorControl::Attributes::DriftCompensation::Id: + return "DriftCompensation"; + case chip::app::Clusters::ColorControl::Attributes::CompensationText::Id: + return "CompensationText"; + case chip::app::Clusters::ColorControl::Attributes::ColorTemperatureMireds::Id: + return "ColorTemperatureMireds"; + case chip::app::Clusters::ColorControl::Attributes::ColorMode::Id: + return "ColorMode"; + case chip::app::Clusters::ColorControl::Attributes::Options::Id: + return "Options"; + case chip::app::Clusters::ColorControl::Attributes::NumberOfPrimaries::Id: + return "NumberOfPrimaries"; + case chip::app::Clusters::ColorControl::Attributes::Primary1X::Id: + return "Primary1X"; + case chip::app::Clusters::ColorControl::Attributes::Primary1Y::Id: + return "Primary1Y"; + case chip::app::Clusters::ColorControl::Attributes::Primary1Intensity::Id: + return "Primary1Intensity"; + case chip::app::Clusters::ColorControl::Attributes::Primary2X::Id: + return "Primary2X"; + case chip::app::Clusters::ColorControl::Attributes::Primary2Y::Id: + return "Primary2Y"; + case chip::app::Clusters::ColorControl::Attributes::Primary2Intensity::Id: + return "Primary2Intensity"; + case chip::app::Clusters::ColorControl::Attributes::Primary3X::Id: + return "Primary3X"; + case chip::app::Clusters::ColorControl::Attributes::Primary3Y::Id: + return "Primary3Y"; + case chip::app::Clusters::ColorControl::Attributes::Primary3Intensity::Id: + return "Primary3Intensity"; + case chip::app::Clusters::ColorControl::Attributes::Primary4X::Id: + return "Primary4X"; + case chip::app::Clusters::ColorControl::Attributes::Primary4Y::Id: + return "Primary4Y"; + case chip::app::Clusters::ColorControl::Attributes::Primary4Intensity::Id: + return "Primary4Intensity"; + case chip::app::Clusters::ColorControl::Attributes::Primary5X::Id: + return "Primary5X"; + case chip::app::Clusters::ColorControl::Attributes::Primary5Y::Id: + return "Primary5Y"; + case chip::app::Clusters::ColorControl::Attributes::Primary5Intensity::Id: + return "Primary5Intensity"; + case chip::app::Clusters::ColorControl::Attributes::Primary6X::Id: + return "Primary6X"; + case chip::app::Clusters::ColorControl::Attributes::Primary6Y::Id: + return "Primary6Y"; + case chip::app::Clusters::ColorControl::Attributes::Primary6Intensity::Id: + return "Primary6Intensity"; + case chip::app::Clusters::ColorControl::Attributes::WhitePointX::Id: + return "WhitePointX"; + case chip::app::Clusters::ColorControl::Attributes::WhitePointY::Id: + return "WhitePointY"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointRX::Id: + return "ColorPointRX"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointRY::Id: + return "ColorPointRY"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointRIntensity::Id: + return "ColorPointRIntensity"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointGX::Id: + return "ColorPointGX"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointGY::Id: + return "ColorPointGY"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointGIntensity::Id: + return "ColorPointGIntensity"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointBX::Id: + return "ColorPointBX"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointBY::Id: + return "ColorPointBY"; + case chip::app::Clusters::ColorControl::Attributes::ColorPointBIntensity::Id: + return "ColorPointBIntensity"; + case chip::app::Clusters::ColorControl::Attributes::EnhancedCurrentHue::Id: + return "EnhancedCurrentHue"; + case chip::app::Clusters::ColorControl::Attributes::EnhancedColorMode::Id: + return "EnhancedColorMode"; + case chip::app::Clusters::ColorControl::Attributes::ColorLoopActive::Id: + return "ColorLoopActive"; + case chip::app::Clusters::ColorControl::Attributes::ColorLoopDirection::Id: + return "ColorLoopDirection"; + case chip::app::Clusters::ColorControl::Attributes::ColorLoopTime::Id: + return "ColorLoopTime"; + case chip::app::Clusters::ColorControl::Attributes::ColorLoopStartEnhancedHue::Id: + return "ColorLoopStartEnhancedHue"; + case chip::app::Clusters::ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id: + return "ColorLoopStoredEnhancedHue"; + case chip::app::Clusters::ColorControl::Attributes::ColorCapabilities::Id: + return "ColorCapabilities"; + case chip::app::Clusters::ColorControl::Attributes::ColorTempPhysicalMinMireds::Id: + return "ColorTempPhysicalMinMireds"; + case chip::app::Clusters::ColorControl::Attributes::ColorTempPhysicalMaxMireds::Id: + return "ColorTempPhysicalMaxMireds"; + case chip::app::Clusters::ColorControl::Attributes::CoupleColorTempToLevelMinMireds::Id: + return "CoupleColorTempToLevelMinMireds"; + case chip::app::Clusters::ColorControl::Attributes::StartUpColorTemperatureMireds::Id: + return "StartUpColorTemperatureMireds"; + case chip::app::Clusters::ColorControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ColorControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ColorControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ColorControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ColorControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ColorControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BallastConfiguration::Id: { + switch (id) + { + case chip::app::Clusters::BallastConfiguration::Attributes::PhysicalMinLevel::Id: + return "PhysicalMinLevel"; + case chip::app::Clusters::BallastConfiguration::Attributes::PhysicalMaxLevel::Id: + return "PhysicalMaxLevel"; + case chip::app::Clusters::BallastConfiguration::Attributes::BallastStatus::Id: + return "BallastStatus"; + case chip::app::Clusters::BallastConfiguration::Attributes::MinLevel::Id: + return "MinLevel"; + case chip::app::Clusters::BallastConfiguration::Attributes::MaxLevel::Id: + return "MaxLevel"; + case chip::app::Clusters::BallastConfiguration::Attributes::IntrinsicBallastFactor::Id: + return "IntrinsicBallastFactor"; + case chip::app::Clusters::BallastConfiguration::Attributes::BallastFactorAdjustment::Id: + return "BallastFactorAdjustment"; + case chip::app::Clusters::BallastConfiguration::Attributes::LampQuantity::Id: + return "LampQuantity"; + case chip::app::Clusters::BallastConfiguration::Attributes::LampType::Id: + return "LampType"; + case chip::app::Clusters::BallastConfiguration::Attributes::LampManufacturer::Id: + return "LampManufacturer"; + case chip::app::Clusters::BallastConfiguration::Attributes::LampRatedHours::Id: + return "LampRatedHours"; + case chip::app::Clusters::BallastConfiguration::Attributes::LampBurnHours::Id: + return "LampBurnHours"; + case chip::app::Clusters::BallastConfiguration::Attributes::LampAlarmMode::Id: + return "LampAlarmMode"; + case chip::app::Clusters::BallastConfiguration::Attributes::LampBurnHoursTripPoint::Id: + return "LampBurnHoursTripPoint"; + case chip::app::Clusters::BallastConfiguration::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::BallastConfiguration::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::BallastConfiguration::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::BallastConfiguration::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::BallastConfiguration::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::BallastConfiguration::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::IlluminanceMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::IlluminanceMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::Tolerance::Id: + return "Tolerance"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::LightSensorType::Id: + return "LightSensorType"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::IlluminanceMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TemperatureMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::TemperatureMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::Tolerance::Id: + return "Tolerance"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::TemperatureMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::PressureMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::PressureMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::PressureMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::PressureMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::PressureMeasurement::Attributes::Tolerance::Id: + return "Tolerance"; + case chip::app::Clusters::PressureMeasurement::Attributes::ScaledValue::Id: + return "ScaledValue"; + case chip::app::Clusters::PressureMeasurement::Attributes::MinScaledValue::Id: + return "MinScaledValue"; + case chip::app::Clusters::PressureMeasurement::Attributes::MaxScaledValue::Id: + return "MaxScaledValue"; + case chip::app::Clusters::PressureMeasurement::Attributes::ScaledTolerance::Id: + return "ScaledTolerance"; + case chip::app::Clusters::PressureMeasurement::Attributes::Scale::Id: + return "Scale"; + case chip::app::Clusters::PressureMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::PressureMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::PressureMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::PressureMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::PressureMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::PressureMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::FlowMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::FlowMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::FlowMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::FlowMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::FlowMeasurement::Attributes::Tolerance::Id: + return "Tolerance"; + case chip::app::Clusters::FlowMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::FlowMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::FlowMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::FlowMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::FlowMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::FlowMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RelativeHumidityMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::Tolerance::Id: + return "Tolerance"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::RelativeHumidityMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OccupancySensing::Id: { + switch (id) + { + case chip::app::Clusters::OccupancySensing::Attributes::Occupancy::Id: + return "Occupancy"; + case chip::app::Clusters::OccupancySensing::Attributes::OccupancySensorType::Id: + return "OccupancySensorType"; + case chip::app::Clusters::OccupancySensing::Attributes::OccupancySensorTypeBitmap::Id: + return "OccupancySensorTypeBitmap"; + case chip::app::Clusters::OccupancySensing::Attributes::HoldTime::Id: + return "HoldTime"; + case chip::app::Clusters::OccupancySensing::Attributes::HoldTimeLimits::Id: + return "HoldTimeLimits"; + case chip::app::Clusters::OccupancySensing::Attributes::PIROccupiedToUnoccupiedDelay::Id: + return "PIROccupiedToUnoccupiedDelay"; + case chip::app::Clusters::OccupancySensing::Attributes::PIRUnoccupiedToOccupiedDelay::Id: + return "PIRUnoccupiedToOccupiedDelay"; + case chip::app::Clusters::OccupancySensing::Attributes::PIRUnoccupiedToOccupiedThreshold::Id: + return "PIRUnoccupiedToOccupiedThreshold"; + case chip::app::Clusters::OccupancySensing::Attributes::UltrasonicOccupiedToUnoccupiedDelay::Id: + return "UltrasonicOccupiedToUnoccupiedDelay"; + case chip::app::Clusters::OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedDelay::Id: + return "UltrasonicUnoccupiedToOccupiedDelay"; + case chip::app::Clusters::OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedThreshold::Id: + return "UltrasonicUnoccupiedToOccupiedThreshold"; + case chip::app::Clusters::OccupancySensing::Attributes::PhysicalContactOccupiedToUnoccupiedDelay::Id: + return "PhysicalContactOccupiedToUnoccupiedDelay"; + case chip::app::Clusters::OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedDelay::Id: + return "PhysicalContactUnoccupiedToOccupiedDelay"; + case chip::app::Clusters::OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::Id: + return "PhysicalContactUnoccupiedToOccupiedThreshold"; + case chip::app::Clusters::OccupancySensing::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OccupancySensing::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OccupancySensing::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OccupancySensing::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OccupancySensing::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OccupancySensing::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::CarbonDioxideConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OzoneConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::OzoneConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Pm25ConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Pm25ConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::FormaldehydeConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Pm1ConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Pm1ConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Pm10ConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Pm10ConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RadonConcentrationMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::MeasuredValue::Id: + return "MeasuredValue"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::MinMeasuredValue::Id: + return "MinMeasuredValue"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: + return "MaxMeasuredValue"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: + return "PeakMeasuredValue"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: + return "PeakMeasuredValueWindow"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: + return "AverageMeasuredValue"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: + return "AverageMeasuredValueWindow"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::Uncertainty::Id: + return "Uncertainty"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::MeasurementUnit::Id: + return "MeasurementUnit"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::MeasurementMedium::Id: + return "MeasurementMedium"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::LevelValue::Id: + return "LevelValue"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::RadonConcentrationMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WiFiNetworkManagement::Id: { + switch (id) + { + case chip::app::Clusters::WiFiNetworkManagement::Attributes::Ssid::Id: + return "Ssid"; + case chip::app::Clusters::WiFiNetworkManagement::Attributes::PassphraseSurrogate::Id: + return "PassphraseSurrogate"; + case chip::app::Clusters::WiFiNetworkManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::WiFiNetworkManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::WiFiNetworkManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::WiFiNetworkManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::WiFiNetworkManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::WiFiNetworkManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThreadBorderRouterManagement::Id: { + switch (id) + { + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::BorderRouterName::Id: + return "BorderRouterName"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::BorderAgentID::Id: + return "BorderAgentID"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::ThreadVersion::Id: + return "ThreadVersion"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::InterfaceEnabled::Id: + return "InterfaceEnabled"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::ActiveDatasetTimestamp::Id: + return "ActiveDatasetTimestamp"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::PendingDatasetTimestamp::Id: + return "PendingDatasetTimestamp"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ThreadBorderRouterManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThreadNetworkDirectory::Id: { + switch (id) + { + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::PreferredExtendedPanID::Id: + return "PreferredExtendedPanID"; + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::ThreadNetworks::Id: + return "ThreadNetworks"; + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::ThreadNetworkTableSize::Id: + return "ThreadNetworkTableSize"; + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ThreadNetworkDirectory::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WakeOnLan::Id: { + switch (id) + { + case chip::app::Clusters::WakeOnLan::Attributes::MACAddress::Id: + return "MACAddress"; + case chip::app::Clusters::WakeOnLan::Attributes::LinkLocalAddress::Id: + return "LinkLocalAddress"; + case chip::app::Clusters::WakeOnLan::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::WakeOnLan::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::WakeOnLan::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::WakeOnLan::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::WakeOnLan::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::WakeOnLan::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Channel::Id: { + switch (id) + { + case chip::app::Clusters::Channel::Attributes::ChannelList::Id: + return "ChannelList"; + case chip::app::Clusters::Channel::Attributes::Lineup::Id: + return "Lineup"; + case chip::app::Clusters::Channel::Attributes::CurrentChannel::Id: + return "CurrentChannel"; + case chip::app::Clusters::Channel::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Channel::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Channel::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Channel::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Channel::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Channel::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TargetNavigator::Id: { + switch (id) + { + case chip::app::Clusters::TargetNavigator::Attributes::TargetList::Id: + return "TargetList"; + case chip::app::Clusters::TargetNavigator::Attributes::CurrentTarget::Id: + return "CurrentTarget"; + case chip::app::Clusters::TargetNavigator::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::TargetNavigator::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::TargetNavigator::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::TargetNavigator::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::TargetNavigator::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::TargetNavigator::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::MediaPlayback::Id: { + switch (id) + { + case chip::app::Clusters::MediaPlayback::Attributes::CurrentState::Id: + return "CurrentState"; + case chip::app::Clusters::MediaPlayback::Attributes::StartTime::Id: + return "StartTime"; + case chip::app::Clusters::MediaPlayback::Attributes::Duration::Id: + return "Duration"; + case chip::app::Clusters::MediaPlayback::Attributes::SampledPosition::Id: + return "SampledPosition"; + case chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::Id: + return "PlaybackSpeed"; + case chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::Id: + return "SeekRangeEnd"; + case chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::Id: + return "SeekRangeStart"; + case chip::app::Clusters::MediaPlayback::Attributes::ActiveAudioTrack::Id: + return "ActiveAudioTrack"; + case chip::app::Clusters::MediaPlayback::Attributes::AvailableAudioTracks::Id: + return "AvailableAudioTracks"; + case chip::app::Clusters::MediaPlayback::Attributes::ActiveTextTrack::Id: + return "ActiveTextTrack"; + case chip::app::Clusters::MediaPlayback::Attributes::AvailableTextTracks::Id: + return "AvailableTextTracks"; + case chip::app::Clusters::MediaPlayback::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::MediaPlayback::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::MediaPlayback::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::MediaPlayback::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::MediaPlayback::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::MediaPlayback::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::MediaInput::Id: { + switch (id) + { + case chip::app::Clusters::MediaInput::Attributes::InputList::Id: + return "InputList"; + case chip::app::Clusters::MediaInput::Attributes::CurrentInput::Id: + return "CurrentInput"; + case chip::app::Clusters::MediaInput::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::MediaInput::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::MediaInput::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::MediaInput::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::MediaInput::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::MediaInput::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LowPower::Id: { + switch (id) + { + case chip::app::Clusters::LowPower::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::LowPower::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::LowPower::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::LowPower::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::LowPower::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::LowPower::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::KeypadInput::Id: { + switch (id) + { + case chip::app::Clusters::KeypadInput::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::KeypadInput::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::KeypadInput::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::KeypadInput::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::KeypadInput::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::KeypadInput::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentLauncher::Id: { + switch (id) + { + case chip::app::Clusters::ContentLauncher::Attributes::AcceptHeader::Id: + return "AcceptHeader"; + case chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::Id: + return "SupportedStreamingProtocols"; + case chip::app::Clusters::ContentLauncher::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ContentLauncher::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ContentLauncher::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ContentLauncher::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ContentLauncher::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ContentLauncher::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AudioOutput::Id: { + switch (id) + { + case chip::app::Clusters::AudioOutput::Attributes::OutputList::Id: + return "OutputList"; + case chip::app::Clusters::AudioOutput::Attributes::CurrentOutput::Id: + return "CurrentOutput"; + case chip::app::Clusters::AudioOutput::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::AudioOutput::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::AudioOutput::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::AudioOutput::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::AudioOutput::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::AudioOutput::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ApplicationLauncher::Id: { + switch (id) + { + case chip::app::Clusters::ApplicationLauncher::Attributes::CatalogList::Id: + return "CatalogList"; + case chip::app::Clusters::ApplicationLauncher::Attributes::CurrentApp::Id: + return "CurrentApp"; + case chip::app::Clusters::ApplicationLauncher::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ApplicationLauncher::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ApplicationLauncher::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ApplicationLauncher::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ApplicationLauncher::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ApplicationLauncher::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ApplicationBasic::Id: { + switch (id) + { + case chip::app::Clusters::ApplicationBasic::Attributes::VendorName::Id: + return "VendorName"; + case chip::app::Clusters::ApplicationBasic::Attributes::VendorID::Id: + return "VendorID"; + case chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::Id: + return "ApplicationName"; + case chip::app::Clusters::ApplicationBasic::Attributes::ProductID::Id: + return "ProductID"; + case chip::app::Clusters::ApplicationBasic::Attributes::Application::Id: + return "Application"; + case chip::app::Clusters::ApplicationBasic::Attributes::Status::Id: + return "Status"; + case chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::Id: + return "ApplicationVersion"; + case chip::app::Clusters::ApplicationBasic::Attributes::AllowedVendorList::Id: + return "AllowedVendorList"; + case chip::app::Clusters::ApplicationBasic::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ApplicationBasic::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ApplicationBasic::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ApplicationBasic::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ApplicationBasic::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ApplicationBasic::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AccountLogin::Id: { + switch (id) + { + case chip::app::Clusters::AccountLogin::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::AccountLogin::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::AccountLogin::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::AccountLogin::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::AccountLogin::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::AccountLogin::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentControl::Id: { + switch (id) + { + case chip::app::Clusters::ContentControl::Attributes::Enabled::Id: + return "Enabled"; + case chip::app::Clusters::ContentControl::Attributes::OnDemandRatings::Id: + return "OnDemandRatings"; + case chip::app::Clusters::ContentControl::Attributes::OnDemandRatingThreshold::Id: + return "OnDemandRatingThreshold"; + case chip::app::Clusters::ContentControl::Attributes::ScheduledContentRatings::Id: + return "ScheduledContentRatings"; + case chip::app::Clusters::ContentControl::Attributes::ScheduledContentRatingThreshold::Id: + return "ScheduledContentRatingThreshold"; + case chip::app::Clusters::ContentControl::Attributes::ScreenDailyTime::Id: + return "ScreenDailyTime"; + case chip::app::Clusters::ContentControl::Attributes::RemainingScreenTime::Id: + return "RemainingScreenTime"; + case chip::app::Clusters::ContentControl::Attributes::BlockUnrated::Id: + return "BlockUnrated"; + case chip::app::Clusters::ContentControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ContentControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ContentControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ContentControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ContentControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ContentControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentAppObserver::Id: { + switch (id) + { + case chip::app::Clusters::ContentAppObserver::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ContentAppObserver::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ContentAppObserver::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ContentAppObserver::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ContentAppObserver::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ContentAppObserver::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EcosystemInformation::Id: { + switch (id) + { + case chip::app::Clusters::EcosystemInformation::Attributes::RemovedOn::Id: + return "RemovedOn"; + case chip::app::Clusters::EcosystemInformation::Attributes::DeviceDirectory::Id: + return "DeviceDirectory"; + case chip::app::Clusters::EcosystemInformation::Attributes::LocationDirectory::Id: + return "LocationDirectory"; + case chip::app::Clusters::EcosystemInformation::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::EcosystemInformation::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::EcosystemInformation::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::EcosystemInformation::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::EcosystemInformation::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::EcosystemInformation::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::CommissionerControl::Id: { + switch (id) + { + case chip::app::Clusters::CommissionerControl::Attributes::SupportedDeviceCategories::Id: + return "SupportedDeviceCategories"; + case chip::app::Clusters::CommissionerControl::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::CommissionerControl::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::CommissionerControl::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::CommissionerControl::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::CommissionerControl::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::CommissionerControl::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ElectricalMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasurementType::Id: + return "MeasurementType"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcVoltage::Id: + return "DcVoltage"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcVoltageMin::Id: + return "DcVoltageMin"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcVoltageMax::Id: + return "DcVoltageMax"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcCurrent::Id: + return "DcCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcCurrentMin::Id: + return "DcCurrentMin"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcCurrentMax::Id: + return "DcCurrentMax"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcPower::Id: + return "DcPower"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcPowerMin::Id: + return "DcPowerMin"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcPowerMax::Id: + return "DcPowerMax"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcVoltageMultiplier::Id: + return "DcVoltageMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcVoltageDivisor::Id: + return "DcVoltageDivisor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcCurrentMultiplier::Id: + return "DcCurrentMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcCurrentDivisor::Id: + return "DcCurrentDivisor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcPowerMultiplier::Id: + return "DcPowerMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::DcPowerDivisor::Id: + return "DcPowerDivisor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcFrequency::Id: + return "AcFrequency"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcFrequencyMin::Id: + return "AcFrequencyMin"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcFrequencyMax::Id: + return "AcFrequencyMax"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::NeutralCurrent::Id: + return "NeutralCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::TotalActivePower::Id: + return "TotalActivePower"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::TotalReactivePower::Id: + return "TotalReactivePower"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::TotalApparentPower::Id: + return "TotalApparentPower"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured1stHarmonicCurrent::Id: + return "Measured1stHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured3rdHarmonicCurrent::Id: + return "Measured3rdHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured5thHarmonicCurrent::Id: + return "Measured5thHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured7thHarmonicCurrent::Id: + return "Measured7thHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured9thHarmonicCurrent::Id: + return "Measured9thHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured11thHarmonicCurrent::Id: + return "Measured11thHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase1stHarmonicCurrent::Id: + return "MeasuredPhase1stHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase3rdHarmonicCurrent::Id: + return "MeasuredPhase3rdHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase5thHarmonicCurrent::Id: + return "MeasuredPhase5thHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase7thHarmonicCurrent::Id: + return "MeasuredPhase7thHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase9thHarmonicCurrent::Id: + return "MeasuredPhase9thHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase11thHarmonicCurrent::Id: + return "MeasuredPhase11thHarmonicCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcFrequencyMultiplier::Id: + return "AcFrequencyMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcFrequencyDivisor::Id: + return "AcFrequencyDivisor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::PowerMultiplier::Id: + return "PowerMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::PowerDivisor::Id: + return "PowerDivisor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::HarmonicCurrentMultiplier::Id: + return "HarmonicCurrentMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::PhaseHarmonicCurrentMultiplier::Id: + return "PhaseHarmonicCurrentMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::InstantaneousVoltage::Id: + return "InstantaneousVoltage"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::InstantaneousLineCurrent::Id: + return "InstantaneousLineCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::InstantaneousActiveCurrent::Id: + return "InstantaneousActiveCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::InstantaneousReactiveCurrent::Id: + return "InstantaneousReactiveCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::InstantaneousPower::Id: + return "InstantaneousPower"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltage::Id: + return "RmsVoltage"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMin::Id: + return "RmsVoltageMin"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMax::Id: + return "RmsVoltageMax"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrent::Id: + return "RmsCurrent"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMin::Id: + return "RmsCurrentMin"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMax::Id: + return "RmsCurrentMax"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePower::Id: + return "ActivePower"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMin::Id: + return "ActivePowerMin"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMax::Id: + return "ActivePowerMax"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ReactivePower::Id: + return "ReactivePower"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ApparentPower::Id: + return "ApparentPower"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::PowerFactor::Id: + return "PowerFactor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriod::Id: + return "AverageRmsVoltageMeasurementPeriod"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounter::Id: + return "AverageRmsUnderVoltageCounter"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriod::Id: + return "RmsExtremeOverVoltagePeriod"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriod::Id: + return "RmsExtremeUnderVoltagePeriod"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSagPeriod::Id: + return "RmsVoltageSagPeriod"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSwellPeriod::Id: + return "RmsVoltageSwellPeriod"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcVoltageMultiplier::Id: + return "AcVoltageMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcVoltageDivisor::Id: + return "AcVoltageDivisor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcCurrentMultiplier::Id: + return "AcCurrentMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcCurrentDivisor::Id: + return "AcCurrentDivisor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcPowerMultiplier::Id: + return "AcPowerMultiplier"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcPowerDivisor::Id: + return "AcPowerDivisor"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::OverloadAlarmsMask::Id: + return "OverloadAlarmsMask"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::VoltageOverload::Id: + return "VoltageOverload"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::CurrentOverload::Id: + return "CurrentOverload"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcOverloadAlarmsMask::Id: + return "AcOverloadAlarmsMask"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcVoltageOverload::Id: + return "AcVoltageOverload"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcCurrentOverload::Id: + return "AcCurrentOverload"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcActivePowerOverload::Id: + return "AcActivePowerOverload"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcReactivePowerOverload::Id: + return "AcReactivePowerOverload"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsOverVoltage::Id: + return "AverageRmsOverVoltage"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsUnderVoltage::Id: + return "AverageRmsUnderVoltage"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeOverVoltage::Id: + return "RmsExtremeOverVoltage"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeUnderVoltage::Id: + return "RmsExtremeUnderVoltage"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSag::Id: + return "RmsVoltageSag"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSwell::Id: + return "RmsVoltageSwell"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::LineCurrentPhaseB::Id: + return "LineCurrentPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActiveCurrentPhaseB::Id: + return "ActiveCurrentPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ReactiveCurrentPhaseB::Id: + return "ReactiveCurrentPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltagePhaseB::Id: + return "RmsVoltagePhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMinPhaseB::Id: + return "RmsVoltageMinPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMaxPhaseB::Id: + return "RmsVoltageMaxPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentPhaseB::Id: + return "RmsCurrentPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMinPhaseB::Id: + return "RmsCurrentMinPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMaxPhaseB::Id: + return "RmsCurrentMaxPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerPhaseB::Id: + return "ActivePowerPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMinPhaseB::Id: + return "ActivePowerMinPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMaxPhaseB::Id: + return "ActivePowerMaxPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ReactivePowerPhaseB::Id: + return "ReactivePowerPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ApparentPowerPhaseB::Id: + return "ApparentPowerPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::PowerFactorPhaseB::Id: + return "PowerFactorPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::Id: + return "AverageRmsVoltageMeasurementPeriodPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsOverVoltageCounterPhaseB::Id: + return "AverageRmsOverVoltageCounterPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounterPhaseB::Id: + return "AverageRmsUnderVoltageCounterPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriodPhaseB::Id: + return "RmsExtremeOverVoltagePeriodPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriodPhaseB::Id: + return "RmsExtremeUnderVoltagePeriodPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSagPeriodPhaseB::Id: + return "RmsVoltageSagPeriodPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSwellPeriodPhaseB::Id: + return "RmsVoltageSwellPeriodPhaseB"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::LineCurrentPhaseC::Id: + return "LineCurrentPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActiveCurrentPhaseC::Id: + return "ActiveCurrentPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ReactiveCurrentPhaseC::Id: + return "ReactiveCurrentPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltagePhaseC::Id: + return "RmsVoltagePhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMinPhaseC::Id: + return "RmsVoltageMinPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMaxPhaseC::Id: + return "RmsVoltageMaxPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentPhaseC::Id: + return "RmsCurrentPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMinPhaseC::Id: + return "RmsCurrentMinPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMaxPhaseC::Id: + return "RmsCurrentMaxPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerPhaseC::Id: + return "ActivePowerPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMinPhaseC::Id: + return "ActivePowerMinPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMaxPhaseC::Id: + return "ActivePowerMaxPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ReactivePowerPhaseC::Id: + return "ReactivePowerPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ApparentPowerPhaseC::Id: + return "ApparentPowerPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::PowerFactorPhaseC::Id: + return "PowerFactorPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::Id: + return "AverageRmsVoltageMeasurementPeriodPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsOverVoltageCounterPhaseC::Id: + return "AverageRmsOverVoltageCounterPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounterPhaseC::Id: + return "AverageRmsUnderVoltageCounterPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriodPhaseC::Id: + return "RmsExtremeOverVoltagePeriodPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriodPhaseC::Id: + return "RmsExtremeUnderVoltagePeriodPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSagPeriodPhaseC::Id: + return "RmsVoltageSagPeriodPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSwellPeriodPhaseC::Id: + return "RmsVoltageSwellPeriodPhaseC"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ElectricalMeasurement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::UnitTesting::Id: { + switch (id) + { + case chip::app::Clusters::UnitTesting::Attributes::Boolean::Id: + return "Boolean"; + case chip::app::Clusters::UnitTesting::Attributes::Bitmap8::Id: + return "Bitmap8"; + case chip::app::Clusters::UnitTesting::Attributes::Bitmap16::Id: + return "Bitmap16"; + case chip::app::Clusters::UnitTesting::Attributes::Bitmap32::Id: + return "Bitmap32"; + case chip::app::Clusters::UnitTesting::Attributes::Bitmap64::Id: + return "Bitmap64"; + case chip::app::Clusters::UnitTesting::Attributes::Int8u::Id: + return "Int8u"; + case chip::app::Clusters::UnitTesting::Attributes::Int16u::Id: + return "Int16u"; + case chip::app::Clusters::UnitTesting::Attributes::Int24u::Id: + return "Int24u"; + case chip::app::Clusters::UnitTesting::Attributes::Int32u::Id: + return "Int32u"; + case chip::app::Clusters::UnitTesting::Attributes::Int40u::Id: + return "Int40u"; + case chip::app::Clusters::UnitTesting::Attributes::Int48u::Id: + return "Int48u"; + case chip::app::Clusters::UnitTesting::Attributes::Int56u::Id: + return "Int56u"; + case chip::app::Clusters::UnitTesting::Attributes::Int64u::Id: + return "Int64u"; + case chip::app::Clusters::UnitTesting::Attributes::Int8s::Id: + return "Int8s"; + case chip::app::Clusters::UnitTesting::Attributes::Int16s::Id: + return "Int16s"; + case chip::app::Clusters::UnitTesting::Attributes::Int24s::Id: + return "Int24s"; + case chip::app::Clusters::UnitTesting::Attributes::Int32s::Id: + return "Int32s"; + case chip::app::Clusters::UnitTesting::Attributes::Int40s::Id: + return "Int40s"; + case chip::app::Clusters::UnitTesting::Attributes::Int48s::Id: + return "Int48s"; + case chip::app::Clusters::UnitTesting::Attributes::Int56s::Id: + return "Int56s"; + case chip::app::Clusters::UnitTesting::Attributes::Int64s::Id: + return "Int64s"; + case chip::app::Clusters::UnitTesting::Attributes::Enum8::Id: + return "Enum8"; + case chip::app::Clusters::UnitTesting::Attributes::Enum16::Id: + return "Enum16"; + case chip::app::Clusters::UnitTesting::Attributes::FloatSingle::Id: + return "FloatSingle"; + case chip::app::Clusters::UnitTesting::Attributes::FloatDouble::Id: + return "FloatDouble"; + case chip::app::Clusters::UnitTesting::Attributes::OctetString::Id: + return "OctetString"; + case chip::app::Clusters::UnitTesting::Attributes::ListInt8u::Id: + return "ListInt8u"; + case chip::app::Clusters::UnitTesting::Attributes::ListOctetString::Id: + return "ListOctetString"; + case chip::app::Clusters::UnitTesting::Attributes::ListStructOctetString::Id: + return "ListStructOctetString"; + case chip::app::Clusters::UnitTesting::Attributes::LongOctetString::Id: + return "LongOctetString"; + case chip::app::Clusters::UnitTesting::Attributes::CharString::Id: + return "CharString"; + case chip::app::Clusters::UnitTesting::Attributes::LongCharString::Id: + return "LongCharString"; + case chip::app::Clusters::UnitTesting::Attributes::EpochUs::Id: + return "EpochUs"; + case chip::app::Clusters::UnitTesting::Attributes::EpochS::Id: + return "EpochS"; + case chip::app::Clusters::UnitTesting::Attributes::VendorId::Id: + return "VendorId"; + case chip::app::Clusters::UnitTesting::Attributes::ListNullablesAndOptionalsStruct::Id: + return "ListNullablesAndOptionalsStruct"; + case chip::app::Clusters::UnitTesting::Attributes::EnumAttr::Id: + return "EnumAttr"; + case chip::app::Clusters::UnitTesting::Attributes::StructAttr::Id: + return "StructAttr"; + case chip::app::Clusters::UnitTesting::Attributes::RangeRestrictedInt8u::Id: + return "RangeRestrictedInt8u"; + case chip::app::Clusters::UnitTesting::Attributes::RangeRestrictedInt8s::Id: + return "RangeRestrictedInt8s"; + case chip::app::Clusters::UnitTesting::Attributes::RangeRestrictedInt16u::Id: + return "RangeRestrictedInt16u"; + case chip::app::Clusters::UnitTesting::Attributes::RangeRestrictedInt16s::Id: + return "RangeRestrictedInt16s"; + case chip::app::Clusters::UnitTesting::Attributes::ListLongOctetString::Id: + return "ListLongOctetString"; + case chip::app::Clusters::UnitTesting::Attributes::ListFabricScoped::Id: + return "ListFabricScoped"; + case chip::app::Clusters::UnitTesting::Attributes::TimedWriteBoolean::Id: + return "TimedWriteBoolean"; + case chip::app::Clusters::UnitTesting::Attributes::GeneralErrorBoolean::Id: + return "GeneralErrorBoolean"; + case chip::app::Clusters::UnitTesting::Attributes::ClusterErrorBoolean::Id: + return "ClusterErrorBoolean"; + case chip::app::Clusters::UnitTesting::Attributes::GlobalEnum::Id: + return "GlobalEnum"; + case chip::app::Clusters::UnitTesting::Attributes::GlobalStruct::Id: + return "GlobalStruct"; + case chip::app::Clusters::UnitTesting::Attributes::Unsupported::Id: + return "Unsupported"; + case chip::app::Clusters::UnitTesting::Attributes::NullableBoolean::Id: + return "NullableBoolean"; + case chip::app::Clusters::UnitTesting::Attributes::NullableBitmap8::Id: + return "NullableBitmap8"; + case chip::app::Clusters::UnitTesting::Attributes::NullableBitmap16::Id: + return "NullableBitmap16"; + case chip::app::Clusters::UnitTesting::Attributes::NullableBitmap32::Id: + return "NullableBitmap32"; + case chip::app::Clusters::UnitTesting::Attributes::NullableBitmap64::Id: + return "NullableBitmap64"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt8u::Id: + return "NullableInt8u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt16u::Id: + return "NullableInt16u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt24u::Id: + return "NullableInt24u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt32u::Id: + return "NullableInt32u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt40u::Id: + return "NullableInt40u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt48u::Id: + return "NullableInt48u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt56u::Id: + return "NullableInt56u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt64u::Id: + return "NullableInt64u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt8s::Id: + return "NullableInt8s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt16s::Id: + return "NullableInt16s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt24s::Id: + return "NullableInt24s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt32s::Id: + return "NullableInt32s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt40s::Id: + return "NullableInt40s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt48s::Id: + return "NullableInt48s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt56s::Id: + return "NullableInt56s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableInt64s::Id: + return "NullableInt64s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableEnum8::Id: + return "NullableEnum8"; + case chip::app::Clusters::UnitTesting::Attributes::NullableEnum16::Id: + return "NullableEnum16"; + case chip::app::Clusters::UnitTesting::Attributes::NullableFloatSingle::Id: + return "NullableFloatSingle"; + case chip::app::Clusters::UnitTesting::Attributes::NullableFloatDouble::Id: + return "NullableFloatDouble"; + case chip::app::Clusters::UnitTesting::Attributes::NullableOctetString::Id: + return "NullableOctetString"; + case chip::app::Clusters::UnitTesting::Attributes::NullableCharString::Id: + return "NullableCharString"; + case chip::app::Clusters::UnitTesting::Attributes::NullableEnumAttr::Id: + return "NullableEnumAttr"; + case chip::app::Clusters::UnitTesting::Attributes::NullableStruct::Id: + return "NullableStruct"; + case chip::app::Clusters::UnitTesting::Attributes::NullableRangeRestrictedInt8u::Id: + return "NullableRangeRestrictedInt8u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableRangeRestrictedInt8s::Id: + return "NullableRangeRestrictedInt8s"; + case chip::app::Clusters::UnitTesting::Attributes::NullableRangeRestrictedInt16u::Id: + return "NullableRangeRestrictedInt16u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableRangeRestrictedInt16s::Id: + return "NullableRangeRestrictedInt16s"; + case chip::app::Clusters::UnitTesting::Attributes::WriteOnlyInt8u::Id: + return "WriteOnlyInt8u"; + case chip::app::Clusters::UnitTesting::Attributes::NullableGlobalEnum::Id: + return "NullableGlobalEnum"; + case chip::app::Clusters::UnitTesting::Attributes::NullableGlobalStruct::Id: + return "NullableGlobalStruct"; + case chip::app::Clusters::UnitTesting::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::UnitTesting::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::UnitTesting::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::UnitTesting::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::UnitTesting::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::UnitTesting::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + case chip::app::Clusters::UnitTesting::Attributes::MeiInt8u::Id: + return "MeiInt8u"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::FaultInjection::Id: { + switch (id) + { + case chip::app::Clusters::FaultInjection::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::FaultInjection::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::FaultInjection::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::FaultInjection::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::FaultInjection::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::FaultInjection::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::SampleMei::Id: { + switch (id) + { + case chip::app::Clusters::SampleMei::Attributes::FlipFlop::Id: + return "FlipFlop"; + case chip::app::Clusters::SampleMei::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::SampleMei::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::SampleMei::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::SampleMei::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::SampleMei::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::SampleMei::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + default: + return "Unknown"; + } +} + +char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id) +{ + switch (cluster) + { + case chip::app::Clusters::Identify::Id: { + switch (id) + { + case chip::app::Clusters::Identify::Commands::Identify::Id: + return "Identify"; + case chip::app::Clusters::Identify::Commands::TriggerEffect::Id: + return "TriggerEffect"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Groups::Id: { + switch (id) + { + case chip::app::Clusters::Groups::Commands::AddGroup::Id: + return "AddGroup"; + case chip::app::Clusters::Groups::Commands::ViewGroup::Id: + return "ViewGroup"; + case chip::app::Clusters::Groups::Commands::GetGroupMembership::Id: + return "GetGroupMembership"; + case chip::app::Clusters::Groups::Commands::RemoveGroup::Id: + return "RemoveGroup"; + case chip::app::Clusters::Groups::Commands::RemoveAllGroups::Id: + return "RemoveAllGroups"; + case chip::app::Clusters::Groups::Commands::AddGroupIfIdentifying::Id: + return "AddGroupIfIdentifying"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OnOff::Id: { + switch (id) + { + case chip::app::Clusters::OnOff::Commands::Off::Id: + return "Off"; + case chip::app::Clusters::OnOff::Commands::On::Id: + return "On"; + case chip::app::Clusters::OnOff::Commands::Toggle::Id: + return "Toggle"; + case chip::app::Clusters::OnOff::Commands::OffWithEffect::Id: + return "OffWithEffect"; + case chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Id: + return "OnWithRecallGlobalScene"; + case chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Id: + return "OnWithTimedOff"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LevelControl::Id: { + switch (id) + { + case chip::app::Clusters::LevelControl::Commands::MoveToLevel::Id: + return "MoveToLevel"; + case chip::app::Clusters::LevelControl::Commands::Move::Id: + return "Move"; + case chip::app::Clusters::LevelControl::Commands::Step::Id: + return "Step"; + case chip::app::Clusters::LevelControl::Commands::Stop::Id: + return "Stop"; + case chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Id: + return "MoveToLevelWithOnOff"; + case chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Id: + return "MoveWithOnOff"; + case chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Id: + return "StepWithOnOff"; + case chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Id: + return "StopWithOnOff"; + case chip::app::Clusters::LevelControl::Commands::MoveToClosestFrequency::Id: + return "MoveToClosestFrequency"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AccessControl::Id: { + switch (id) + { + case chip::app::Clusters::AccessControl::Commands::ReviewFabricRestrictions::Id: + return "ReviewFabricRestrictions"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Actions::Id: { + switch (id) + { + case chip::app::Clusters::Actions::Commands::InstantAction::Id: + return "InstantAction"; + case chip::app::Clusters::Actions::Commands::InstantActionWithTransition::Id: + return "InstantActionWithTransition"; + case chip::app::Clusters::Actions::Commands::StartAction::Id: + return "StartAction"; + case chip::app::Clusters::Actions::Commands::StartActionWithDuration::Id: + return "StartActionWithDuration"; + case chip::app::Clusters::Actions::Commands::StopAction::Id: + return "StopAction"; + case chip::app::Clusters::Actions::Commands::PauseAction::Id: + return "PauseAction"; + case chip::app::Clusters::Actions::Commands::PauseActionWithDuration::Id: + return "PauseActionWithDuration"; + case chip::app::Clusters::Actions::Commands::ResumeAction::Id: + return "ResumeAction"; + case chip::app::Clusters::Actions::Commands::EnableAction::Id: + return "EnableAction"; + case chip::app::Clusters::Actions::Commands::EnableActionWithDuration::Id: + return "EnableActionWithDuration"; + case chip::app::Clusters::Actions::Commands::DisableAction::Id: + return "DisableAction"; + case chip::app::Clusters::Actions::Commands::DisableActionWithDuration::Id: + return "DisableActionWithDuration"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BasicInformation::Id: { + switch (id) + { + case chip::app::Clusters::BasicInformation::Commands::MfgSpecificPing::Id: + return "MfgSpecificPing"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OtaSoftwareUpdateProvider::Id: { + switch (id) + { + case chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::Id: + return "QueryImage"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Id: + return "ApplyUpdateRequest"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Id: + return "NotifyUpdateApplied"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Id: { + switch (id) + { + case chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOTAProvider::Id: + return "AnnounceOTAProvider"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GeneralCommissioning::Id: { + switch (id) + { + case chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Id: + return "ArmFailSafe"; + case chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::Id: + return "SetRegulatoryConfig"; + case chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::Id: + return "CommissioningComplete"; + case chip::app::Clusters::GeneralCommissioning::Commands::SetTCAcknowledgements::Id: + return "SetTCAcknowledgements"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::NetworkCommissioning::Id: { + switch (id) + { + case chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworks::Id: + return "ScanNetworks"; + case chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateWiFiNetwork::Id: + return "AddOrUpdateWiFiNetwork"; + case chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateThreadNetwork::Id: + return "AddOrUpdateThreadNetwork"; + case chip::app::Clusters::NetworkCommissioning::Commands::RemoveNetwork::Id: + return "RemoveNetwork"; + case chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetwork::Id: + return "ConnectNetwork"; + case chip::app::Clusters::NetworkCommissioning::Commands::ReorderNetwork::Id: + return "ReorderNetwork"; + case chip::app::Clusters::NetworkCommissioning::Commands::QueryIdentity::Id: + return "QueryIdentity"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DiagnosticLogs::Id: { + switch (id) + { + case chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsRequest::Id: + return "RetrieveLogsRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GeneralDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::GeneralDiagnostics::Commands::TestEventTrigger::Id: + return "TestEventTrigger"; + case chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::Id: + return "TimeSnapshot"; + case chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestRequest::Id: + return "PayloadTestRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::SoftwareDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::SoftwareDiagnostics::Commands::ResetWatermarks::Id: + return "ResetWatermarks"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThreadNetworkDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::ThreadNetworkDiagnostics::Commands::ResetCounts::Id: + return "ResetCounts"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WiFiNetworkDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::WiFiNetworkDiagnostics::Commands::ResetCounts::Id: + return "ResetCounts"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EthernetNetworkDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::EthernetNetworkDiagnostics::Commands::ResetCounts::Id: + return "ResetCounts"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TimeSynchronization::Id: { + switch (id) + { + case chip::app::Clusters::TimeSynchronization::Commands::SetUTCTime::Id: + return "SetUTCTime"; + case chip::app::Clusters::TimeSynchronization::Commands::SetTrustedTimeSource::Id: + return "SetTrustedTimeSource"; + case chip::app::Clusters::TimeSynchronization::Commands::SetTimeZone::Id: + return "SetTimeZone"; + case chip::app::Clusters::TimeSynchronization::Commands::SetDSTOffset::Id: + return "SetDSTOffset"; + case chip::app::Clusters::TimeSynchronization::Commands::SetDefaultNTP::Id: + return "SetDefaultNTP"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BridgedDeviceBasicInformation::Id: { + switch (id) + { + case chip::app::Clusters::BridgedDeviceBasicInformation::Commands::KeepActive::Id: + return "KeepActive"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AdministratorCommissioning::Id: { + switch (id) + { + case chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Id: + return "OpenCommissioningWindow"; + case chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id: + return "OpenBasicCommissioningWindow"; + case chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Id: + return "RevokeCommissioning"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OperationalCredentials::Id: { + switch (id) + { + case chip::app::Clusters::OperationalCredentials::Commands::AttestationRequest::Id: + return "AttestationRequest"; + case chip::app::Clusters::OperationalCredentials::Commands::CertificateChainRequest::Id: + return "CertificateChainRequest"; + case chip::app::Clusters::OperationalCredentials::Commands::CSRRequest::Id: + return "CSRRequest"; + case chip::app::Clusters::OperationalCredentials::Commands::AddNOC::Id: + return "AddNOC"; + case chip::app::Clusters::OperationalCredentials::Commands::UpdateNOC::Id: + return "UpdateNOC"; + case chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Id: + return "UpdateFabricLabel"; + case chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Id: + return "RemoveFabric"; + case chip::app::Clusters::OperationalCredentials::Commands::AddTrustedRootCertificate::Id: + return "AddTrustedRootCertificate"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GroupKeyManagement::Id: { + switch (id) + { + case chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Id: + return "KeySetWrite"; + case chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Id: + return "KeySetRead"; + case chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Id: + return "KeySetRemove"; + case chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Id: + return "KeySetReadAllIndices"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::IcdManagement::Id: { + switch (id) + { + case chip::app::Clusters::IcdManagement::Commands::RegisterClient::Id: + return "RegisterClient"; + case chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Id: + return "UnregisterClient"; + case chip::app::Clusters::IcdManagement::Commands::StayActiveRequest::Id: + return "StayActiveRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Timer::Id: { + switch (id) + { + case chip::app::Clusters::Timer::Commands::SetTimer::Id: + return "SetTimer"; + case chip::app::Clusters::Timer::Commands::ResetTimer::Id: + return "ResetTimer"; + case chip::app::Clusters::Timer::Commands::AddTime::Id: + return "AddTime"; + case chip::app::Clusters::Timer::Commands::ReduceTime::Id: + return "ReduceTime"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OvenCavityOperationalState::Id: { + switch (id) + { + case chip::app::Clusters::OvenCavityOperationalState::Commands::Pause::Id: + return "Pause"; + case chip::app::Clusters::OvenCavityOperationalState::Commands::Stop::Id: + return "Stop"; + case chip::app::Clusters::OvenCavityOperationalState::Commands::Start::Id: + return "Start"; + case chip::app::Clusters::OvenCavityOperationalState::Commands::Resume::Id: + return "Resume"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OvenMode::Id: { + switch (id) + { + case chip::app::Clusters::OvenMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ModeSelect::Id: { + switch (id) + { + case chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LaundryWasherMode::Id: { + switch (id) + { + case chip::app::Clusters::LaundryWasherMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id: { + switch (id) + { + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcRunMode::Id: { + switch (id) + { + case chip::app::Clusters::RvcRunMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcCleanMode::Id: { + switch (id) + { + case chip::app::Clusters::RvcCleanMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TemperatureControl::Id: { + switch (id) + { + case chip::app::Clusters::TemperatureControl::Commands::SetTemperature::Id: + return "SetTemperature"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DishwasherMode::Id: { + switch (id) + { + case chip::app::Clusters::DishwasherMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::SmokeCoAlarm::Id: { + switch (id) + { + case chip::app::Clusters::SmokeCoAlarm::Commands::SelfTestRequest::Id: + return "SelfTestRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DishwasherAlarm::Id: { + switch (id) + { + case chip::app::Clusters::DishwasherAlarm::Commands::Reset::Id: + return "Reset"; + case chip::app::Clusters::DishwasherAlarm::Commands::ModifyEnabledAlarms::Id: + return "ModifyEnabledAlarms"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::MicrowaveOvenControl::Id: { + switch (id) + { + case chip::app::Clusters::MicrowaveOvenControl::Commands::SetCookingParameters::Id: + return "SetCookingParameters"; + case chip::app::Clusters::MicrowaveOvenControl::Commands::AddMoreTime::Id: + return "AddMoreTime"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OperationalState::Id: { + switch (id) + { + case chip::app::Clusters::OperationalState::Commands::Pause::Id: + return "Pause"; + case chip::app::Clusters::OperationalState::Commands::Stop::Id: + return "Stop"; + case chip::app::Clusters::OperationalState::Commands::Start::Id: + return "Start"; + case chip::app::Clusters::OperationalState::Commands::Resume::Id: + return "Resume"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcOperationalState::Id: { + switch (id) + { + case chip::app::Clusters::RvcOperationalState::Commands::Pause::Id: + return "Pause"; + case chip::app::Clusters::RvcOperationalState::Commands::Resume::Id: + return "Resume"; + case chip::app::Clusters::RvcOperationalState::Commands::GoHome::Id: + return "GoHome"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ScenesManagement::Id: { + switch (id) + { + case chip::app::Clusters::ScenesManagement::Commands::AddScene::Id: + return "AddScene"; + case chip::app::Clusters::ScenesManagement::Commands::ViewScene::Id: + return "ViewScene"; + case chip::app::Clusters::ScenesManagement::Commands::RemoveScene::Id: + return "RemoveScene"; + case chip::app::Clusters::ScenesManagement::Commands::RemoveAllScenes::Id: + return "RemoveAllScenes"; + case chip::app::Clusters::ScenesManagement::Commands::StoreScene::Id: + return "StoreScene"; + case chip::app::Clusters::ScenesManagement::Commands::RecallScene::Id: + return "RecallScene"; + case chip::app::Clusters::ScenesManagement::Commands::GetSceneMembership::Id: + return "GetSceneMembership"; + case chip::app::Clusters::ScenesManagement::Commands::CopyScene::Id: + return "CopyScene"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::HepaFilterMonitoring::Id: { + switch (id) + { + case chip::app::Clusters::HepaFilterMonitoring::Commands::ResetCondition::Id: + return "ResetCondition"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Id: { + switch (id) + { + case chip::app::Clusters::ActivatedCarbonFilterMonitoring::Commands::ResetCondition::Id: + return "ResetCondition"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BooleanStateConfiguration::Id: { + switch (id) + { + case chip::app::Clusters::BooleanStateConfiguration::Commands::SuppressAlarm::Id: + return "SuppressAlarm"; + case chip::app::Clusters::BooleanStateConfiguration::Commands::EnableDisableAlarm::Id: + return "EnableDisableAlarm"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ValveConfigurationAndControl::Id: { + switch (id) + { + case chip::app::Clusters::ValveConfigurationAndControl::Commands::Open::Id: + return "Open"; + case chip::app::Clusters::ValveConfigurationAndControl::Commands::Close::Id: + return "Close"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WaterHeaterManagement::Id: { + switch (id) + { + case chip::app::Clusters::WaterHeaterManagement::Commands::Boost::Id: + return "Boost"; + case chip::app::Clusters::WaterHeaterManagement::Commands::CancelBoost::Id: + return "CancelBoost"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DemandResponseLoadControl::Id: { + switch (id) + { + case chip::app::Clusters::DemandResponseLoadControl::Commands::RegisterLoadControlProgramRequest::Id: + return "RegisterLoadControlProgramRequest"; + case chip::app::Clusters::DemandResponseLoadControl::Commands::UnregisterLoadControlProgramRequest::Id: + return "UnregisterLoadControlProgramRequest"; + case chip::app::Clusters::DemandResponseLoadControl::Commands::AddLoadControlEventRequest::Id: + return "AddLoadControlEventRequest"; + case chip::app::Clusters::DemandResponseLoadControl::Commands::RemoveLoadControlEventRequest::Id: + return "RemoveLoadControlEventRequest"; + case chip::app::Clusters::DemandResponseLoadControl::Commands::ClearLoadControlEventsRequest::Id: + return "ClearLoadControlEventsRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Messages::Id: { + switch (id) + { + case chip::app::Clusters::Messages::Commands::PresentMessagesRequest::Id: + return "PresentMessagesRequest"; + case chip::app::Clusters::Messages::Commands::CancelMessagesRequest::Id: + return "CancelMessagesRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DeviceEnergyManagement::Id: { + switch (id) + { + case chip::app::Clusters::DeviceEnergyManagement::Commands::PowerAdjustRequest::Id: + return "PowerAdjustRequest"; + case chip::app::Clusters::DeviceEnergyManagement::Commands::CancelPowerAdjustRequest::Id: + return "CancelPowerAdjustRequest"; + case chip::app::Clusters::DeviceEnergyManagement::Commands::StartTimeAdjustRequest::Id: + return "StartTimeAdjustRequest"; + case chip::app::Clusters::DeviceEnergyManagement::Commands::PauseRequest::Id: + return "PauseRequest"; + case chip::app::Clusters::DeviceEnergyManagement::Commands::ResumeRequest::Id: + return "ResumeRequest"; + case chip::app::Clusters::DeviceEnergyManagement::Commands::ModifyForecastRequest::Id: + return "ModifyForecastRequest"; + case chip::app::Clusters::DeviceEnergyManagement::Commands::RequestConstraintBasedForecast::Id: + return "RequestConstraintBasedForecast"; + case chip::app::Clusters::DeviceEnergyManagement::Commands::CancelRequest::Id: + return "CancelRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EnergyEvse::Id: { + switch (id) + { + case chip::app::Clusters::EnergyEvse::Commands::Disable::Id: + return "Disable"; + case chip::app::Clusters::EnergyEvse::Commands::EnableCharging::Id: + return "EnableCharging"; + case chip::app::Clusters::EnergyEvse::Commands::EnableDischarging::Id: + return "EnableDischarging"; + case chip::app::Clusters::EnergyEvse::Commands::StartDiagnostics::Id: + return "StartDiagnostics"; + case chip::app::Clusters::EnergyEvse::Commands::SetTargets::Id: + return "SetTargets"; + case chip::app::Clusters::EnergyEvse::Commands::GetTargets::Id: + return "GetTargets"; + case chip::app::Clusters::EnergyEvse::Commands::ClearTargets::Id: + return "ClearTargets"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EnergyEvseMode::Id: { + switch (id) + { + case chip::app::Clusters::EnergyEvseMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WaterHeaterMode::Id: { + switch (id) + { + case chip::app::Clusters::WaterHeaterMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DeviceEnergyManagementMode::Id: { + switch (id) + { + case chip::app::Clusters::DeviceEnergyManagementMode::Commands::ChangeToMode::Id: + return "ChangeToMode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DoorLock::Id: { + switch (id) + { + case chip::app::Clusters::DoorLock::Commands::LockDoor::Id: + return "LockDoor"; + case chip::app::Clusters::DoorLock::Commands::UnlockDoor::Id: + return "UnlockDoor"; + case chip::app::Clusters::DoorLock::Commands::UnlockWithTimeout::Id: + return "UnlockWithTimeout"; + case chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Id: + return "SetWeekDaySchedule"; + case chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Id: + return "GetWeekDaySchedule"; + case chip::app::Clusters::DoorLock::Commands::ClearWeekDaySchedule::Id: + return "ClearWeekDaySchedule"; + case chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Id: + return "SetYearDaySchedule"; + case chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Id: + return "GetYearDaySchedule"; + case chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Id: + return "ClearYearDaySchedule"; + case chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Id: + return "SetHolidaySchedule"; + case chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Id: + return "GetHolidaySchedule"; + case chip::app::Clusters::DoorLock::Commands::ClearHolidaySchedule::Id: + return "ClearHolidaySchedule"; + case chip::app::Clusters::DoorLock::Commands::SetUser::Id: + return "SetUser"; + case chip::app::Clusters::DoorLock::Commands::GetUser::Id: + return "GetUser"; + case chip::app::Clusters::DoorLock::Commands::ClearUser::Id: + return "ClearUser"; + case chip::app::Clusters::DoorLock::Commands::SetCredential::Id: + return "SetCredential"; + case chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Id: + return "GetCredentialStatus"; + case chip::app::Clusters::DoorLock::Commands::ClearCredential::Id: + return "ClearCredential"; + case chip::app::Clusters::DoorLock::Commands::UnboltDoor::Id: + return "UnboltDoor"; + case chip::app::Clusters::DoorLock::Commands::SetAliroReaderConfig::Id: + return "SetAliroReaderConfig"; + case chip::app::Clusters::DoorLock::Commands::ClearAliroReaderConfig::Id: + return "ClearAliroReaderConfig"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WindowCovering::Id: { + switch (id) + { + case chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Id: + return "UpOrOpen"; + case chip::app::Clusters::WindowCovering::Commands::DownOrClose::Id: + return "DownOrClose"; + case chip::app::Clusters::WindowCovering::Commands::StopMotion::Id: + return "StopMotion"; + case chip::app::Clusters::WindowCovering::Commands::GoToLiftValue::Id: + return "GoToLiftValue"; + case chip::app::Clusters::WindowCovering::Commands::GoToLiftPercentage::Id: + return "GoToLiftPercentage"; + case chip::app::Clusters::WindowCovering::Commands::GoToTiltValue::Id: + return "GoToTiltValue"; + case chip::app::Clusters::WindowCovering::Commands::GoToTiltPercentage::Id: + return "GoToTiltPercentage"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::BarrierControl::Id: { + switch (id) + { + case chip::app::Clusters::BarrierControl::Commands::BarrierControlGoToPercent::Id: + return "BarrierControlGoToPercent"; + case chip::app::Clusters::BarrierControl::Commands::BarrierControlStop::Id: + return "BarrierControlStop"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ServiceArea::Id: { + switch (id) + { + case chip::app::Clusters::ServiceArea::Commands::SelectAreas::Id: + return "SelectAreas"; + case chip::app::Clusters::ServiceArea::Commands::SkipArea::Id: + return "SkipArea"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Thermostat::Id: { + switch (id) + { + case chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Id: + return "SetpointRaiseLower"; + case chip::app::Clusters::Thermostat::Commands::SetWeeklySchedule::Id: + return "SetWeeklySchedule"; + case chip::app::Clusters::Thermostat::Commands::GetWeeklySchedule::Id: + return "GetWeeklySchedule"; + case chip::app::Clusters::Thermostat::Commands::ClearWeeklySchedule::Id: + return "ClearWeeklySchedule"; + case chip::app::Clusters::Thermostat::Commands::SetActiveScheduleRequest::Id: + return "SetActiveScheduleRequest"; + case chip::app::Clusters::Thermostat::Commands::SetActivePresetRequest::Id: + return "SetActivePresetRequest"; + case chip::app::Clusters::Thermostat::Commands::AtomicRequest::Id: + return "AtomicRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::FanControl::Id: { + switch (id) + { + case chip::app::Clusters::FanControl::Commands::Step::Id: + return "Step"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ColorControl::Id: { + switch (id) + { + case chip::app::Clusters::ColorControl::Commands::MoveToHue::Id: + return "MoveToHue"; + case chip::app::Clusters::ColorControl::Commands::MoveHue::Id: + return "MoveHue"; + case chip::app::Clusters::ColorControl::Commands::StepHue::Id: + return "StepHue"; + case chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Id: + return "MoveToSaturation"; + case chip::app::Clusters::ColorControl::Commands::MoveSaturation::Id: + return "MoveSaturation"; + case chip::app::Clusters::ColorControl::Commands::StepSaturation::Id: + return "StepSaturation"; + case chip::app::Clusters::ColorControl::Commands::MoveToHueAndSaturation::Id: + return "MoveToHueAndSaturation"; + case chip::app::Clusters::ColorControl::Commands::MoveToColor::Id: + return "MoveToColor"; + case chip::app::Clusters::ColorControl::Commands::MoveColor::Id: + return "MoveColor"; + case chip::app::Clusters::ColorControl::Commands::StepColor::Id: + return "StepColor"; + case chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Id: + return "MoveToColorTemperature"; + case chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Id: + return "EnhancedMoveToHue"; + case chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Id: + return "EnhancedMoveHue"; + case chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Id: + return "EnhancedStepHue"; + case chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHueAndSaturation::Id: + return "EnhancedMoveToHueAndSaturation"; + case chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Id: + return "ColorLoopSet"; + case chip::app::Clusters::ColorControl::Commands::StopMoveStep::Id: + return "StopMoveStep"; + case chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Id: + return "MoveColorTemperature"; + case chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Id: + return "StepColorTemperature"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WiFiNetworkManagement::Id: { + switch (id) + { + case chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseRequest::Id: + return "NetworkPassphraseRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThreadBorderRouterManagement::Id: { + switch (id) + { + case chip::app::Clusters::ThreadBorderRouterManagement::Commands::GetActiveDatasetRequest::Id: + return "GetActiveDatasetRequest"; + case chip::app::Clusters::ThreadBorderRouterManagement::Commands::GetPendingDatasetRequest::Id: + return "GetPendingDatasetRequest"; + case chip::app::Clusters::ThreadBorderRouterManagement::Commands::SetActiveDatasetRequest::Id: + return "SetActiveDatasetRequest"; + case chip::app::Clusters::ThreadBorderRouterManagement::Commands::SetPendingDatasetRequest::Id: + return "SetPendingDatasetRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThreadNetworkDirectory::Id: { + switch (id) + { + case chip::app::Clusters::ThreadNetworkDirectory::Commands::AddNetwork::Id: + return "AddNetwork"; + case chip::app::Clusters::ThreadNetworkDirectory::Commands::RemoveNetwork::Id: + return "RemoveNetwork"; + case chip::app::Clusters::ThreadNetworkDirectory::Commands::GetOperationalDataset::Id: + return "GetOperationalDataset"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Channel::Id: { + switch (id) + { + case chip::app::Clusters::Channel::Commands::ChangeChannel::Id: + return "ChangeChannel"; + case chip::app::Clusters::Channel::Commands::ChangeChannelByNumber::Id: + return "ChangeChannelByNumber"; + case chip::app::Clusters::Channel::Commands::SkipChannel::Id: + return "SkipChannel"; + case chip::app::Clusters::Channel::Commands::GetProgramGuide::Id: + return "GetProgramGuide"; + case chip::app::Clusters::Channel::Commands::RecordProgram::Id: + return "RecordProgram"; + case chip::app::Clusters::Channel::Commands::CancelRecordProgram::Id: + return "CancelRecordProgram"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TargetNavigator::Id: { + switch (id) + { + case chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Id: + return "NavigateTarget"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::MediaPlayback::Id: { + switch (id) + { + case chip::app::Clusters::MediaPlayback::Commands::Play::Id: + return "Play"; + case chip::app::Clusters::MediaPlayback::Commands::Pause::Id: + return "Pause"; + case chip::app::Clusters::MediaPlayback::Commands::Stop::Id: + return "Stop"; + case chip::app::Clusters::MediaPlayback::Commands::StartOver::Id: + return "StartOver"; + case chip::app::Clusters::MediaPlayback::Commands::Previous::Id: + return "Previous"; + case chip::app::Clusters::MediaPlayback::Commands::Next::Id: + return "Next"; + case chip::app::Clusters::MediaPlayback::Commands::Rewind::Id: + return "Rewind"; + case chip::app::Clusters::MediaPlayback::Commands::FastForward::Id: + return "FastForward"; + case chip::app::Clusters::MediaPlayback::Commands::SkipForward::Id: + return "SkipForward"; + case chip::app::Clusters::MediaPlayback::Commands::SkipBackward::Id: + return "SkipBackward"; + case chip::app::Clusters::MediaPlayback::Commands::Seek::Id: + return "Seek"; + case chip::app::Clusters::MediaPlayback::Commands::ActivateAudioTrack::Id: + return "ActivateAudioTrack"; + case chip::app::Clusters::MediaPlayback::Commands::ActivateTextTrack::Id: + return "ActivateTextTrack"; + case chip::app::Clusters::MediaPlayback::Commands::DeactivateTextTrack::Id: + return "DeactivateTextTrack"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::MediaInput::Id: { + switch (id) + { + case chip::app::Clusters::MediaInput::Commands::SelectInput::Id: + return "SelectInput"; + case chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Id: + return "ShowInputStatus"; + case chip::app::Clusters::MediaInput::Commands::HideInputStatus::Id: + return "HideInputStatus"; + case chip::app::Clusters::MediaInput::Commands::RenameInput::Id: + return "RenameInput"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LowPower::Id: { + switch (id) + { + case chip::app::Clusters::LowPower::Commands::Sleep::Id: + return "Sleep"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::KeypadInput::Id: { + switch (id) + { + case chip::app::Clusters::KeypadInput::Commands::SendKey::Id: + return "SendKey"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentLauncher::Id: { + switch (id) + { + case chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Id: + return "LaunchContent"; + case chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Id: + return "LaunchURL"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AudioOutput::Id: { + switch (id) + { + case chip::app::Clusters::AudioOutput::Commands::SelectOutput::Id: + return "SelectOutput"; + case chip::app::Clusters::AudioOutput::Commands::RenameOutput::Id: + return "RenameOutput"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ApplicationLauncher::Id: { + switch (id) + { + case chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Id: + return "LaunchApp"; + case chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Id: + return "StopApp"; + case chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Id: + return "HideApp"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AccountLogin::Id: { + switch (id) + { + case chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Id: + return "GetSetupPIN"; + case chip::app::Clusters::AccountLogin::Commands::Login::Id: + return "Login"; + case chip::app::Clusters::AccountLogin::Commands::Logout::Id: + return "Logout"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentControl::Id: { + switch (id) + { + case chip::app::Clusters::ContentControl::Commands::UpdatePIN::Id: + return "UpdatePIN"; + case chip::app::Clusters::ContentControl::Commands::ResetPIN::Id: + return "ResetPIN"; + case chip::app::Clusters::ContentControl::Commands::Enable::Id: + return "Enable"; + case chip::app::Clusters::ContentControl::Commands::Disable::Id: + return "Disable"; + case chip::app::Clusters::ContentControl::Commands::AddBonusTime::Id: + return "AddBonusTime"; + case chip::app::Clusters::ContentControl::Commands::SetScreenDailyTime::Id: + return "SetScreenDailyTime"; + case chip::app::Clusters::ContentControl::Commands::BlockUnratedContent::Id: + return "BlockUnratedContent"; + case chip::app::Clusters::ContentControl::Commands::UnblockUnratedContent::Id: + return "UnblockUnratedContent"; + case chip::app::Clusters::ContentControl::Commands::SetOnDemandRatingThreshold::Id: + return "SetOnDemandRatingThreshold"; + case chip::app::Clusters::ContentControl::Commands::SetScheduledContentRatingThreshold::Id: + return "SetScheduledContentRatingThreshold"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentAppObserver::Id: { + switch (id) + { + case chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::Id: + return "ContentAppMessage"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::CommissionerControl::Id: { + switch (id) + { + case chip::app::Clusters::CommissionerControl::Commands::RequestCommissioningApproval::Id: + return "RequestCommissioningApproval"; + case chip::app::Clusters::CommissionerControl::Commands::CommissionNode::Id: + return "CommissionNode"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ElectricalMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoCommand::Id: + return "GetProfileInfoCommand"; + case chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileCommand::Id: + return "GetMeasurementProfileCommand"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::UnitTesting::Id: { + switch (id) + { + case chip::app::Clusters::UnitTesting::Commands::Test::Id: + return "Test"; + case chip::app::Clusters::UnitTesting::Commands::TestNotHandled::Id: + return "TestNotHandled"; + case chip::app::Clusters::UnitTesting::Commands::TestSpecific::Id: + return "TestSpecific"; + case chip::app::Clusters::UnitTesting::Commands::TestUnknownCommand::Id: + return "TestUnknownCommand"; + case chip::app::Clusters::UnitTesting::Commands::TestAddArguments::Id: + return "TestAddArguments"; + case chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentRequest::Id: + return "TestSimpleArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestStructArrayArgumentRequest::Id: + return "TestStructArrayArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestStructArgumentRequest::Id: + return "TestStructArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestNestedStructArgumentRequest::Id: + return "TestNestedStructArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestListStructArgumentRequest::Id: + return "TestListStructArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestListInt8UArgumentRequest::Id: + return "TestListInt8UArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestNestedStructListArgumentRequest::Id: + return "TestNestedStructListArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestListNestedStructListArgumentRequest::Id: + return "TestListNestedStructListArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestListInt8UReverseRequest::Id: + return "TestListInt8UReverseRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestEnumsRequest::Id: + return "TestEnumsRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalRequest::Id: + return "TestNullableOptionalRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestComplexNullableOptionalRequest::Id: + return "TestComplexNullableOptionalRequest"; + case chip::app::Clusters::UnitTesting::Commands::SimpleStructEchoRequest::Id: + return "SimpleStructEchoRequest"; + case chip::app::Clusters::UnitTesting::Commands::TimedInvokeRequest::Id: + return "TimedInvokeRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestSimpleOptionalArgumentRequest::Id: + return "TestSimpleOptionalArgumentRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventRequest::Id: + return "TestEmitTestEventRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventRequest::Id: + return "TestEmitTestFabricScopedEventRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestBatchHelperRequest::Id: + return "TestBatchHelperRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestSecondBatchHelperRequest::Id: + return "TestSecondBatchHelperRequest"; + case chip::app::Clusters::UnitTesting::Commands::StringEchoRequest::Id: + return "StringEchoRequest"; + case chip::app::Clusters::UnitTesting::Commands::GlobalEchoRequest::Id: + return "GlobalEchoRequest"; + case chip::app::Clusters::UnitTesting::Commands::TestDifferentVendorMeiRequest::Id: + return "TestDifferentVendorMeiRequest"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::FaultInjection::Id: { + switch (id) + { + case chip::app::Clusters::FaultInjection::Commands::FailAtFault::Id: + return "FailAtFault"; + case chip::app::Clusters::FaultInjection::Commands::FailRandomlyAtFault::Id: + return "FailRandomlyAtFault"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::SampleMei::Id: { + switch (id) + { + case chip::app::Clusters::SampleMei::Commands::Ping::Id: + return "Ping"; + case chip::app::Clusters::SampleMei::Commands::AddArguments::Id: + return "AddArguments"; + default: + return "Unknown"; + } + } + default: + return "Unknown"; + } +} + +char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId id) +{ + switch (cluster) + { + case chip::app::Clusters::Groups::Id: { + switch (id) + { + case chip::app::Clusters::Groups::Commands::AddGroupResponse::Id: + return "AddGroupResponse"; + case chip::app::Clusters::Groups::Commands::ViewGroupResponse::Id: + return "ViewGroupResponse"; + case chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::Id: + return "GetGroupMembershipResponse"; + case chip::app::Clusters::Groups::Commands::RemoveGroupResponse::Id: + return "RemoveGroupResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AccessControl::Id: { + switch (id) + { + case chip::app::Clusters::AccessControl::Commands::ReviewFabricRestrictionsResponse::Id: + return "ReviewFabricRestrictionsResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OtaSoftwareUpdateProvider::Id: { + switch (id) + { + case chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::Id: + return "QueryImageResponse"; + case chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::Id: + return "ApplyUpdateResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GeneralCommissioning::Id: { + switch (id) + { + case chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::Id: + return "ArmFailSafeResponse"; + case chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::Id: + return "SetRegulatoryConfigResponse"; + case chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::Id: + return "CommissioningCompleteResponse"; + case chip::app::Clusters::GeneralCommissioning::Commands::SetTCAcknowledgementsResponse::Id: + return "SetTCAcknowledgementsResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::NetworkCommissioning::Id: { + switch (id) + { + case chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::Id: + return "ScanNetworksResponse"; + case chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::Id: + return "NetworkConfigResponse"; + case chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::Id: + return "ConnectNetworkResponse"; + case chip::app::Clusters::NetworkCommissioning::Commands::QueryIdentityResponse::Id: + return "QueryIdentityResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DiagnosticLogs::Id: { + switch (id) + { + case chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::Id: + return "RetrieveLogsResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GeneralDiagnostics::Id: { + switch (id) + { + case chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshotResponse::Id: + return "TimeSnapshotResponse"; + case chip::app::Clusters::GeneralDiagnostics::Commands::PayloadTestResponse::Id: + return "PayloadTestResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TimeSynchronization::Id: { + switch (id) + { + case chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::Id: + return "SetTimeZoneResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OperationalCredentials::Id: { + switch (id) + { + case chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::Id: + return "AttestationResponse"; + case chip::app::Clusters::OperationalCredentials::Commands::CertificateChainResponse::Id: + return "CertificateChainResponse"; + case chip::app::Clusters::OperationalCredentials::Commands::CSRResponse::Id: + return "CSRResponse"; + case chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id: + return "NOCResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::GroupKeyManagement::Id: { + switch (id) + { + case chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::Id: + return "KeySetReadResponse"; + case chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::Id: + return "KeySetReadAllIndicesResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::IcdManagement::Id: { + switch (id) + { + case chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::Id: + return "RegisterClientResponse"; + case chip::app::Clusters::IcdManagement::Commands::StayActiveResponse::Id: + return "StayActiveResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OvenCavityOperationalState::Id: { + switch (id) + { + case chip::app::Clusters::OvenCavityOperationalState::Commands::OperationalCommandResponse::Id: + return "OperationalCommandResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OvenMode::Id: { + switch (id) + { + case chip::app::Clusters::OvenMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::LaundryWasherMode::Id: { + switch (id) + { + case chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id: { + switch (id) + { + case chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcRunMode::Id: { + switch (id) + { + case chip::app::Clusters::RvcRunMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcCleanMode::Id: { + switch (id) + { + case chip::app::Clusters::RvcCleanMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DishwasherMode::Id: { + switch (id) + { + case chip::app::Clusters::DishwasherMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::OperationalState::Id: { + switch (id) + { + case chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id: + return "OperationalCommandResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::RvcOperationalState::Id: { + switch (id) + { + case chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id: + return "OperationalCommandResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ScenesManagement::Id: { + switch (id) + { + case chip::app::Clusters::ScenesManagement::Commands::AddSceneResponse::Id: + return "AddSceneResponse"; + case chip::app::Clusters::ScenesManagement::Commands::ViewSceneResponse::Id: + return "ViewSceneResponse"; + case chip::app::Clusters::ScenesManagement::Commands::RemoveSceneResponse::Id: + return "RemoveSceneResponse"; + case chip::app::Clusters::ScenesManagement::Commands::RemoveAllScenesResponse::Id: + return "RemoveAllScenesResponse"; + case chip::app::Clusters::ScenesManagement::Commands::StoreSceneResponse::Id: + return "StoreSceneResponse"; + case chip::app::Clusters::ScenesManagement::Commands::GetSceneMembershipResponse::Id: + return "GetSceneMembershipResponse"; + case chip::app::Clusters::ScenesManagement::Commands::CopySceneResponse::Id: + return "CopySceneResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EnergyEvse::Id: { + switch (id) + { + case chip::app::Clusters::EnergyEvse::Commands::GetTargetsResponse::Id: + return "GetTargetsResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::EnergyEvseMode::Id: { + switch (id) + { + case chip::app::Clusters::EnergyEvseMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WaterHeaterMode::Id: { + switch (id) + { + case chip::app::Clusters::WaterHeaterMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DeviceEnergyManagementMode::Id: { + switch (id) + { + case chip::app::Clusters::DeviceEnergyManagementMode::Commands::ChangeToModeResponse::Id: + return "ChangeToModeResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::DoorLock::Id: { + switch (id) + { + case chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::Id: + return "GetWeekDayScheduleResponse"; + case chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::Id: + return "GetYearDayScheduleResponse"; + case chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::Id: + return "GetHolidayScheduleResponse"; + case chip::app::Clusters::DoorLock::Commands::GetUserResponse::Id: + return "GetUserResponse"; + case chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::Id: + return "SetCredentialResponse"; + case chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::Id: + return "GetCredentialStatusResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ServiceArea::Id: { + switch (id) + { + case chip::app::Clusters::ServiceArea::Commands::SelectAreasResponse::Id: + return "SelectAreasResponse"; + case chip::app::Clusters::ServiceArea::Commands::SkipAreaResponse::Id: + return "SkipAreaResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Thermostat::Id: { + switch (id) + { + case chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::Id: + return "GetWeeklyScheduleResponse"; + case chip::app::Clusters::Thermostat::Commands::AtomicResponse::Id: + return "AtomicResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::WiFiNetworkManagement::Id: { + switch (id) + { + case chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseResponse::Id: + return "NetworkPassphraseResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThreadBorderRouterManagement::Id: { + switch (id) + { + case chip::app::Clusters::ThreadBorderRouterManagement::Commands::DatasetResponse::Id: + return "DatasetResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ThreadNetworkDirectory::Id: { + switch (id) + { + case chip::app::Clusters::ThreadNetworkDirectory::Commands::OperationalDatasetResponse::Id: + return "OperationalDatasetResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::Channel::Id: { + switch (id) + { + case chip::app::Clusters::Channel::Commands::ChangeChannelResponse::Id: + return "ChangeChannelResponse"; + case chip::app::Clusters::Channel::Commands::ProgramGuideResponse::Id: + return "ProgramGuideResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::TargetNavigator::Id: { + switch (id) + { + case chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Id: + return "NavigateTargetResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::MediaPlayback::Id: { + switch (id) + { + case chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id: + return "PlaybackResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::KeypadInput::Id: { + switch (id) + { + case chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::Id: + return "SendKeyResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentLauncher::Id: { + switch (id) + { + case chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::Id: + return "LauncherResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ApplicationLauncher::Id: { + switch (id) + { + case chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Id: + return "LauncherResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::AccountLogin::Id: { + switch (id) + { + case chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Id: + return "GetSetupPINResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentControl::Id: { + switch (id) + { + case chip::app::Clusters::ContentControl::Commands::ResetPINResponse::Id: + return "ResetPINResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ContentAppObserver::Id: { + switch (id) + { + case chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessageResponse::Id: + return "ContentAppMessageResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::CommissionerControl::Id: { + switch (id) + { + case chip::app::Clusters::CommissionerControl::Commands::ReverseOpenCommissioningWindow::Id: + return "ReverseOpenCommissioningWindow"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::ElectricalMeasurement::Id: { + switch (id) + { + case chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoResponseCommand::Id: + return "GetProfileInfoResponseCommand"; + case chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileResponseCommand::Id: + return "GetMeasurementProfileResponseCommand"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::UnitTesting::Id: { + switch (id) + { + case chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::Id: + return "TestSpecificResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::Id: + return "TestAddArgumentsResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentResponse::Id: + return "TestSimpleArgumentResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestStructArrayArgumentResponse::Id: + return "TestStructArrayArgumentResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestListInt8UReverseResponse::Id: + return "TestListInt8UReverseResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestEnumsResponse::Id: + return "TestEnumsResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalResponse::Id: + return "TestNullableOptionalResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestComplexNullableOptionalResponse::Id: + return "TestComplexNullableOptionalResponse"; + case chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id: + return "BooleanResponse"; + case chip::app::Clusters::UnitTesting::Commands::SimpleStructResponse::Id: + return "SimpleStructResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::Id: + return "TestEmitTestEventResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::Id: + return "TestEmitTestFabricScopedEventResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestBatchHelperResponse::Id: + return "TestBatchHelperResponse"; + case chip::app::Clusters::UnitTesting::Commands::StringEchoResponse::Id: + return "StringEchoResponse"; + case chip::app::Clusters::UnitTesting::Commands::GlobalEchoResponse::Id: + return "GlobalEchoResponse"; + case chip::app::Clusters::UnitTesting::Commands::TestDifferentVendorMeiResponse::Id: + return "TestDifferentVendorMeiResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::SampleMei::Id: { + switch (id) + { + case chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::Id: + return "AddArgumentsResponse"; + default: + return "Unknown"; + } + } + default: + return "Unknown"; + } +} diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.h new file mode 100644 index 00000000000000..27fa6512fbdd01 --- /dev/null +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.h @@ -0,0 +1,30 @@ +/* + * + * 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. + */ + +// THIS FILE IS GENERATED BY ZAP + +#include +#include +#include + +char const * ClusterIdToText(chip::ClusterId id); + +char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id); + +char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id); + +char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId id); From 07789d41bb849e18a970451c6bd6c7189cbc5362 Mon Sep 17 00:00:00 2001 From: William Date: Thu, 22 Aug 2024 09:56:19 +0100 Subject: [PATCH 52/52] Truncate map and area names (#35127) * Updated the setting of the area and map names so that if the name given is greater than the buffer size, it's truncated rater to set to empty. * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../service-area-cluster-objects.h | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/app/clusters/service-area-server/service-area-cluster-objects.h b/src/app/clusters/service-area-server/service-area-cluster-objects.h index 66f20720701587..69a392a874f49d 100644 --- a/src/app/clusters/service-area-server/service-area-cluster-objects.h +++ b/src/app/clusters/service-area-server/service-area-cluster-objects.h @@ -109,12 +109,14 @@ struct AreaStructureWrapper : public chip::app::Clusters::ServiceArea::Structs:: const DataModel::Nullable & areaType) { areaDesc.locationInfo.SetNonNull(); - // Copy the name - auto areaNameSpan = MutableCharSpan(mAreaNameBuffer, kAreaNameMaxSize); - CopyCharSpanToMutableCharSpan(locationName, areaNameSpan); - areaDesc.locationInfo.Value().locationName = CharSpan(areaNameSpan.data(), areaNameSpan.size()); - areaDesc.locationInfo.Value().floorNumber = floorNumber; - areaDesc.locationInfo.Value().areaType = areaType; + + // Copy the name. If the name is larger than kAreaNameMaxSize, truncate it to fit. + auto sizeToCopy = std::min(kAreaNameMaxSize, locationName.size()); + memcpy(mAreaNameBuffer, locationName.data(), sizeToCopy); + areaDesc.locationInfo.Value().locationName = CharSpan(mAreaNameBuffer, sizeToCopy); + + areaDesc.locationInfo.Value().floorNumber = floorNumber; + areaDesc.locationInfo.Value().areaType = areaType; return *this; } @@ -320,10 +322,11 @@ struct MapStructureWrapper : public chip::app::Clusters::ServiceArea::Structs::M */ void Set(uint32_t aMapId, const CharSpan & aMapName) { - mapID = aMapId; - auto mapNameSpan = MutableCharSpan(mMapNameBuffer, kMapNameMaxSize); - CopyCharSpanToMutableCharSpan(aMapName, mapNameSpan); - name = CharSpan(mapNameSpan.data(), mapNameSpan.size()); + mapID = aMapId; + // Copy the name. If the name is larger than kMapNameMaxSize, truncate it to fit. + auto sizeToCopy = std::min(kMapNameMaxSize, aMapName.size()); + memcpy(mMapNameBuffer, aMapName.data(), sizeToCopy); + name = CharSpan(mMapNameBuffer, sizeToCopy); } /**